Merge lp:~jtv/launchpad/pre-876594 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 14202 |
Proposed branch: | lp:~jtv/launchpad/pre-876594 |
Merge into: | lp:launchpad |
Diff against target: |
646 lines (+203/-174) 7 files modified
lib/lp/archiveuploader/tests/nascentupload-announcements.txt (+4/-4) lib/lp/soyuz/adapters/notification.py (+82/-78) lib/lp/soyuz/adapters/tests/test_notification.py (+70/-66) lib/lp/soyuz/doc/distroseriesqueue-dist-upgrader.txt (+2/-0) lib/lp/soyuz/doc/distroseriesqueue-notify.txt (+40/-19) lib/lp/soyuz/model/queue.py (+1/-1) lib/lp/soyuz/scripts/packagecopier.py (+4/-6) |
To merge this branch: | bzr merge lp:~jtv/launchpad/pre-876594 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Approve | ||
Review via email: mp+80537@code.launchpad.net |
Commit message
[r=lifeless][no-qa] Cleanups for package upload notification.
Description of the change
= Summary =
We need to make some changes to Soyuz upload notification. Actually this also covers copying, building, and syncing of packages.
Unfortunately the code has become a bit of a mess and some of the tests are painfully brittle.
== Proposed fix ==
Before fixing the bug itself, clean up the code. Make tests independent of arbitrary ordering of email addressee lists; eliminate needless repetition of code; make the name of the function we'll be changing a bit more specific; make complicated code a bit more concise so we can reason about it more effectively.
== Pre-implementation notes ==
Discussed the bigger picture with Julian. We're going to exempt package maintainers and authors from notification for packages that are being accepted into different archives than their releases are in. We'll also want to see if we can remove complexity from notify() that reflects knowledge inherent in the callsite.
== Implementation details ==
The recipients-
This will affect the logging a bit: the code will now happily say it's adding both the maintainer and the last author to the set of recipients, even if they're the same person. It may actually be clearer; certainly the code becomes easier to manage.
== Tests ==
{{{
./bin/test -vvc lp.archiveuploader
./bin/test -vvc lp.soyuz
}}}
== Demo and Q/A ==
There are no functional changes, so as long as nothing oopses, it should be fine.
= Launchpad lint =
I'll address the lint in distroseriesque
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
186: want exceeds 78 characters.
187: want exceeds 78 characters.
659: want exceeds 78 characters.
726: want exceeds 78 characters.
728: want exceeds 78 characters.
774: want exceeds 78 characters.
776: want exceeds 78 characters.
./lib/lp/
145: want exceeds 78 characters.
148: want exceeds 78 characters.
./lib/lp/
1: narrative uses a moin header.
6: source has bad indentation.
9: narrative has trailing whitespace.
10: narrative has trailing whitespace.
13: source has bad indentation.
21: source exceeds 78 characters.
21: source has bad indentation.
41: source has bad indentation.
60: source has bad indentation.
67: source has bad indentation.
74: source has bad indentation.
79: source has bad indentation.
84: source has bad indentation.
102: narrative has trailing whitespace.
103: narrative has trailing whitespace.
106: source has bad indentation.
113: source has bad indentation.
133: source has bad indentation.
140: source has bad indentation.
144: source has bad indentation.
150: source has bad indentation.
155: source has bad indentation.
161: source has bad indentation.
168: source has bad indentation.
173: source has bad indentation.
178: source has bad indentation.
200: source has bad indentation.
218: source has bad indentation.
222: source has bad indentation.
229: source has bad indentation.
234: source has bad indentation.
256: source has bad indentation.
277: source has bad indentation.
283: source has bad indentation.
./lib/lp/
217: Line exceeds 78 characters.
218: Line exceeds 78 characters.
222: Line exceeds 78 characters.
217: E501 line too long (85 characters)
218: E501 line too long (82 characters)
222: E501 line too long (82 characters)
10 + ... for entry in sorted( [addr.strip( ) for addr in field.split(',')]):
11 + ... print entry
and also in addresses( header_ field):
509 + >>> def extract_
might be better as re.split( field, ' \t\r\n,')):
for entry in sorted(
86 + # Some syncs (e.g. from Debian) will involve packages whose person( info['changedby '])
87 + # changed-by person was auto-created in LP and hence does not have a
88 + # preferred email address set.
89 + changedby_person = email_to_
The comment here now looks wonky - there is no special casing happening, so perhaps it should move to email_to_person?
I think this existing comment:
196 # Now filter list of recipients for persons only registered in
197 # Launchpad to avoid spamming the innocent.
means 'Do not email persons that have not configured a preferred email - e.g. folk listed in Launchpad who have not activated their account'. If so, and if my phrasing is clearer, feel free to update it.
For this:
231 + if fullemail is None or fullemail == '':
232 + return None
I would write 'if not fullemail:' - thats what __nonzero__ is for, and its correct here. Our style guide was updated a while ago to remove the admonition that this was bad (its not).
person_to_email looks like something other bits of code (e.g. incoming- mail-processing ) will want/need; since you are here you could consider deduping.
Looks fine to me, these are all tweaks.