Merge lp://staging/~rvb/launchpad/dsd-api-bug-766158 into lp://staging/launchpad/db-devel

Proposed by Raphaël Badin
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 10513
Proposed branch: lp://staging/~rvb/launchpad/dsd-api-bug-766158
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~stevenk/launchpad/db-use-dsp
Diff against target: 378 lines (+180/-22)
9 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+14/-0)
lib/lp/registry/browser/tests/test_distroseries_webservice.py (+44/-0)
lib/lp/registry/interfaces/distribution.py (+1/-1)
lib/lp/registry/interfaces/distroseries.py (+41/-0)
lib/lp/registry/interfaces/distroseriesdifference.py (+7/-3)
lib/lp/registry/model/distroseries.py (+15/-0)
lib/lp/registry/model/distroseriesdifference.py (+10/-3)
lib/lp/registry/tests/test_distroseriesdifference.py (+34/-4)
lib/lp/testing/factory.py (+14/-11)
To merge this branch: bzr merge lp://staging/~rvb/launchpad/dsd-api-bug-766158
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+59227@code.staging.launchpad.net

Commit message

[r=danilo][bug=766158] Add an method IDistroSeries.getDifferencesTo to retrieve differences to a specific parent or all parents of the series. Expose this method on the 'devel' api.

Description of the change

This branch adds a method IDistroSeries.getDifferencesTo to find DistroSeriesDifferences for a DistroSeries (this method is exposed on the 'devel' api).

= Details =
This branch is branched off lp:~stevenk/launchpad/db-use-dsp which removes the usage of IDistroSeries.parent_series in DSDs and DSDJs.
The method getDifferencesTo is a simple wrapper around IDistroSeriesDifferenceSource.getForDistroSeries. This branch fixes IDSDS.getForDistroSeries and the testing factory methods to work in the context of multiple parents.

= Tests =
(added test)
./bin/test -cvv test_distroseriesdifference test_getForDistroSeries_filters_by_parent
./bin/test -cvv test_distroseries_webservice test_getDifferencesTo
(fixed test)
./bin/test -cvv test_distroseriesdifference test_getForDistroSeries_filters_by_type

= QA =
Once lp:~stevenk/launchpad/db-use-dsp is merged and qa-ed, this can be tested by calling the api on a distroseries with multiple parents to fetch differences.

= Drive-by fixes =
- Add missing assert statement in test_getForDistroSeries_filters_by_type (lib/lp/registry/tests/test_distroseriesdifference.py).
- his branch also fixes a small glitch in lib/lp/registry/interfaces/distribution.py.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

Several issues as discussed on IRC:

1. There is now a easy-to-fix conflict :)

2. operation_parameters seem to abuse TextLine quite a bit: please use appropriate interface definitions (Choices, Bools, etc) and make sure appropriate enums are exported as well

3. A tiny whitespace issue:

At line 89 of the diff, you've got double space inside a string (at EOL and SOL :):

+ title=_("Only return differences for packages matching this "
+ " name."),

review: Needs Fixing
Revision history for this message
Данило Шеган (danilo) wrote :

Oh, also (lest it be forgotten :):

 - assertSameDiffs could use assertContentEqual to avoid sorted() calls, and "ds_diff_ws" should instead be named "derived_ds_ws" or something

Revision history for this message
Raphaël Badin (rvb) wrote :

> Oh, also (lest it be forgotten :):
>
> - assertSameDiffs could use assertContentEqual to avoid sorted() calls, and
> "ds_diff_ws" should instead be named "derived_ds_ws" or something

2, 3, 4 done.

I also refactored my test to pass actual parameters to the api method. (I'd like to have your opinion about passing str(Enum) to the api method though).

I still need to merge db-devel to fix the conflict but I guess it's going to be easier to review my changes *before* I merge db-devel and thus diverge from Steven's branch.

Revision history for this message
Данило Шеган (danilo) wrote :

Looks good. It seems str(Enum) is the right way to pass the enum value around, though it'd be best to check with someone else more knowledgeable as well (i.e. I looked at https://launchpad.net/+apidoc/devel.html for a few enums and they basically expect a string like that).

(fwiw, merging db-devel should not have introduced any other changes into your diff because it is proposed against db-devel, but would introduce bigger differences between Steve's and your branch)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: