Merge lp:~brian-murray/launchpad/bug-supervisor-bug-expiry-submit into lp:launchpad

Proposed by Brian Murray
Status: Merged
Approved by: Brian Murray
Approved revision: no longer in the source branch.
Merged at revision: 11861
Proposed branch: lp:~brian-murray/launchpad/bug-supervisor-bug-expiry-submit
Merge into: lp:launchpad
Diff against target: 116 lines (+30/-14)
4 files modified
lib/lp/bugs/browser/bugtarget.py (+8/-6)
lib/lp/bugs/browser/tests/test_bugtarget_configure.py (+12/-0)
lib/lp/bugs/stories/webservice/xx-bug-target.txt (+1/-1)
lib/lp/registry/configure.zcml (+9/-7)
To merge this branch: bzr merge lp:~brian-murray/launchpad/bug-supervisor-bug-expiry-submit
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+39900@code.launchpad.net

Commit message

Allow bug supervisors to submit changes regarding bug tracker configuration for their project.

Description of the change

This branch is a follow-up branch to the branch in the merge-proposal at https://code.launchpad.net/~brian-murray/launchpad/bug-supervisor-bug-expiry/+merge/38958. In that branch I was trying to allow the bug-supervisor of a product to configure parts of the bug tracker for their product at +configure-bugtracker. However, the bug supervisor can't actually submit the changes. This branch resolves that issue.

I've added a new test for editing the bugtracker to test_bugtarget_configure.py.

bin/test -cvvt test_bugtarget_configure.py

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Brian,

This branch looks good. I have one minor comment below.

-Edwin

>=== modified file 'lib/lp/bugs/stories/webservice/xx-bug-target.txt'
>--- lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-10-15 14:26:57 +0000
>+++ lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-11-03 22:22:32 +0000
>@@ -36,7 +36,7 @@
> Content-Type: text/plain
> X-Lazr-Oopsid: OOPS-...
> <BLANKLINE>
>- (<Product at 0x...>, 'bug_reporting_guidelines', 'launchpad.Edit')
>+ (<Product at 0x...>, 'bug_reporting_guidelines', 'launchpad.BugSupervisor')

If you just get rid of "0x" it will no longer be over 78 characters.

> <BLANKLINE>
> Traceback (most recent call last):
> ...
>

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2010-10-21 20:16:18 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2010-11-03 23:14:51 +0000
@@ -199,8 +199,9 @@
199199
200 def validate(self, data):200 def validate(self, data):
201 """Constrain bug expiration to Launchpad Bugs tracker."""201 """Constrain bug expiration to Launchpad Bugs tracker."""
202 self.validateBugSupervisor(data)202 if check_permission("launchpad.Edit", self.context):
203 self.validateSecurityContact(data)203 self.validateBugSupervisor(data)
204 self.validateSecurityContact(data)
204 # enable_bug_expiration is disabled by JavaScript when bugtracker205 # enable_bug_expiration is disabled by JavaScript when bugtracker
205 # is not 'In Launchpad'. The constraint is enforced here in case the206 # is not 'In Launchpad'. The constraint is enforced here in case the
206 # JavaScript fails to activate or run. Note that the bugtracker207 # JavaScript fails to activate or run. Note that the bugtracker
@@ -215,10 +216,11 @@
215 # bug_supervisor and security_contactrequires a transition method,216 # bug_supervisor and security_contactrequires a transition method,
216 # so it must be handled separately and removed for the217 # so it must be handled separately and removed for the
217 # updateContextFromData to work as expected.218 # updateContextFromData to work as expected.
218 self.changeBugSupervisor(data['bug_supervisor'])219 if check_permission("launchpad.Edit", self.context):
219 del data['bug_supervisor']220 self.changeBugSupervisor(data['bug_supervisor'])
220 self.changeSecurityContact(data['security_contact'])221 del data['bug_supervisor']
221 del data['security_contact']222 self.changeSecurityContact(data['security_contact'])
223 del data['security_contact']
222 self.updateContextFromData(data)224 self.updateContextFromData(data)
223225
224226
225227
=== modified file 'lib/lp/bugs/browser/tests/test_bugtarget_configure.py'
--- lib/lp/bugs/browser/tests/test_bugtarget_configure.py 2010-10-20 14:58:01 +0000
+++ lib/lp/bugs/browser/tests/test_bugtarget_configure.py 2010-11-03 23:14:51 +0000
@@ -168,3 +168,15 @@
168 self.assertEqual([], view.errors)168 self.assertEqual([], view.errors)
169 self.assertEqual(169 self.assertEqual(
170 'new guidelines', self.product.bug_reporting_guidelines)170 'new guidelines', self.product.bug_reporting_guidelines)
171
172 def test_bug_supervisor_can_edit(self):
173 logout()
174 login_person(self.bug_supervisor)
175 form = self._makeForm()
176 # Only the bug_reporting_guidelines are different.
177 form['field.bug_reporting_guidelines'] = 'new guidelines'
178 view = create_initialized_view(
179 self.product, name='+configure-bugtracker', form=form)
180 self.assertEqual([], view.errors)
181 self.assertEqual(
182 'new guidelines', self.product.bug_reporting_guidelines)
171183
=== modified file 'lib/lp/bugs/stories/webservice/xx-bug-target.txt'
--- lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-10-15 14:26:57 +0000
+++ lib/lp/bugs/stories/webservice/xx-bug-target.txt 2010-11-03 23:14:51 +0000
@@ -36,7 +36,7 @@
36 Content-Type: text/plain36 Content-Type: text/plain
37 X-Lazr-Oopsid: OOPS-...37 X-Lazr-Oopsid: OOPS-...
38 <BLANKLINE>38 <BLANKLINE>
39 (<Product at 0x...>, 'bug_reporting_guidelines', 'launchpad.Edit')39 (..., 'bug_reporting_guidelines', 'launchpad.BugSupervisor')
40 <BLANKLINE>40 <BLANKLINE>
41 Traceback (most recent call last):41 Traceback (most recent call last):
42 ...42 ...
4343
=== modified file 'lib/lp/registry/configure.zcml'
--- lib/lp/registry/configure.zcml 2010-11-02 20:10:56 +0000
+++ lib/lp/registry/configure.zcml 2010-11-03 23:14:51 +0000
@@ -1125,16 +1125,12 @@
1125 <require1125 <require
1126 permission="launchpad.Edit"1126 permission="launchpad.Edit"
1127 set_attributes="1127 set_attributes="
1128 bug_reported_acknowledgement
1129 bug_reporting_guidelines
1130 bugtracker
1131 commercial_subscription1128 commercial_subscription
1132 description1129 description
1133 development_focus1130 development_focus
1134 displayname1131 displayname
1135 downloadurl1132 downloadurl
1136 driver1133 driver
1137 enable_bug_expiration
1138 freshmeatproject1134 freshmeatproject
1139 homepage_content1135 homepage_content
1140 homepageurl1136 homepageurl
@@ -1146,13 +1142,11 @@
1146 official_answers1142 official_answers
1147 official_blueprints1143 official_blueprints
1148 official_codehosting1144 official_codehosting
1149 official_malone
1150 owner1145 owner
1151 programminglang1146 programminglang
1152 project1147 project
1153 redeemSubscriptionVoucher1148 redeemSubscriptionVoucher
1154 releaseroot1149 releaseroot
1155 remote_product
1156 screenshotsurl1150 screenshotsurl
1157 security_contact1151 security_contact
1158 sourceforgeproject1152 sourceforgeproject
@@ -1161,7 +1155,15 @@
1161 wikiurl"/>1155 wikiurl"/>
1162 <require1156 <require
1163 permission="launchpad.BugSupervisor"1157 permission="launchpad.BugSupervisor"
1164 set_attributes="official_bug_tags"/>1158 set_attributes="
1159 bug_reported_acknowledgement
1160 bug_reporting_guidelines
1161 bugtracker
1162 enable_bug_expiration
1163 official_bug_tags
1164 official_malone
1165 remote_product
1166 "/>
11651167
1166 <!-- mark 2006-04-10 I put "name" in the admin group because1168 <!-- mark 2006-04-10 I put "name" in the admin group because
1167 with Bazaar now in place, lots of people can have personal1169 with Bazaar now in place, lots of people can have personal