Merge lp:~cjwatson/launchpad/export-change-override into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Graham Binns |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15449 |
Proposed branch: | lp:~cjwatson/launchpad/export-change-override |
Merge into: | lp:launchpad |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/export-change-override |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Review via email: mp+109549@code.launchpad.net |
Commit message
Export SourcePackagePu
Description of the change
== Summary ==
change-override.py, used frequently by Ubuntu archive administrators, requires direct database access (bug 853831).
== Proposed fix ==
Export SPPH.changeOverride and BPPH.changeOver
== Implementation details ==
The exports require a slight rearrangement of the *PPH interfaces, creating IBinaryPackageP
I moved ArchiveOverride
In order to make this testable within the existing publishing webservice tests, I had to fix a buglet whereby changeOverride complains about a component override requiring a new archive even if it wasn't actually asked to change the component. This doesn't normally make any difference, but the webservice tests work in a PPA and in that case it does.
I did seriously contemplate refactoring the doctests here as unit tests and avoiding sampledata and the like, which would have made it much more straightforward to do some tests using a PRIMARY archive instead, and in fact I did start in on that; but I eventually decided it would make the branch too unwieldy and unclear. I've kept my progress on that around and will probably submit it as a separate branch at some point.
I took care to export these new methods only on devel.
This may not be desperately performant when overriding large numbers of binary packages. I'm not too worried about this as an operational showstopper, and I don't believe that this branch will slow any of the current interfaces down, but I'd take suggestions for alternative ways to approach the new interfaces; something on Archive maybe? (See also https:/
== LOC Rationale ==
+134, but there's at minimum 210 lines of scripts/
== Tests ==
bin/test -vvct xx-source-
== Demo and Q/A ==
Using lp-shell on qastaging, use *PPH.changeOverride on some randomly selected source and binary publication records (perhaps based on http://
== Lint ==
Pre-existing lint, not worth fixing here:
./lib/lp/
192: want exceeds 78 characters.
210: want exceeds 78 characters.
220: source exceeds 78 characters.
225: source exceeds 78 characters.
230: source exceeds 78 characters.
235: source exceeds 78 characters.
240: source exceeds 78 characters.
Hi Colin,
Overall, I like this branch, and I'm happy for it to land (I'll just
have Robert hold you to your commitment to trim the LoC elsewhere ;)).
Just one question:
188 + # Really IBinaryPackageP ublishingHistor y, patched in circular_ imports. py. returns_ entry(Interface ) parameters( TextLine( title=u" The new component name."), TextLine( title=u" The new section name."), TextLine( title=u" The new priority name.")) write_operation () for_version( "devel" ) new_component= None, new_section=None,
189 + # _schema_
190 + @operation_
191 + @operation_
192 + new_component=
193 + new_section=
194 + new_priority=
195 + @export_
196 + @operation_
197 + def changeOverride(
198 + new_priority=None):
I'm confused as to why you're using TextLine here for new_priority ngHistory. priority) , which would mean that you
(unless there's some pitfall in using copy_field() between different
interfaces; I don't know about that). You should be able to use
copy_field() here to copy the relevant field ( in this case I'm guessing
it'd be IBinaryPublishi
don't have to do a lookup for the priority in name_priority_map later on
(line 297 of the diff)- lazr.restful would take care of that for you.
You can see an example of this in lib/lp/ bugs/interfaces /bugtask. py:750.