Merge lp:~adeuring/launchpad/bug-479331 into lp:launchpad

Proposed by Abel Deuring
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~adeuring/launchpad/bug-479331
Merge into: lp:launchpad
Diff against target: 444 lines (+207/-69)
8 files modified
lib/canonical/launchpad/database/structuralsubscription.py (+5/-5)
lib/canonical/launchpad/interfaces/structuralsubscription.py (+3/-0)
lib/lp/bugs/browser/bugsupervisor.py (+29/-14)
lib/lp/bugs/stories/initial-bug-contacts/05-set-distribution-bugcontact.txt (+76/-28)
lib/lp/bugs/stories/initial-bug-contacts/10-set-upstream-bugcontact.txt (+82/-14)
lib/lp/bugs/stories/initial-bug-contacts/20-file-upstream-bug.txt (+5/-4)
lib/lp/bugs/stories/initial-bug-contacts/25-file-distribution-bug.txt (+3/-2)
lib/lp/registry/configure.zcml (+4/-2)
To merge this branch: bzr merge lp:~adeuring/launchpad/bug-479331
Reviewer Review Type Date Requested Status
Graham Binns (community) Approve
Review via email: mp+14783@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :

This branch fixes (sort of) bug 479331: It's not possible to set someone else as bug supervisor.

While the bug description says that anybody should be able to appoint the bug supervisor, it seems for now better to keep the policy of the structural bug subscription which is autmatically performed for the new supervisor: People may only subscribe themselves and teams they administer.

Firstly, the policy for structural bug subscription is reasonable: people who are not aware of the consequences of becoming a bug supervisor might feel being spammed by the possibly huge amount of bug mails they suddenly receive.

Secondly, the option to simply allow anybody to appoint a bug supervisor would mean to implement another exception to the subscription permission check in StructuralSubscriptionTargetMixin.userCanAlterSubscription(), which is already slightly too complicated for my taste, with the special handling of IDistributionSourcePackage targets.

So I only added a check if the person which tries to appoint the bug supervisor can actually do this: userCanAlterSubscription() is now called in BugSupervisorEditView.validate(). This involved to rename the method _userCanAlterSubscription(), to ad it to the interface class and to change two ZCML files.

The problem that most people cannot appoint others as bug supervisors was not caught in the tests because the persons used in the tests were all Launchpad administrators, which are allowed to make structural subscriptions for others. So I had to change the "test persons", and I had to change the teams they can subscribe. (BTW, our test data has way too many LP administrators: I needed some time to find persons who are team admins but not LP admins.)

The changed and added tests quickly re-appoint several persons and team as bug supervisors. When a new bug supervisor is appointed, the structural of the old supervisor is not automatically removed. The set of people subscribed are shown in other page tests, so these sets changed too: I did not bother add anything to remove the subscription.

test:./bin/test -v -f lp stories.initial-bug-contacts

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/database/structuralsubscription.py
  lib/canonical/launchpad/interfaces/structuralsubscription.py
  lib/lp/bugs/browser/bugsupervisor.py
  lib/lp/bugs/stories/initial-bug-contacts/05-set-distribution-bugcontact.txt
  lib/lp/bugs/stories/initial-bug-contacts/10-set-upstream-bugcontact.txt
  lib/lp/bugs/stories/initial-bug-contacts/20-file-upstream-bug.txt
  lib/lp/bugs/stories/initial-bug-contacts/25-file-distribution-bug.txt
  lib/lp/registry/configure.zcml

== Pylint notices ==

lib/canonical/launchpad/interfaces/structuralsubscription.py
    22: [F0401] Unable to import 'lazr.enum' (No module named enum)
    29: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
    34: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)

Revision history for this message
Graham Binns (gmb) wrote :
Download full text (7.4 KiB)

Hi Abel,

Nice branch. Couple of minor issues to deal with - nothing major - and the
error message change that we discussed on IRC. Other than that, this is
good to go.

> === modified file 'lib/lp/bugs/browser/bugsupervisor.py'
> --- lib/lp/bugs/browser/bugsupervisor.py 2009-09-09 13:37:24 +0000
> +++ lib/lp/bugs/browser/bugsupervisor.py 2009-11-12 12:30:31 +0000
> @@ -11,7 +11,6 @@
> from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor
> from canonical.launchpad.webapp import (
> action, canonical_url, LaunchpadEditFormView)
> -from canonical.launchpad.webapp.authorization import check_permission
> from canonical.launchpad.webapp.menu import structured
>
>
> @@ -91,19 +90,31 @@
>
> supervisor = data['bug_supervisor']
>
> - if (supervisor is not None and supervisor.isTeam() and
> - supervisor not in self.user.getAdministratedTeams() and not
> - check_permission('launchpad.Admin', self.user)):
> - error = structured(
> - "You cannot set %(team)s as the bug supervisor for "
> - "%(target)s because you are not an administrator of that "
> - "team.<br />If you believe that %(team)s should be the bug"
> - " supervisor for %(target)s, please notify one of the "
> - "<a href=\"%(url)s\">%(team)s administrators</a>.",
> - team=supervisor.displayname,
> - target=self.context.displayname,
> - url=(canonical_url(supervisor, rootsite='mainsite') +
> - '/+members'))
> + # Making a person the bug supervisor implies subscribing him
> + # to all bug mail. Ensure that the current user can indeed
> + # do this.
> + if (supervisor is not None and
> + not self.context.userCanAlterSubscription(supervisor, self.user)):
> + if supervisor.isTeam():
> + error = structured(
> + "You cannot set %(team)s as the bug supervisor for "
> + "%(target)s because you are not an administrator of that "
> + "team.<br />If you believe that %(team)s should be the "
> + "bug supervisor for %(target)s, please notify one of the "
> + "<a href=\"%(url)s\">%(team)s administrators</a>.",
> + team=supervisor.displayname,
> + target=self.context.displayname,
> + url=(canonical_url(supervisor, rootsite='mainsite') +
> + '/+members'))
> + self.setFieldError('bug_supervisor', error)
> + else:
> + error = structured(
> + "You cannot set another person as the bug supervisor for "
> + "%(target)s.<br/> If you believe that %(person)s should "
> + "be the bug supervisor for %(target)s, please ask this "
> + "person to make itself the bug supervisor.",

As we discussed on IRC, this error message needs to be changed, since
people who aren't project admins or members of admin teams can't set
themselves as bug supervisor.

> + ...

Read more...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/database/structuralsubscription.py'
--- lib/canonical/launchpad/database/structuralsubscription.py 2009-10-28 19:11:17 +0000
+++ lib/canonical/launchpad/database/structuralsubscription.py 2009-11-12 20:26:12 +0000
@@ -22,7 +22,7 @@
22 IStructuralSubscription, IStructuralSubscriptionTarget,22 IStructuralSubscription, IStructuralSubscriptionTarget,
23 UserCannotSubscribePerson)23 UserCannotSubscribePerson)
24from lp.registry.interfaces.person import (24from lp.registry.interfaces.person import (
25 IPerson, validate_public_person, validate_person_not_private_membership)25 validate_public_person, validate_person_not_private_membership)
2626
2727
28class StructuralSubscription(SQLBase):28class StructuralSubscription(SQLBase):
@@ -131,8 +131,8 @@
131 '%s is not a valid structural subscription target.')131 '%s is not a valid structural subscription target.')
132 return args132 return args
133133
134 def _userCanAlterSubscription(self, subscriber, subscribed_by):134 def userCanAlterSubscription(self, subscriber, subscribed_by):
135 """Check if a user can change a subscription for a person."""135 """See `IStructuralSubscriptionTarget`."""
136 # A Launchpad administrator or the user can subscribe a user.136 # A Launchpad administrator or the user can subscribe a user.
137 # A Launchpad or team admin can subscribe a team.137 # A Launchpad or team admin can subscribe a team.
138138
@@ -155,7 +155,7 @@
155 if subscriber is None:155 if subscriber is None:
156 subscriber = subscribed_by156 subscriber = subscribed_by
157157
158 if not self._userCanAlterSubscription(subscriber, subscribed_by):158 if not self.userCanAlterSubscription(subscriber, subscribed_by):
159 raise UserCannotSubscribePerson(159 raise UserCannotSubscribePerson(
160 '%s does not have permission to subscribe %s.' % (160 '%s does not have permission to subscribe %s.' % (
161 subscribed_by.name, subscriber.name))161 subscribed_by.name, subscriber.name))
@@ -185,7 +185,7 @@
185 if subscriber is None:185 if subscriber is None:
186 subscriber = unsubscribed_by186 subscriber = unsubscribed_by
187187
188 if not self._userCanAlterSubscription(subscriber, unsubscribed_by):188 if not self.userCanAlterSubscription(subscriber, unsubscribed_by):
189 raise UserCannotSubscribePerson(189 raise UserCannotSubscribePerson(
190 '%s does not have permission to unsubscribe %s.' % (190 '%s does not have permission to unsubscribe %s.' % (
191 unsubscribed_by.name, subscriber.name))191 unsubscribed_by.name, subscriber.name))
192192
=== modified file 'lib/canonical/launchpad/interfaces/structuralsubscription.py'
--- lib/canonical/launchpad/interfaces/structuralsubscription.py 2009-10-08 12:50:25 +0000
+++ lib/canonical/launchpad/interfaces/structuralsubscription.py 2009-11-12 20:26:12 +0000
@@ -163,6 +163,9 @@
163 parent_subscription_target = Attribute(163 parent_subscription_target = Attribute(
164 "The target's parent, or None if one doesn't exist.")164 "The target's parent, or None if one doesn't exist.")
165165
166 def userCanAlterSubscription(subscriber, subscribed_by):
167 """Check if a user can change a subscription for a person."""
168
166 def addSubscription(subscriber, subscribed_by):169 def addSubscription(subscriber, subscribed_by):
167 """Add a subscription for this structure.170 """Add a subscription for this structure.
168171
169172
=== modified file 'lib/lp/bugs/browser/bugsupervisor.py'
--- lib/lp/bugs/browser/bugsupervisor.py 2009-09-09 13:37:24 +0000
+++ lib/lp/bugs/browser/bugsupervisor.py 2009-11-12 20:26:12 +0000
@@ -11,7 +11,6 @@
11from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor11from lp.bugs.interfaces.bugsupervisor import IHasBugSupervisor
12from canonical.launchpad.webapp import (12from canonical.launchpad.webapp import (
13 action, canonical_url, LaunchpadEditFormView)13 action, canonical_url, LaunchpadEditFormView)
14from canonical.launchpad.webapp.authorization import check_permission
15from canonical.launchpad.webapp.menu import structured14from canonical.launchpad.webapp.menu import structured
1615
1716
@@ -91,19 +90,35 @@
9190
92 supervisor = data['bug_supervisor']91 supervisor = data['bug_supervisor']
9392
94 if (supervisor is not None and supervisor.isTeam() and93 # Making a person the bug supervisor implies subscribing him
95 supervisor not in self.user.getAdministratedTeams() and not94 # to all bug mail. Ensure that the current user can indeed
96 check_permission('launchpad.Admin', self.user)):95 # do this.
97 error = structured(96 if (supervisor is not None and
98 "You cannot set %(team)s as the bug supervisor for "97 not self.context.userCanAlterSubscription(supervisor, self.user)):
99 "%(target)s because you are not an administrator of that "98 if supervisor.isTeam():
100 "team.<br />If you believe that %(team)s should be the bug"99 error = structured(
101 " supervisor for %(target)s, please notify one of the "100 "You cannot set %(team)s as the bug supervisor for "
102 "<a href=\"%(url)s\">%(team)s administrators</a>.",101 "%(target)s because you are not an administrator of that "
103 team=supervisor.displayname,102 "team.<br />If you believe that %(team)s should be the "
104 target=self.context.displayname,103 "bug supervisor for %(target)s, please notify one of the "
105 url=(canonical_url(supervisor, rootsite='mainsite') +104 "<a href=\"%(url)s\">%(team)s administrators</a>. See "
106 '/+members'))105 "<a href=\"https://help.launchpad.net/BugSupervisors\">"
106 "the help wiki</a> for information about setting a bug "
107 "supervisor.",
108 team=supervisor.displayname,
109 target=self.context.displayname,
110 url=(canonical_url(supervisor, rootsite='mainsite') +
111 '/+members'))
112 self.setFieldError('bug_supervisor', error)
113 else:
114 error = structured(
115 "You cannot set another person as the bug supervisor for "
116 "%(target)s.<br />See "
117 "<a href=\"https://help.launchpad.net/BugSupervisors\">"
118 "the help wiki</a> for information about setting a bug "
119 "supervisor.",
120 person=supervisor.displayname,
121 target=self.context.displayname)
107 self.setFieldError('bug_supervisor', error)122 self.setFieldError('bug_supervisor', error)
108123
109 def cancel_url(self):124 def cancel_url(self):
110125
=== modified file 'lib/lp/bugs/stories/initial-bug-contacts/05-set-distribution-bugcontact.txt'
--- lib/lp/bugs/stories/initial-bug-contacts/05-set-distribution-bugcontact.txt 2009-08-13 19:03:36 +0000
+++ lib/lp/bugs/stories/initial-bug-contacts/05-set-distribution-bugcontact.txt 2009-11-12 20:26:12 +0000
@@ -11,57 +11,105 @@
11 ...11 ...
12 LinkNotFoundError12 LinkNotFoundError
1313
14Now we login as Mark...14Now we login as Colin...
1515
16 >>> browser.addHeader('Authorization', 'Basic mark@example.com:test')16 >>> colin_browser = setupBrowser(
17 >>> browser.reload()17 ... auth='Basic colin.watson@ubuntulinux.com:test')
18 >>> browser.url18 >>> colin_browser.open('http://launchpad.dev/ubuntu/+bugs')
19 'http://launchpad.dev/ubuntu/+bugs'
2019
21...and we can see that the link is there.20...and we can see that the link is there.
2221
23 >>> bug_supervisor_link = browser.getLink("Change bug supervisor")22 >>> bug_supervisor_link = colin_browser.getLink("Change bug supervisor")
24 >>> bug_supervisor_link.url23 >>> bug_supervisor_link.url
25 'http://launchpad.dev/ubuntu/+bugsupervisor'24 'http://launchpad.dev/ubuntu/+bugsupervisor'
2625
27Anyone with launchpad.Edit permission can edit the distribution bug26Anyone with launchpad.Edit permission can edit the distribution bug
28supervisor. In this example, we're using mark@example.com to set the27supervisor, but most users can select only themselves and the teams they
29distribution bug supervisor.28administer. In this example, Colin will set himself as the distribution
29bug supervisor.
3030
31 >>> bug_supervisor_link.click()31 >>> bug_supervisor_link.click()
32 >>> browser.url32 >>> colin_browser.url
33 'http://launchpad.dev/ubuntu/+bugsupervisor'33 'http://launchpad.dev/ubuntu/+bugsupervisor'
3434
35The bug supervisor page takes just one simple value: the bug supervisor email35The bug supervisor page takes just one simple value: the bug supervisor email
36or nickname. Let's set carlos@canonical.com as the bug supervisor for36or nickname. Let's set colin.watson@ubuntulinux.com as the bug supervisor for
37Ubuntu.37Ubuntu.
3838
39 >>> browser.getControl("Bug Supervisor").value = 'carlos@canonical.com'39 >>> colin_browser.getControl("Bug Supervisor").value = (
40 >>> browser.getControl("Change").click()40 ... ' colin.watson@ubuntulinux.com ')
41 >>> colin_browser.getControl("Change").click()
4142
42And then we're redirected to the distribution page.43And then we're redirected to the distribution page.
4344
44 >>> browser.url45 >>> colin_browser.url
45 'http://launchpad.dev/ubuntu'46 'http://launchpad.dev/ubuntu'
4647
47 >>> for tag in find_tags_by_class(browser.contents, "informational message"):48 >>> for tag in find_tags_by_class(colin_browser.contents,
49 ... "informational message"):
48 ... print tag50 ... print tag
49 <div...Successfully changed the bug supervisor to ...Carlos Perelló Marín...51 <div...Successfully changed the bug supervisor to ...Colin Watson...
5052
51Now that the bug supervisor is set, there's a link to him on the53Now that the bug supervisor is set, there's a link to him on the
52distribution page.54distribution's bug page page.
5355
54 >>> browser.getLink(56 >>> browser.open('http://bugs.launchpad.dev/ubuntu')
55 ... url='/~carlos').url57 >>> browser.getLink(url='/~kamion').url
56 'http://launchpad.dev/~carlos'58 'http://launchpad.dev/~kamion'
5759
58When the bug supervisor doesn't have an email address, the displayname is60When the bug supervisor doesn't have an email address, the displayname is
59shown instead in the feedback message.61shown instead in the feedback message. Let's appoint the Ubuntu Team as
6062the bug supervisor. Since Colin is an administrator of this team, he can
61 >>> browser.open("http://launchpad.dev/ubuntu/+bugsupervisor")63do it.
62 >>> browser.getControl("Bug Supervisor").value = 'ubuntu-team'64
63 >>> browser.getControl("Change").click()65 >>> colin_browser.open("http://launchpad.dev/ubuntu/+bugsupervisor")
6466 >>> colin_browser.getControl("Bug Supervisor").value = 'ubuntu-team'
65 >>> for tag in find_tags_by_class(browser.contents, "informational message"):67 >>> colin_browser.getControl("Change").click()
66 ... print tag68
67 <div...Successfully changed the bug supervisor to ...Ubuntu Team...69 >>> print extract_text(colin_browser.contents)
70 Ubuntu Linux in Launchpad
71 ...
72 Successfully changed the bug supervisor to Ubuntu Team.
73 ...
74
75While anybody with edit permissions can set the bug supervisor, only
76certain persons can be successfully selected. All users can set
77themselves self and teams they administer as the bug supervisor, as
78shown above. But ordinary users cannot appoint other persons and teams
79they do not administer.
80
81 >>> colin_browser.open("http://launchpad.dev/ubuntu/+bugsupervisor")
82 >>> colin_browser.getControl("Bug Supervisor").value = 'admins'
83 >>> colin_browser.getControl("Change").click()
84 >>> print extract_text(colin_browser.contents)
85 Edit bug supervisor for Ubuntu : Ubuntu
86 ...
87 You cannot set Launchpad Administrators as the bug supervisor for
88 Ubuntu because you are not an administrator of that team.
89 If you believe that Launchpad Administrators should be the bug
90 supervisor for Ubuntu, please notify one of the Launchpad
91 Administrators administrators.
92 ...
93
94But members of the Launchpad administration team can appoint anybody
95as bug supervisors, teams...
96
97 >>> admin_browser.open("http://launchpad.dev/ubuntu/+bugsupervisor")
98 >>> admin_browser.getControl("Bug Supervisor").value = 'ubuntu-translators'
99 >>> admin_browser.getControl("Change").click()
100 >>> print extract_text(admin_browser.contents)
101 Ubuntu Linux in Launchpad
102 ...
103 Successfully changed the bug supervisor to Ubuntu Translators.
104 ...
105
106...as well as persons.
107
108 >>> admin_browser.open("http://launchpad.dev/ubuntu/+bugsupervisor")
109 >>> admin_browser.getControl("Bug Supervisor").value = 'carlos'
110 >>> admin_browser.getControl("Change").click()
111 >>> print extract_text(admin_browser.contents)
112 Ubuntu Linux in Launchpad
113 ...
114 Successfully changed the bug supervisor to Carlos Perelló Marín.
115 ...
68116
=== modified file 'lib/lp/bugs/stories/initial-bug-contacts/10-set-upstream-bugcontact.txt'
--- lib/lp/bugs/stories/initial-bug-contacts/10-set-upstream-bugcontact.txt 2009-08-13 19:03:36 +0000
+++ lib/lp/bugs/stories/initial-bug-contacts/10-set-upstream-bugcontact.txt 2009-11-12 20:26:12 +0000
@@ -1,20 +1,91 @@
1== Setting Upstream Bug Supervisor ==1== Setting Upstream Bug Supervisor ==
22
3Setting the bug supervisor for an upstream requires launchpad.Edit3Setting the bug supervisor for an upstream requires launchpad.Edit
4permission on the product.4permission on the product. But regular users can only appoint
55themselves as bug supervisors and teams they administer.
6 >>> browser.addHeader("Authorization", "Basic mark@example.com:test")6
77 >>> sample_browser = setupBrowser()
8 >>> browser.open("http://localhost:9000/firefox/+bugsupervisor")8 >>> sample_browser.addHeader("Authorization",
9 >>> browser.getControl(name="field.bug_supervisor").value = (9 ... "Basic test@canonical.com:test")
10 ... "robertc@robertcollins.net")10
11 >>> browser.getControl("Change").click()11 >>> sample_browser.open("http://localhost:9000/firefox/+bugsupervisor")
12 >>> sample_browser.getControl(name="field.bug_supervisor").value = (
13 ... "test@canonical.com")
14 >>> sample_browser.getControl("Change").click()
15
16He is now redircted to the main product page, and he sees a confirmation
17message.
18
19 >>> print sample_browser.url
20 http://localhost:9000/firefox
21 >>> print extract_text(sample_browser.contents)
22 Mozilla Firefox in Launchpad
23 ...
24 Successfully changed the bug supervisor to Sample Person.
25 ...
1226
13Another example, this time with a team that has no "preferred email" set.27Another example, this time with a team that has no "preferred email" set.
1428
15 >>> browser.open("http://localhost:9000/firefox/+bugsupervisor")29 >>> sample_browser.open("http://localhost:9000/firefox/+bugsupervisor")
16 >>> browser.getControl(name="field.bug_supervisor").value = "guadamen"30 >>> sample_browser.getControl(name="field.bug_supervisor").value = (
17 >>> browser.getControl("Change").click()31 ... "landscape-developers")
32 >>> sample_browser.getControl("Change").click()
33 >>> print sample_browser.url
34 http://localhost:9000/firefox
35 >>> print extract_text(sample_browser.contents)
36 Mozilla Firefox in Launchpad
37 ...
38 Successfully changed the bug supervisor to Landscape Developers.
39 ...
40
41If Sample Person tries to appoint another person, he'll get an error message.
42
43 >>> sample_browser.open("http://localhost:9000/firefox/+bugsupervisor")
44 >>> sample_browser.getControl(name="field.bug_supervisor").value = (
45 ... "robertc@robertcollins.net")
46 >>> sample_browser.getControl("Change").click()
47 >>> print sample_browser.url
48 http://localhost:9000/firefox/+bugsupervisor
49 >>> print extract_text(sample_browser.contents)
50 Edit bug supervisor for Mozilla Firefox : Mozilla Firefox
51 ...
52 You cannot set another person as the bug supervisor for Mozilla Firefox.
53 See the help wiki for information about setting a bug supervisor.
54 The person or team responsible for bug management.
55 ...
56
57If he tries to appoint a team which he does not administer, he'll get
58too an an error message.
59
60 >>> sample_browser.getControl(name="field.bug_supervisor").value = (
61 ... "guadamen")
62 >>> sample_browser.getControl("Change").click()
63 >>> print sample_browser.url
64 http://localhost:9000/firefox/+bugsupervisor
65 >>> print extract_text(sample_browser.contents)
66 Edit bug supervisor for Mozilla Firefox : Mozilla Firefox
67 ...
68 You cannot set GuadaMen as the bug supervisor for Mozilla Firefox
69 because you are not an administrator of that team.
70 If you believe that GuadaMen should be the bug supervisor for Mozilla
71 Firefox, please notify one of the GuadaMen administrators.
72 ...
73
74Launchpad administrators can appoint anybody.
75
76 >>> admin_browser = setupBrowser()
77 >>> admin_browser.addHeader("Authorization",
78 ... "Basic foo.bar@canonical.com:test")
79
80 >>> admin_browser.open("http://localhost:9000/firefox/+bugsupervisor")
81 >>> admin_browser.getControl(name="field.bug_supervisor").value = (
82 ... "robertc@robertcollins.net")
83 >>> admin_browser.getControl("Change").click()
84 >>> print extract_text(admin_browser.contents)
85 Mozilla Firefox in Launchpad
86 ...
87 Successfully changed the bug supervisor to Robert Collins.
88 ...
1889
1990
20= Teams as Bug Supervisors =91= Teams as Bug Supervisors =
@@ -22,9 +93,6 @@
22First, some setup. We create a new product owned by "Sample Person", using a93First, some setup. We create a new product owned by "Sample Person", using a
23separate browser instance to avoid breaking the other page tests.94separate browser instance to avoid breaking the other page tests.
2495
25 >>> sample_browser = setupBrowser()
26 >>> sample_browser.addHeader("Authorization",
27 ... "Basic test@canonical.com:test")
28 >>> sample_browser.open('http://launchpad.dev/projects/+new')96 >>> sample_browser.open('http://launchpad.dev/projects/+new')
29 >>> sample_browser.getControl('URL').value = 'testy'97 >>> sample_browser.getControl('URL').value = 'testy'
30 >>> sample_browser.getControl('Name').value = 'Test Product'98 >>> sample_browser.getControl('Name').value = 'Test Product'
3199
=== modified file 'lib/lp/bugs/stories/initial-bug-contacts/20-file-upstream-bug.txt'
--- lib/lp/bugs/stories/initial-bug-contacts/20-file-upstream-bug.txt 2009-08-13 19:03:36 +0000
+++ lib/lp/bugs/stories/initial-bug-contacts/20-file-upstream-bug.txt 2009-11-12 20:26:12 +0000
@@ -15,9 +15,9 @@
15 >>> print browser.url.replace(bug_id, "BUG-ID")15 >>> print browser.url.replace(bug_id, "BUG-ID")
16 http://bugs.launchpad.dev/firefox/+bug/BUG-ID16 http://bugs.launchpad.dev/firefox/+bug/BUG-ID
1717
18Now mark (because he's the bug reporter), guadamen (because they are18Now mark (because he's the bug reporter), Sample Person (a former bug
19the product bug supervisor), and lifeless (because he is a subscriber to19supervisor), Landscape Developers (another former bug supervisor) and
20mozilla) are subscribed to this bug:20Robert Collins (the current bug supervisor) are subscribed to this bug:
2121
22 >>> from zope.component import getUtility22 >>> from zope.component import getUtility
23 >>> from canonical.launchpad.interfaces import IBugSet23 >>> from canonical.launchpad.interfaces import IBugSet
@@ -31,7 +31,8 @@
31 >>> login(ANONYMOUS)31 >>> login(ANONYMOUS)
32 >>> bugset = getUtility(IBugSet)32 >>> bugset = getUtility(IBugSet)
33 >>> subscriber_names(bugset.get(bug_id))33 >>> subscriber_names(bugset.get(bug_id))
34 [u'GuadaMen', u'Mark Shuttleworth', u'Robert Collins']34 [u'Landscape Developers', u'Mark Shuttleworth', u'Robert Collins',
35 u'Sample Person']
35 >>> logout()36 >>> logout()
3637
37For a security bug, only the reporter and the registrant gets38For a security bug, only the reporter and the registrant gets
3839
=== modified file 'lib/lp/bugs/stories/initial-bug-contacts/25-file-distribution-bug.txt'
--- lib/lp/bugs/stories/initial-bug-contacts/25-file-distribution-bug.txt 2009-08-14 18:02:29 +0000
+++ lib/lp/bugs/stories/initial-bug-contacts/25-file-distribution-bug.txt 2009-11-12 20:26:12 +0000
@@ -19,7 +19,7 @@
19 >>> print browser.url.replace(bug_id, "BUG-ID")19 >>> print browser.url.replace(bug_id, "BUG-ID")
20 http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/BUG-ID20 http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/BUG-ID
2121
22We should have four subscribers now. The bug reporter (also a package22We should have six subscribers now. The bug reporter (also a package
23subscriber), mark, the distro bug supervisor, ubuntu-team, and carlos23subscriber), mark, the distro bug supervisor, ubuntu-team, and carlos
24and foobar, who are subscribed to the distribution.24and foobar, who are subscribed to the distribution.
2525
@@ -36,7 +36,8 @@
3636
37 >>> bugset = getUtility(IBugSet)37 >>> bugset = getUtility(IBugSet)
38 >>> subscriber_names(bugset.get(bug_id))38 >>> subscriber_names(bugset.get(bug_id))
39 [u'carlos', u'mark', u'name16', u'ubuntu-team']39 [u'carlos', u'kamion', u'mark', u'name16', u'ubuntu-team',
40 u'ubuntu-translators']
4041
41 >>> logout()42 >>> logout()
4243
4344
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2009-10-23 22:09:49 +0000
+++ lib/lp/registry/configure.zcml 2009-11-12 20:26:12 +0000
@@ -1162,7 +1162,8 @@
1162 attributes="1162 attributes="
1163 addSubscription1163 addSubscription
1164 addBugSubscription1164 addBugSubscription
1165 removeBugSubscription"/>1165 removeBugSubscription
1166 userCanAlterSubscription"/>
11661167
1167 <!-- IHasBugSupervisor -->1168 <!-- IHasBugSupervisor -->
11681169
@@ -1421,7 +1422,8 @@
1421 attributes="1422 attributes="
1422 addSubscription1423 addSubscription
1423 addBugSubscription1424 addBugSubscription
1424 removeBugSubscription"/>1425 removeBugSubscription
1426 userCanAlterSubscription"/>
14251427
1426 <!-- IHasBugSupervisor -->1428 <!-- IHasBugSupervisor -->
14271429