Merge lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-getPubConfig-proc-accept into lp:launchpad
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-getPubConfig-proc-accept |
| Merge into: | lp:launchpad |
| Diff against target: |
438 lines (+234/-110) 4 files modified
lib/lp/soyuz/scripts/processaccepted.py (+112/-2) lib/lp/soyuz/tests/test_processaccepted.py (+85/-0) lib/lp/soyuz/tests/test_publishing.py (+29/-6) scripts/process-accepted.py (+8/-102) |
| To merge this branch: | bzr merge lp:~julian-edwards/launchpad/publish-copy-archives-bug-520520-getPubConfig-proc-accept |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Graham Binns (community) | code | 2010-02-23 | Approve on 2010-02-23 |
|
Review via email:
|
|||
| Julian Edwards (julian-edwards) wrote : | # |
| Graham Binns (gmb) wrote : | # |
Hi Julian,
Couple of minor nitpicks, but the branch looks good.
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -35,6 +35,7 @@
> from lp.soyuz.
> from lp.soyuz.
> from lp.soyuz.
> +from lp.soyuz.
> from lp.soyuz.
> PackagePublishi
> from canonical.
> @@ -130,12 +131,20 @@
> def addPackageUploa
> pocket=
> changes_
> - changes_
> + changes_
> + upload_
> signing_key = self.person.
> package_upload = distroseries.
> pocket, changes_file_name, changes_
> signing_key)
> - package_
> +
> + status_to_method = {
> + PackageUploadSt
> + PackageUploadSt
> + }
Minor nit here: our coding guidelines say that the closing brace should
be indented to the same level as the dict contents. Also, the last item
in the dict should have a comma at the end of it.
> + method = getattr(
> + method()
> +
> return package_upload
>
> def getPubSource(self, sourcename=None, version='666', component='main',
> @@ -152,8 +161,13 @@
> dsc_binaries=
> build_conflicts
> dsc_maintainer_
> - maintainer=None, creator=None, date_uploaded=
> - """Return a mock source publishing record."""
> + maintainer=None, creator=None, date_uploaded=
> + spr_only=False):
> + """Return a mock source publishing record.
> +
> + if spr_only is specified, the source is not published and the
> + sourcepackagere
> + """
> if sourcename is None:
> sourcename = self.default_
> spn = getUtility(
> @@ -194,12 +208,20 @@
> archive=archive, dateuploaded=
>
> changes_file_name = "%s_%s_
> + if spr_only:
> + upload_status = PackageUploadSt
> + else:
> + upload_status = PackageUploadSt
> package_upload = self.addPackage
> ...

= Summary =
Make process-accepted.py cope with rebuild archives
== Proposed fix ==
As part of publishing rebuild archives, we need to make process-accepted work
for them because when builds get uploaded, they are not auto-accepted.
== Pre-implementation notes ==
This is a simple fix, but the existing tests are a total shambles. Therefore
I decided to convert the script into a LaunchpadScript which makes it easier
to unit test. This change forms 95% of the diff.
== Implementation details ==
There's a new test file which does the Right Thing in regards to unit testing.
(i.e. it doesn't use Popen like some of the existing tests)
The test calls the script object and passes in the new option --copy-archives
and makes sure that it only accepts those, not anything in the main archive.
I also had to change SoyuzTestPublisher so that it creates packages in a pre-
accepted state.
There's also some bits of lint fixed.
== Tests == epted
bin/test -cvv test_processacc
== Demo and Q/A ==
Nothing for this branch, the final feature will be QA'ed.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: soyuz/tests/ test_publishing .py soyuz/scripts/ processaccepted .py soyuz/tests/ test_processacc epted.py process- accepted. py
lib/lp/
lib/lp/
lib/lp/
scripts/