Merge lp:~julian-edwards/launchpad/set-previous-series-bug-805913 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Julian Edwards on 2011-07-06 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 13384 |
| Proposed branch: | lp:~julian-edwards/launchpad/set-previous-series-bug-805913 |
| Merge into: | lp:launchpad |
| Diff against target: |
299 lines (+115/-33) 6 files modified
lib/lp/registry/browser/distroseries.py (+10/-2) lib/lp/registry/browser/tests/test_distroseries.py (+36/-11) lib/lp/registry/interfaces/distroseries.py (+14/-3) lib/lp/registry/model/distroseries.py (+17/-12) lib/lp/registry/model/sourcepackage.py (+5/-5) lib/lp/registry/tests/test_distroseries.py (+33/-0) |
| To merge this branch: | bzr merge lp:~julian-edwards/launchpad/set-previous-series-bug-805913 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jeroen T. Vermeulen (community) | 2011-07-05 | Approve on 2011-07-06 | |
|
Review via email:
|
|||
Commit Message
[r=jtv][bug=805913] Make DistroSeries.
Description of the Change
= Summary =
Make DistroSeries.
== Implementation details ==
1. rename prior_series to priorReleasedSeries and convert to a method (only one place was using it and it didn't need to be a cachedproperty)
2. refactor the code in priorReleasedSeries so it's also in IDistroSeriesSet.
3. Stormify the query.
4. Add tests for it! (there were none before)
5. Make the browser code for adding a new series call the utility method to work out what the previous_series should be.
6. Tests for that.
ADDENDUM!
It turns out that going back to the prior released is not the right thing since there can be many unreleased series, so the code now searches back to the most recent series and uses that (if there is one).
== Tests ==
bin/test -cvvt TestDistroSerie
== Demo and Q/A ==
+initseries currently blows up when initialising because of the missing data,
this will fix it and easily checked.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
| Julian Edwards (julian-edwards) wrote : | # |
Thanks for the review, let me know how it looks now.
On Wednesday 06 July 2011 14:14:24 you wrote:
> Review: Approve
> Some definite improvements here, even without considering the fixed bug. I
> do have some problems with the code though: you seem to test for the
> presence of a release date as an implicit side effect of SQL comparison
> semantics for nulls (whereas, on a side note, doing the same comparison in
> python would include unreleased series!). Please make this explicit: add
> a check or a comment, and test that the right thing happens with
> unreleased series.
Right, thanks for spotting that. I've changed it to check that datereleased is
not NULL.
> Also, what about createAndAdd in the view code? It uses
> self.context.
> self.context.
No, it's correct, you should have paid attention to the addendum :)
> (I can't say that priorReleasedSeries works for me as a name, by the way:
> I'd pronounce it with emphasis on the one word that wasn't capitalized.
> That's rarely an issue with the start-with-a-verb style we used to
> require.)
There's no accounting for taste!

Some definite improvements here, even without considering the fixed bug. I do have some problems with the code though: you seem to test for the presence of a release date as an implicit side effect of SQL comparison semantics for nulls (whereas, on a side note, doing the same comparison in python would include unreleased series!). Please make this explicit: add a check or a comment, and test that the right thing happens with unreleased series.
Also, what about createAndAdd in the view code? It uses self.context. series[ 0] for previous_series. Should that be self.context. priorReleasedSe ries()[ 0]?
(I can't say that priorReleasedSeries works for me as a name, by the way: I'd pronounce it with emphasis on the one word that wasn't capitalized. That's rarely an issue with the start-with-a-verb style we used to require.)
Jeroen