Merge lp:~michael.nelson/launchpad/distro-series-difference-model into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Aaron Bentley on 2010-08-31 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 9729 | ||||
| Proposed branch: | lp:~michael.nelson/launchpad/distro-series-difference-model | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Prerequisite: | lp:~michael.nelson/launchpad/distro-series-difference-message | ||||
| Diff against target: |
509 lines (+280/-32) 6 files modified
lib/lp/registry/configure.zcml (+4/-1) lib/lp/registry/interfaces/distroseriesdifference.py (+46/-7) lib/lp/registry/model/distroseriesdifference.py (+61/-16) lib/lp/registry/tests/test_distroseriesdifference.py (+159/-5) lib/lp/registry/tests/test_distroseriesdifferencecomment.py (+2/-0) lib/lp/testing/factory.py (+8/-3) |
||||
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/distro-series-difference-model | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2010-08-30 | Approve on 2010-08-31 | |
|
Review via email:
|
|||
Commit Message
Restrict DistroSeriesDif
Description of the Change
Overview
========
This branch ensures that comments can only be added to a DistroSeriesDif
It also adds a getComments() method, and a method to update the status and/or type of difference based on any new publishings.
This branch follows on from:
https:/
Test:
bin/test -vv -m test_distroseri
No lint.
| Aaron Bentley (abentley) wrote : | # |
| Michael Nelson (michael.nelson) wrote : | # |
On Mon, Aug 30, 2010 at 7:18 PM, Aaron Bentley <email address hidden> wrote:
> Why are source_version and parent_
They were originally returning None (as you saw by the test comment
below), but I'd thought for comparisons etc., it would be more
consistent if these properties always resulted in a string - an empty
one if there is no version. Anyway, I've switched them back to return
None.
>
> Why not implement getComments directly instead of indirecting through IDistroSeriesDi
Because there's no reason why DistroSeriesDif
about the implementation of DistroSeriesDif
interfaces, not implementations", "Depend on abstractions, do not
depend on concrete classes", etc.)
Currently DistroSeriesDif
does it do any storm queries directly. I thought that was a good
thing, but can change it if you want.
>
> Your test comments say None, but test for the empty string. Please fix either the test or the comment.
Tests updated to expect None.
>
> Why assertIs(True, was_updated) instead of assertTrue(
My bad.
>
> Why assertIs(True, was_updated) instead of assertTrue(
Ditto.
Thanks Aaron.
| Robert Collins (lifeless) wrote : | # |
@Michael regarding interfaces and model code; if our implementations
were substitutable *with* high performance, I'd totally support what
you're saying.
However, the reality is that object traversal is slow (because of lazy
loading); our model objects conflate database access with domain
knowledge, and these two things combined mean that:
- you cannot replace Person in calls wanting IPerson with something
derived from Person and stored in another table: the whole structure
of model->storm relationships means that that will simply not work.
- working solely via I* guarantees terrible performance and the
inability to drive the lower layers efficiently.
I would like to change this, as has been discussed on the list, but we
don't have a better pattern || code for it yet.
You should, of course, delegate, DRY and so forth, but Interface vs
Implementation as far as Launchpad Interfaces go is a weak story.
-Rob
| Aaron Bentley (abentley) wrote : | # |
Approved, assuming the changes in http://

Why are source_version and parent_ source_ version returning ''? I would have expected them to return None if there was no such value.
Why not implement getComments directly instead of indirecting through IDistroSeriesDi fferenceComment Source?
Your test comments say None, but test for the empty string. Please fix either the test or the comment.
Why assertIs(True, was_updated) instead of assertTrue( was_updated) ? We should only care about whether the returned value evaluates to True. We should definitely not care about its identity.
Why assertIs(True, was_updated) instead of assertTrue( ds_diff. updateStatusAnd Type()) ? It is shorter, so easier to read.