Merge lp:~adeuring/launchpad/sharingjob-remove-bp-subscriptions into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Abel Deuring on 2012-09-24 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16015 |
| Proposed branch: | lp:~adeuring/launchpad/sharingjob-remove-bp-subscriptions |
| Merge into: | lp:launchpad |
| Diff against target: |
616 lines (+299/-87) 5 files modified
database/schema/security.cfg (+2/-0) lib/lp/blueprints/model/specification.py (+57/-2) lib/lp/blueprints/tests/test_specification.py (+52/-1) lib/lp/registry/model/sharingjob.py (+53/-0) lib/lp/registry/tests/test_sharingjob.py (+135/-84) |
| To merge this branch: | bzr merge lp:~adeuring/launchpad/sharingjob-remove-bp-subscriptions |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Benji York (community) | code | 2012-09-24 | Approve on 2012-09-24 |
|
Review via email:
|
|||
Commit Message
specifications added to RemoveArtifactS
Description of the Change
This branch extends RemoveArtifactS
removes subscriptions to specifications if a subscriber does no longer
have grants to access these specifications.
The change in lib/lp/
a mechanical change that adds specification handling to bug and branch
handling.
The method issues a Storm query to find subscribers of a specification
without access grants. The Storm expression "person with[out] access
to a spec" is defined in a new function get_specificati
similar to the existing functions get_bug_
get_branch_
RemoveArtifactS
arbitrary objects, which I found a bit confusing while working on this
branch, so I added a check to ensure that only those objects can be
passed to this object that the class can handle, i.e. bugs, branches
and blueprints.
Many tests of RemoveArtifactS
_assert_
which were quite long but nearly identical. The new test
test_change_
variant of these methods, _assert_
I refactored all three _assert.* methods to use a common method.
tests:
./bin/test -vvt lp.registry.
./bin/test -vvt lp.blueprints.
no lint
| Abel Deuring (adeuring) wrote : | # |
Benji, thanks for these suggestions. I chose the first variant, moved the "if test_type == " blocks into the callsites. _assert_
| Benji York (benji) wrote : | # |
On Mon, Sep 24, 2012 at 2:16 PM, Abel Deuring
<email address hidden> wrote:
> Benji, thanks for these suggestions. I chose the first variant, moved the "if
> test_type == " blocks into the callsites.
> _assert_
> bit more readable...
Cool.

This branch looks good. Here are some minor comments:
It seems you have an extra underscore in the test name _bad_artifact_ class".
"test_create_
I like the generalization of _assert_ artifact_ change_ unsubscribes. It is
unfortunate that the function is so long though. I wonder if instead of
passing in a test type we could instead break out the contents of that if block
into functions that are instead passed in and called.
Another idea: break the _assert_ artifact_ change_ unsubscribes into two
functions, one for the code before "if test_type" and one after. The
individual assertions could then call the first function, then include their
unique code (currently contained in the if) and then finally call the last
function.