Merge ~racb/git-ubuntu:reimport-service into git-ubuntu:master
Proposed by
Robie Basak
Status: | Merged |
---|---|
Merged at revision: | f86c5bf978682d7502f15bf75f630599a38150b4 |
Proposed branch: | ~racb/git-ubuntu:reimport-service |
Merge into: | git-ubuntu:master |
Diff against target: |
1189 lines (+657/-145) 6 files modified
bin/import-source-packages.py (+83/-35) gitubuntu/importer_service.py (+162/-37) gitubuntu/importer_service_test.py (+252/-17) gitubuntu/mailer.py (+42/-14) gitubuntu/mailer_test.py (+79/-13) gitubuntu/scriptutils.py (+39/-29) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bryce Harrington | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+384270@code.staging.launchpad.net |
Commit message
Make Jenkins happy
To post a comment you must log in.
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.
a5a60328982db82 1500f5157481ed1 eb9c7627cb
+ parser. add_argument(
+ '-o',
+ '--lp-owner',
+ type=str,
+ help=(
+ "The Launchpad user to authenticate against for the imports, as "
+ "passed to 'git ubuntu import -l'"
I think the help text here is swapped with the text for --lp-user.
Also, just for consistency list the parser.add_argument for --lp-user first, and --lp-owner second, so the order is consistent with the ordering of lp_user, lp_owner in the rest of the code. (I'll bet the reversed order is what led to the above typo.)
The distinction between --lp-user and --lp-owner was not immediately clear to me, and the docs didn't clarify it in my head. Looking at importer.py I see that lp_user is what's used for authenticated communications with launchpad, whereas lp_owner is the owner for the git repository that will be created or updated. And, I can see the confusion comes from the importer.py parameter descriptions, your branch simply inherits the confusion.
Anyway, I think this might be clearer help description for --lp-owner:
+ "The username that will own the git repository being imported, as "
+ "passed to 'git ubuntu import -o'"
c754c56a1aa0031 5d9a8d61df6b271 6b5b6eb66a
The 'tuple(str, bool)' mentioned as the standard type being used for a "request" makes me wonder if this might be worth creating a little class for, so functions can pass better defined objects. Then instead of a bool for import vs. reimport you could use an enumeration like you did for PatchState (c.f. 369f645c); you're casting the bool to 0 or 1 in several places already, so it feels like it wants to be an enum. From the FIXME comment I wonder if being able to track "pending" or other states might be of use some day, so an enum may be more extensible than a bool.
Nice work cleaning up so much codedocs, and the test cases look good as well; I see what you mean about some of it being difficult to write tests for, but there's more test cases than I thought there'd be.
typo: requset -> request
The rest looks good, easy to follow and makes sense. I didn't have time to run the testsuite but will do so on the followup review.