Merge lp://staging/~wallyworld/launchpad/additional-affiliation-types into lp://staging/launchpad
Status: | Superseded | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Proposed branch: | lp://staging/~wallyworld/launchpad/additional-affiliation-types | ||||||||||||
Merge into: | lp://staging/launchpad | ||||||||||||
Prerequisite: | lp://staging/~wallyworld/launchpad/improve-personpicker-bugtaskaffiliation-798764 | ||||||||||||
Diff against target: |
1271 lines (+478/-558) 8 files modified
lib/lp/app/browser/tests/test_vocabulary.py (+0/-269) lib/lp/app/browser/vocabulary.py (+0/-13) lib/lp/app/javascript/picker/picker.js (+0/-72) lib/lp/app/javascript/picker/tests/test_picker.js (+1/-80) lib/lp/registry/configure.zcml (+21/-3) lib/lp/registry/model/pillaraffiliation.py (+104/-56) lib/lp/registry/tests/test_pillaraffiliation.py (+344/-62) lib/lp/testing/factory.py (+8/-3) |
||||||||||||
To merge this branch: | bzr merge lp://staging/~wallyworld/launchpad/additional-affiliation-types | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Needs Information | |
Review via email: mp+70442@code.staging.launchpad.net |
This proposal has been superseded by a proposal from 2011-08-05.
Commit message
Add to the affiliation adaptor to provide affiliation for other entity types like Question, DistroSeries, ProductSeries, Specification
Description of the change
This branch adds to the affiliation adaptor to provide affiliation for other entity types:
- Specification
- Question
- Distribution
- DistroSeries
- ProductSeries
- Product
== Implementation ==
Add extra affiliation adaptors for the additional context types. Checks are done for:
owner
driver
security contact
bug supervisor
Some contexts have pillars eg BugTask has a product or distribution; a distroseries has a distribution. The context is checked first. If the context doesn't match on the given attribute (eg owner), then the pillar is checked. If there is no match on owner, then driver is checked etc.
I think this mp also covers the intent of bug 81692, although that bug talks about additional checks eg registrant. Do we consider the work done here sufficient to address that bug?
== Tests ==
Add a bunch of tests to test_pillaraffi
== Lint ==
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
Unmerged revisions
- 13607. By Ian Booth
-
Merge from trunk
- 13606. By Ian Booth
-
Add extra tests for distroseries and productseries
- 13605. By Ian Booth
-
Reimplement distro/product affiliation adaptors and fix tests
- 13604. By Ian Booth
-
Reimplement specification adaptor
- 13603. By Ian Booth
-
Rework affiliation checks and reimplement question adaptor
- 13602. By Ian Booth
-
Lint
- 13601. By Ian Booth
-
Lint
- 13600. By Ian Booth
-
Implement affiliation for other entity types
- 13599. By Ian Booth
-
Merge from trunk
- 13598. By Ian Booth
-
Improve affiliatin text
> === modified file 'lib/lp/ registry/ model/pillaraff iliation. py' registry/ model/pillaraff iliation. py 2011-08-04 14:31:56 +0000 registry/ model/pillaraff iliation. py 2011-08-04 14:32:17 +0000 adge(self, person): n(capability, attribute, role): dedBy = getattr(capability, 'providedBy') dedBy(self. context) : inTeam( getattr( self.context, attribute)): displayname dedBy(pillar) ): inTeam( getattr( pillar, attribute)):
> --- lib/lp/
> +++ lib/lp/
...
> + def getPillar(self):
> + return self.context
> +
> + def getAffiliationB
> + """ Return the affiliation information for a person given a context.
> +
> + The context is a Distribution, Product etc and is associated with a
> + pillar. Checks are done to see if the person is associated with the
> + context first (owner, driver etc) and if not, then the pillar.
> + """
> + pillar = self.getPillar()
> +
> + def checkAffiliatio
> + # Check the affiliation defined by the specified capability on the
> + # context and then pillar. Capability is IHasOwner etc. WHatever
> + # matches first (context or pillar) is used for the display name.
> + affiliated_entity = None
> + capabilityProvi
> + if capabilityProvi
> + if person.
> + affiliated_entity = self.context.
> + if (affiliated_entity is None and capabilityProvi
> + if person.
> + affiliated_entity = pillar.displayname
> + if affiliated_entity is None:
> + return None
> + return affiliated_entity, role
I do not see why this is an inner function. This could be simpler too if
we decide that all we care about is product or distribution. We know how to
check owner, drivers, and other roles. The other kinds of items I
see returned, notably for specification and question are probably wrong.
We do not need the interface checks if we are certain we are getting a
distro or product.
I have some doubts about the universality of these checks. I think
owner and driver are universal. bug_supervisor and security contact are
only useful in bugs and branches cases that deal with privacy and security.
eg assigning a branch reviewer, bug assignee, subscriber.
Questions might care more about answer contacts which are more likely to
be assigned. Consider Ubuntu. The owners and drivers are rarely assigned.
when I assign a question, I care about the answer contact for the package
first, then the contacts for Ubuntu.
Specifications care about the people who are assignees, drafters, approvers,
and need feedback. In most cases these people are owners and drivers. There
is a rare case for the approver who is for the series goal...
The series is the problem. Maybe a separate branch becuase it is a rule
that may not prove very important. The series driver (release manager) is
the most important person for bugs that affect a series or blueprints with
a series goal. Those driver are assumed to be a subset of owner or drivers
who have the authority to define the work for a series. I happen to know
that This is not an issue for Ubuntu or any of our major pro...