Merge lp:~cjwatson/launchpad/copy-auto-approve into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15722 |
Proposed branch: | lp:~cjwatson/launchpad/copy-auto-approve |
Merge into: | lp:launchpad |
Prerequisite: | lp:~cjwatson/launchpad/copy-allows-queue-admin |
Diff against target: |
379 lines (+148/-19) 5 files modified
lib/lp/soyuz/interfaces/archive.py (+18/-2) lib/lp/soyuz/interfaces/packagecopyjob.py (+13/-2) lib/lp/soyuz/model/archive.py (+6/-4) lib/lp/soyuz/model/packagecopyjob.py (+26/-11) lib/lp/soyuz/tests/test_packagecopyjob.py (+85/-0) |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/copy-auto-approve |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benji York (community) | code | Approve | |
Review via email: mp+117299@code.launchpad.net |
Commit message
Add auto_approve parameter to Archive.copyPackage and Archive.
Description of the change
== Summary ==
Bug 1006871: in some cases it is cumbersome to have to approve package copies as a separate step, particularly given the delay on processing PackageCopyJobs. There should be a way for queue admins to copy a package and approve the copy in a single step. The bug has some concrete use cases for this.
== Proposed fix ==
Add an auto_approve parameter to Archive.copyPackage and Archive.
== Pre-implementation notes ==
Iain Lane suggested that this should be explicit rather than (my initial proposal) implicit. On reflection, this is obviously correct. If I run syncpackage to copy a package from Debian, and Ubuntu happens to be frozen at the time, then it should go through UNAPPROVED even though I'm an Ubuntu archive administrator and thus have queue admin permissions. On the other hand, if (acting as an archive admin) I run sru-release to copy a verified stable release update from -proposed to -updates, I'm always going to accept it immediately afterwards so it makes sense to let me skip that extra step.
== Implementation details ==
There's a little duplication in PlainPackageCop
I arranged to silently ignore auto_approve=True from non-queue-admins because it's harmless to do so and it makes it easier to write tools that work for people both with and without queue admin permissions. (For instance, the kernel team sometimes copy packages from their PPA to the -proposed pocket in the primary archive and ask us to accept them; but since the copy-proposed-
== LOC Rationale ==
+129. I have 1833 lines of credit at the moment, and, as mentioned in https:/
== Tests ==
bin/test -vvct test_packagecopyjob
== Demo and Q/A ==
Add auto_approve=True to the Archive.copyPackage calls in sru-release in lp:ubuntu-archive-tools, and use this to copy a package from -proposed to -updates on dogfood (with queue admin permissions). It should be automatically accepted. Without that parameter, the copy should land in the unapproved queue.
== Lint ==
Just a pre-existing false positive due to pocketlint not understanding property setters:
./lib/lp/
346: redefinition of function 'private' from line 342
Looks good.