Merge lp://staging/~gary/launchpad/bug548-db-3 into lp://staging/launchpad/db-devel

Proposed by Gary Poster
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 10177
Proposed branch: lp://staging/~gary/launchpad/bug548-db-3
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~wgrant/launchpad/bug548-db-2-tests
Diff against target: 1057 lines (+693/-128)
5 files modified
lib/canonical/widgets/__init__.py (+12/-0)
lib/contrib/oauth.py (+529/-0)
lib/lp/bugs/doc/bugnotification-sending.txt (+91/-118)
lib/lp/registry/model/person.py (+55/-8)
lib/lp/scripts/garbo.py (+6/-2)
To merge this branch: bzr merge lp://staging/~gary/launchpad/bug548-db-3
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+48651@code.staging.launchpad.net

Commit message

[r=bac][ui=none][no-qa] Add "selfgenerated_bugnotifications" as a global option for people so that we can work on bug 548. Only in the DB at this time, since the actual implementation is not yet done.

Description of the change

This branch fixes the remaining test failures from wgrant's branch (fixing most of the failures) of my previous branches. It also reinstates the use of a test helper for one file (bugnotification-sending.txt) that wgrant reverted because I believe it is an improvement and I don't see a reason to lose it. He probably reverted it because it was unnecessary to get the tests to pass, which is absolutely true. These changes have already been reviewed and approved (https://code.launchpad.net/~gary/launchpad/bug548-db-2-tests/+merge/48570).

This branch had to fix three sorts of test failures. First, I had hoped that we would be able to make the person-specific settings simply not implemented for teams. This proved to be untenable: at least two automated interface-based functions (verifyObject from zope.interface and lazr.lifecycle's snapshot functionality) crashed and burned by this behavior. Therefore, I opted to make the attributes readonly for teams, using the defaults from the interfaces. I had a mid-implementation call with Danilo about how to tackle that. I want to do what you see here, rather than a __getattr__/__setattr__ approach or a manual approach. I don't think that the __getattr__/__setattr__ approach is potentially better than this, but I was somehwhat tempted by the manual approach. My arguments against it were these.

 - This way keeps you from having to repeat yourself (again) by explicitly listing the attribute names.
 - We expect to add many more attributes to this settings bag, and setting up each one manually in a readonly version would be a drag.
 - We expect to add a team-based settings bag, and repeating things there would be even more of a drag.

Danilo thought that my preferred approach was acceptable, so I proceeded.

The second test failure was in garbo, cleaning up people. This was simply addressed by teaching it about the new person settings table (that it is safe to ignore it when trying to determine whether a person is still linked).

The last test failure was that ImmutableVisibilityError was being raised because Person.visibilityConsistencyWarning needed to be taught to ignore person settings too.

My goal is to get this landed asap to try and make it into PQM. I'd prefer having to make "I'll fix that next" promises if possible, rather than significantly holding up the branch, but I will understand if you are not comfortable with that.

Thank you

Gary

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Lines 1 - 396 have been reviewed before, though comments/requests/suggestions are welcome.

Revision history for this message
Gary Poster (gary) wrote :

- The widgets bits are spurious diff artifacts and are not pertinent to or part of my change.
- I pushed a revert to a comment change in garbo.py to re-correct some grammar.
- I lied. lines 299-319 of the current diff have not been reviewed. They reflect the change making the selfgenerated_bugnotifcation attribute readonly for teams, rather than completely not implemented for them. :-( sorry

Revision history for this message
Brad Crittenden (bac) wrote :

Thanks for the great explanation to a particularly dense piece of code. It is understandable now.

The changes look good. Please do figure out the odd appearance of extra files before sending this up.

review: Approve (code)

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: