Merge lp:~michael.nelson/launchpad/656166-expose-dsd-diffs into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Gavin Panella on 2010-10-07 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9936 |
| Proposed branch: | lp:~michael.nelson/launchpad/656166-expose-dsd-diffs |
| Merge into: | lp:launchpad/db-devel |
| Prerequisite: | lp:~michael.nelson/launchpad/638090-base_version-property-for-differences |
| Diff against target: |
864 lines (+602/-47) 11 files modified
lib/lp/code/interfaces/branchmergequeue.py (+115/-0) lib/lp/code/model/branchmergequeue.py (+83/-0) lib/lp/code/model/tests/test_branchmergequeue.py (+155/-0) lib/lp/registry/browser/tests/test_distroseriesdifference_webservice.py (+54/-1) lib/lp/registry/browser/tests/test_series_views.py (+7/-3) lib/lp/registry/errors.py (+14/-0) lib/lp/registry/exceptions.py (+0/-17) lib/lp/registry/interfaces/distroseriesdifference.py (+27/-0) lib/lp/registry/model/distroseriesdifference.py (+61/-7) lib/lp/registry/tests/test_distroseriesdifference.py (+77/-19) lib/lp/testing/factory.py (+9/-0) |
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/656166-expose-dsd-diffs |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gavin Panella (community) | 2010-10-07 | Approve on 2010-10-07 | |
|
Review via email:
|
|||
Commit Message
API to generate package diffs for IDistroSeriesDi
Description of the Change
Overview
========
This branch adds the ability to request the generation of package diffs for DistroSeriesDif
Details
=======
I removed lp.registry.
Generating the diffs also required adding a base_source_pub attribute to IDSDifference.
Test
====
bin/test -vvm test_distroseri
| Michael Nelson (michael.nelson) wrote : | # |
On Thu, Oct 7, 2010 at 5:58 PM, Gavin Panella
<email address hidden> wrote:
> Review: Approve
> Looks great :)
>
> Three fairly trivial comments.
Thanks for the review Gavin, comments below.
>
> +1
>
>
> [1]
>
> + def test_package_
> + # The package diff urls exposed.
> + ds_diff = self.factory.
> + naked_dsdiff = removeSecurityP
> + naked_
> + status=
> + naked_
> +
> + ws_diff = ws_object(
> + ds_diff.owner), ds_diff)
> +
> + self.assertEqu
> + self.assertTru
> + 'http://
>
> What does this demonstrate? Is that a link to the librarian? If so can
> you add a comment explaining what it is.
>
> I'm a little bit worried that this test is fragile, after reading some
> of the discussions on launchpad-dev about just-in-time configuration
> of the librarian, amongst other things. Maybe I got the wrong end of
> the stick. Anyway, it seems to me that it's enough just to show that
> parent_
Done.
>
> On that note, assertIs(None, ...) and assertIsNot(None, ...) might be
> more appropriate for testing against None, but I don't think it
> actually matters. Ah, I see you've used it later.
>
>
> [2]
>
> + pubs = self.derived_
> + self.source_
> + include_
> + return pubs[0]
>
> Could getPublishedSou
Given that we know the base version was published in the distroseries'
main archive, we can be sure that we can get it back... however, you
prompted me to check getPublishedSou
currently PUBLISHED or PENDING sources, which was fine for my tests,
but in reality the base version will be superseded. So I've updated my
tests and refactored this to ensure we return the specific
base-version irrespective of its status. I added a comment too,
explaining why pubs[0] is ok (or why I'd use pubs.one() if it was a
storm result set).
>
>
> [3]
>
> + base_version = versions.
> + if base_version:
>
> s/:/ is not None:/
Done. Thanks! Incremental here: http://
| Gavin Panella (allenap) wrote : | # |
Cool, thanks for the explanation :)

Looks great :)
Three fairly trivial comments.
+1
[1]
+ def test_package_ diffs(self) : makeDistroSerie sDifference( ) roxy(ds_ diff) package_ diff = self.factory. makePackageDiff ( PackageDiffStat us.PENDING) parent_ package_ diff = self.factory. makePackageDiff () self.factory. makeLaunchpadSe rvice( l(None, ws_diff. package_ diff_url) (ws_diff. parent_ package_ diff_url. startswith( localhost: 58000/'))
+ # The package diff urls exposed.
+ ds_diff = self.factory.
+ naked_dsdiff = removeSecurityP
+ naked_dsdiff.
+ status=
+ naked_dsdiff.
+
+ ws_diff = ws_object(
+ ds_diff.owner), ds_diff)
+
+ self.assertEqua
+ self.assertTrue
+ 'http://
What does this demonstrate? Is that a link to the librarian? If so can
you add a comment explaining what it is.
I'm a little bit worried that this test is fragile, after reading some package_ diff_url is not None.
of the discussions on launchpad-dev about just-in-time configuration
of the librarian, amongst other things. Maybe I got the wrong end of
the stick. Anyway, it seems to me that it's enough just to show that
parent_
On that note, assertIs(None, ...) and assertIsNot(None, ...) might be
more appropriate for testing against None, but I don't think it
actually matters. Ah, I see you've used it later.
[2]
+ pubs = self.derived_ series. getPublishedSou rces( package_ name, version= self.base_ version, pending= True)
+ self.source_
+ include_
+ return pubs[0]
Could getPublishedSou rces() ever return an empty list?
[3]
+ base_version = versions. get('base' )
+ if base_version:
s/:/ is not None:/