Merge lp:~wallyworld/launchpad/revoke-access-delete-subscriptions-job into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Ian Booth on 2012-05-25 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 15359 |
| Proposed branch: | lp:~wallyworld/launchpad/revoke-access-delete-subscriptions-job |
| Merge into: | lp:launchpad |
| Diff against target: |
684 lines (+628/-0) 7 files modified
configs/development/launchpad-lazr.conf (+3/-0) configs/testrunner/launchpad-lazr.conf (+3/-0) lib/lp/registry/configure.zcml (+15/-0) lib/lp/registry/interfaces/sharingjob.py (+88/-0) lib/lp/registry/model/sharingjob.py (+297/-0) lib/lp/registry/tests/test_sharingjob.py (+214/-0) lib/lp/services/config/schema-lazr.conf (+8/-0) |
| To merge this branch: | bzr merge lp:~wallyworld/launchpad/revoke-access-delete-subscriptions-job |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | 2012-05-01 | Approve on 2012-05-01 | |
| Richard Harding (community) | code | 2012-05-01 | Approve on 2012-05-01 |
|
Review via email:
|
|||
Commit Message
Infrastructure to support sharing jobs and initial remove subscriptions job implementation.
Description of the Change
== Implementation ==
This is the first branch which introduces the job infrastructure needed to run sharing/disclosure jobs. The first job is one which removes subscriptions for artifacts for which access has been revoked. There are 3 scenarios:
1. Revoke access to an individual artifact
2. Revoke access to artifacts of a given information type
3. Revoke access to an entire project/distro
This branch covers the first case above. The job is not wired up yet.
This branch requires that a db-devel branch land first in order to provide the necessary database table: lp:~wallyworld/launchpad/sharingjob-table
The job is implemented to use the new celery framework. Tests are provided to check that the job runs standalone (without celery). I'm not sure if these are required; they can be removed if required.
The job needs to unsubscribe a user from a bug or branch. unsubscribe() on IBug requires "Edit", for branches it requires "View" from what I can tell. removeSecurityP
On error, the job emails the requestor and pillar maintainer about the error.
== Tests ==
A number of newly written tests for the job are provided.
== Lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
configs/
configs/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./configs/
81: Line exceeds 80 characters.
114: Line exceeds 80 characters.
./configs/
126: Line exceeds 80 characters.
./lib/lp/
489: Line exceeds 80 characters.
1100: Line exceeds 80 characters.
1107: Line exceeds 80 characters.
1710: Line exceeds 80 characters.
| Aaron Bentley (abentley) wrote : | # |
This looks very good to me. I hope the Celery changes make sense. There are a few quibbles:
In the tests using CeleryJobLayer, there is a risk that the transaction could be committed, causing Celery to run the job even when you weren't expecting that, and perhaps causing odd leakage into other tests. To avoid this, I recommend using the FeatureFixture only in test cases that run the job via Celery.
I no longer believe that we need to have *Derived classes. AFAICT, Storm permits one table to have many classes, so I believe RemoveSubscript
I am not sure whether oops prefixes are still required.
Ideally, each job type will have its own database user, so that any problems in production are easier to debug.

Ian, this looks good to me. I'm going to go ahead and ask Aaron to take a peek as well in case he's got any tips or things I might miss since the celery job bits are pretty new to me still.