Merge lp:~sinzui/launchpad/buga-buga into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Leonard Richardson
Approved revision: no longer in the source branch.
Merged at revision: 12133
Proposed branch: lp:~sinzui/launchpad/buga-buga
Merge into: lp:launchpad
Diff against target: 612 lines (+131/-168)
15 files modified
lib/lp/bugs/browser/bug.py (+3/-3)
lib/lp/bugs/browser/bugnomination.py (+6/-0)
lib/lp/bugs/browser/tests/test_bugnomination.py (+52/-0)
lib/lp/bugs/mail/newbug.py (+5/-6)
lib/lp/bugs/mail/tests/test_bug_task_assignment.py (+7/-4)
lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt (+5/-4)
lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt (+5/-4)
lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt (+1/-1)
lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt (+3/-2)
lib/lp/bugs/stories/cve/cve-linking.txt (+24/-120)
lib/lp/bugs/templates/bug-nominate-for-series.pt (+3/-14)
lib/lp/bugs/templates/bugnomination-edit.pt (+2/-2)
lib/lp/bugs/templates/bugtarget-bugs.pt (+1/-1)
lib/lp/bugs/templates/cve-index.pt (+10/-3)
lib/lp/registry/stories/milestone/object-milestones.txt (+4/-4)
To merge this branch: bzr merge lp:~sinzui/launchpad/buga-buga
Reviewer Review Type Date Requested Status
Leonard Richardson (community) Approve
Review via email: mp+44297@code.launchpad.net

Description of the change

Fix some trivial bugs in Lp bugs.

    Launchpad bug:
        https://bugs.launchpad.net/bugs/136870
        https://bugs.launchpad.net/bugs/674546
        https://bugs.launchpad.net/bugs/670064
        https://bugs.launchpad.net/bugs/202136
        https://bugs.launchpad.net/bugs/297531
    Pre-implementation: deryck
    Test command: ./bin/test -vv \
      -t cve-linking \
      -t TestAssignmentNotification \
      -t stories/bug-release-management -t test_bugnomination

Bug #136870 [Link to bugs from lists of bugs in CVE pages]
    The title of linked bugs is not linked. User need to scroll to the
    related bugs portlet and find the bug number.

Bug #674546 ["See all hot bugs" link exists but lists cold bugs too]
    This link goes to a batched list of all open bug reports for the project,
    not just the hot ones.

Bug #670064 [Mail notification refers to "bug task" database schema]
    A "bug task for a public bug"? Is that something you need a Launchpad
    diploma to understand?

Bug #202136 [Nominating a bug for a series not a release]
    Distroseries were once named distroreleases, but that was inconsistent.
    The object name was fixed, but the links still mention a release. The
    use is actually asked to choose a series, not a release

Bug #297531 [+nominate UI needs a big rework]
    The title, heading, and form alignment issues have been fixed over the
    last two years, and the view is now restricted to bug supervisors and
    drivers. The page still talks of release when it means series, and the
    action should be Nominate or Target based on user privileges.

--------------------------------------------------------------------

RULES

Bug #136870 [Link to bugs from lists of bugs in CVE pages]
    * Link the bug title in the main content if the user has permission to
      view the bug

Bug #674546 ["See all hot bugs" link exists but lists cold bugs too]
    * As mpt suggests: change the text of the link to "Show all bugs by heat".

Bug #670064 [Mail notification refers to "bug task" database schema]
    * Change the sentence as mpt suggests
      <user.unique_displayname> has assigned this bug to you for <target>
    * ADDENDUM Removed else clause for missing creator. It is not possible
      to assign someone without knowing who did it. The logic appears to
      predate the use of transitionToAssignee()

Bug #202136 [Nominating a bug for a series not a release]
    * Change the text of the link to use 'series'.

Bug #297531 [+nominate UI needs a big rework]
    * Replace "release" with "series".
    * Change the action title to "Nominate" or "Target"

QA

Bug #136870 [Link to bugs from lists of bugs in CVE pages]
    * Visit https://bugs.launchpad.net/bugs/cve/2005-0406
    * Verify the heading of the related bugs link to the bug.

Bug #674546 ["See all hot bugs" link exists but lists cold bugs too]
    * Visit https://bugs.launchpad.net/launchpad
    * Verify the link under the hot bug listing reads "Show all bugs by heat".

Bug #670064 [Mail notification refers to "bug task" database schema]
    * Assign your self a bug.
    * Verify the email does not say you were assigned a bug task.

Bug #202136 [Nominating a bug for a series not a release]
    * Visit a bug you are a driver or bug supervisor for.
    * Verify the bug states target to/nominate for series

Bug #297531 [+nominate UI needs a big rework]
    * For a project you have permission to drive or supervise,
      Choose a bug that is not nominated for a series
    * Chose Nominate/Target to series
    * Verify the page talks of "series".
    * Verify the submit button reads Nominate or Target.

LINT

    lib/lp/bugs/browser/bug.py
    lib/lp/bugs/browser/bugnomination.py
    lib/lp/bugs/browser/tests/test_bugnomination.py
    lib/lp/bugs/mail/newbug.py
    lib/lp/bugs/mail/tests/test_bug_task_assignment.py
    lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt
    lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt
    lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt
    lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt
    lib/lp/bugs/stories/cve/cve-linking.txt
    lib/lp/bugs/templates/bug-nominate-for-series.pt
    lib/lp/bugs/templates/bugnomination-edit.pt
    lib/lp/bugs/templates/bugtarget-bugs.pt
    lib/lp/bugs/templates/cve-index.pt

^ Lint hates a lot of these files. I can clean up the indentation and line
lengths before I submit.

IMPLEMENTATION

Bug #136870 [Link to bugs from lists of bugs in CVE pages]
    Added a permission check tot he template and linked the bug if the
    user has permission to view the bug
    lib/lp/bugs/stories/cve/cve-linking.txt
    lib/lp/bugs/templates/cve-index.pt

Bug #674546 ["See all hot bugs" link exists but lists cold bugs too]
    Updated the link text in
    lib/lp/bugs/templates/bugtarget-bugs.pt

Bug #670064 [Mail notification refers to "bug task" database schema]
    Revised the message and removed the event_creator condition.
    lib/lp/bugs/mail/newbug.py
    lib/lp/bugs/mail/tests/test_bug_task_assignment.py

Bug #202136 [Nominating a bug for a series not a release]
    Update link text and test.
    lib/lp/bugs/browser/bug.py
    lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt

Bug #297531 [+nominate UI needs a big rework]
    Updated the templates to use series instead of release. Hacked the view
    to change the action label and added a test that is more convincing than
    the existing stories.
    lib/lp/bugs/browser/tests/test_bugnomination.py
    lib/lp/bugs/browser/bugnomination.py
    lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt
    lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt
    lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt
    lib/lp/bugs/templates/bug-nominate-for-series.pt
    lib/lp/bugs/templates/bugnomination-edit.pt

To post a comment you must log in.
Revision history for this message
Leonard Richardson (leonardr) wrote :

Approved with minor changes, as per IRC:

line 31, "submit label to" => "submit label"
line 48, "bug nomiation" => "bug nomination"

I mentioned that you were getting rid of a check for "event_creator is not None". You said you'd talked this over with Deryck and that you agreed that this could never happen.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/bug.py'
2--- lib/lp/bugs/browser/bug.py 2010-12-20 23:13:36 +0000
3+++ lib/lp/bugs/browser/bug.py 2010-12-21 23:52:24 +0000
4@@ -270,15 +270,15 @@
5 'changes'))
6
7 def nominate(self):
8- """Return the 'Target/Nominate for release' Link."""
9+ """Return the 'Target/Nominate for series' Link."""
10 launchbag = getUtility(ILaunchBag)
11 target = launchbag.product or launchbag.distribution
12 if check_permission("launchpad.Driver", target):
13- text = "Target to release"
14+ text = "Target to series"
15 return Link('+nominate', text, icon='milestone')
16 elif (check_permission("launchpad.BugSupervisor", target) or
17 self.user is None):
18- text = 'Nominate for release'
19+ text = 'Nominate for series'
20 return Link('+nominate', text, icon='milestone')
21 else:
22 return Link('+nominate', '', enabled=False, icon='milestone')
23
24=== modified file 'lib/lp/bugs/browser/bugnomination.py'
25--- lib/lp/bugs/browser/bugnomination.py 2010-11-23 23:22:27 +0000
26+++ lib/lp/bugs/browser/bugnomination.py 2010-12-21 23:52:24 +0000
27@@ -70,6 +70,12 @@
28 # been reported yet.
29 raise NotFound(self.current_bugtask, '+nominate', self.request)
30 LaunchpadFormView.initialize(self)
31+ # Update the submit label based on the user's permission.
32+ submit_action = self.__class__.actions.byname['actions.submit']
33+ if self.userIsReleaseManager():
34+ submit_action.label = _("Target")
35+ else:
36+ submit_action.label = _("Nominate")
37
38 @property
39 def label(self):
40
41=== added file 'lib/lp/bugs/browser/tests/test_bugnomination.py'
42--- lib/lp/bugs/browser/tests/test_bugnomination.py 1970-01-01 00:00:00 +0000
43+++ lib/lp/bugs/browser/tests/test_bugnomination.py 2010-12-21 23:52:24 +0000
44@@ -0,0 +1,52 @@
45+# Copyright 2010 Canonical Ltd. This software is licensed under the
46+# GNU Affero General Public License version 3 (see the file LICENSE).
47+
48+"""Tests for bug nomination views."""
49+
50+__metaclass__ = type
51+
52+from zope.component import getUtility
53+
54+from canonical.testing.layers import DatabaseFunctionalLayer
55+from canonical.launchpad.webapp.interfaces import ILaunchBag
56+from lp.testing import (
57+ login_person,
58+ person_logged_in,
59+ TestCaseWithFactory,
60+ )
61+from lp.testing.views import create_initialized_view
62+
63+
64+class TestBugNominationView(TestCaseWithFactory):
65+ """Tests for BugNominationView."""
66+
67+ layer = DatabaseFunctionalLayer
68+
69+ def setUp(self):
70+ super(TestBugNominationView, self).setUp()
71+ self.distribution = self.factory.makeDistribution()
72+ owner = self.distribution.owner
73+ bug_team = self.factory.makeTeam(owner=owner)
74+ self.bug_worker = self.factory.makePerson()
75+ with person_logged_in(owner):
76+ bug_team.addMember(self.bug_worker, owner)
77+ self.distribution.setBugSupervisor(bug_team, owner)
78+ self.distribution.driver = self.factory.makePerson()
79+ self.bug_task = self.factory.makeBugTask(target=self.distribution)
80+ launchbag = getUtility(ILaunchBag)
81+ launchbag.add(self.distribution)
82+ launchbag.add(self.bug_task)
83+
84+ def test_submit_action_bug_supervisor(self):
85+ # A bug supervisor sees the Nominate action label.
86+ login_person(self.bug_worker)
87+ view = create_initialized_view(self.bug_task, name='+nominate')
88+ action = view.__class__.actions.byname['actions.submit']
89+ self.assertEqual('Nominate', action.label)
90+
91+ def test_submit_action_driver(self):
92+ # A driver sees the Target action label.
93+ login_person(self.distribution.driver)
94+ view = create_initialized_view(self.bug_task, name='+nominate')
95+ action = view.__class__.actions.byname['actions.submit']
96+ self.assertEqual('Target', action.label)
97
98=== modified file 'lib/lp/bugs/mail/newbug.py'
99--- lib/lp/bugs/mail/newbug.py 2010-08-23 15:10:48 +0000
100+++ lib/lp/bugs/mail/newbug.py 2010-12-21 23:52:24 +0000
101@@ -61,13 +61,12 @@
102 }
103
104 if new_recipients:
105- if "assignee" in reason:
106+ if "assignee" in reason and event_creator is not None:
107 contents += (
108- "You have been assigned a bug task for a %(visibility)s bug")
109- if event_creator is not None:
110- contents += " by %(assigner)s"
111- content_substitutions['assigner'] = (
112- event_creator.unique_displayname)
113+ "%(assigner)s has assigned this bug to you for %(target)s")
114+ content_substitutions['assigner'] = (
115+ event_creator.unique_displayname)
116+ content_substitutions['target'] = bugtask.target.displayname
117 else:
118 contents += "You have been subscribed to a %(visibility)s bug"
119 if subscribed_by is not None:
120
121=== modified file 'lib/lp/bugs/mail/tests/test_bug_task_assignment.py'
122--- lib/lp/bugs/mail/tests/test_bug_task_assignment.py 2010-10-04 19:50:45 +0000
123+++ lib/lp/bugs/mail/tests/test_bug_task_assignment.py 2010-12-21 23:52:24 +0000
124@@ -61,7 +61,8 @@
125 ['assignee'], user=self.user))
126 transaction.commit()
127 self.assertEqual(len(stub.test_emails), 1, 'email not sent')
128- rationale = 'You have been assigned a bug task for a public bug by Sample Person'
129+ rationale = (
130+ 'Sample Person (name12) has assigned this bug to you for Rebirth')
131 msg = stub.test_emails[-1][2]
132 self.assertTrue(rationale in msg,
133 '%s not in\n%s\n' % (rationale, msg))
134@@ -89,7 +90,8 @@
135 self.bug_task, self.bug_task_before_modification,
136 ['assignee'], user=self.user))
137 latest_notification = BugNotification.selectFirst(orderBy='-id')
138- notifications, messages = construct_email_notifications([latest_notification])
139+ notifications, messages = construct_email_notifications(
140+ [latest_notification])
141 self.assertEqual(len(notifications), 1,
142 'email notication not created')
143 receivers = [message['To'] for message in messages]
144@@ -105,8 +107,9 @@
145 self.bug_task, self.bug_task_before_modification,
146 ['assignee'], user=self.user))
147 latest_notification = BugNotification.selectFirst(orderBy='-id')
148- notifications, messages = construct_email_notifications([latest_notification])
149- self.assertEqual(len(notifications), 1,
150+ notifications, messages = construct_email_notifications(
151+ [latest_notification])
152+ self.assertEqual(len(notifications), 1,
153 'email notification not created')
154 receivers = [message['To'] for message in messages]
155 self.assertFalse(self.team_member_email in receivers,
156
157=== modified file 'lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt'
158--- lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt 2010-10-20 16:30:03 +0000
159+++ lib/lp/bugs/stories/bug-release-management/30-nominate-bug-for-distrorelease.txt 2010-12-21 23:52:24 +0000
160@@ -1,4 +1,5 @@
161-= Nominate a bug to a distribution release =
162+Nominate a bug to a distribution release
163+========================================
164
165 A bug can be nominated for a distribution release.
166
167@@ -35,7 +36,7 @@
168 ... "http://launchpad.dev/poseidon/+source/%s/+bug/%s/+nominate" %
169 ... (dsp.name, bug_task.bug.id))
170 >>> nominater_browser.getControl("Aqua").selected = True
171- >>> nominater_browser.getControl("Submit").click()
172+ >>> nominater_browser.getControl("Nominate").click()
173 >>> for tag in find_tags_by_class(nominater_browser.contents, 'message'):
174 ... print tag
175 <div...Added nominations for: Poseidon Aqua...
176@@ -45,7 +46,7 @@
177 raised.
178
179 >>> nominater_other_browser.getControl("Aqua").selected = True
180- >>> nominater_other_browser.getControl("Submit").click()
181+ >>> nominater_other_browser.getControl("Nominate").click()
182
183 >>> for tag in find_tags_by_class(nominater_other_browser.contents,
184 ... 'message'):
185@@ -61,7 +62,7 @@
186 ... (dsp.name, bug_task.bug.id))
187
188 >>> admin_browser.getControl("Hydro").selected = True
189- >>> admin_browser.getControl("Submit").click()
190+ >>> admin_browser.getControl("Nominate").click()
191
192 >>> for tag in find_tags_by_class(admin_browser.contents, 'message'):
193 ... print tag
194
195=== modified file 'lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt'
196--- lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt 2010-10-20 16:30:03 +0000
197+++ lib/lp/bugs/stories/bug-release-management/40-nominate-bug-for-productseries.txt 2010-12-21 23:52:24 +0000
198@@ -1,4 +1,5 @@
199-= Nominating a bug for a product series =
200+Nominating a bug for a product series
201+=====================================
202
203 A bug can be nominated for a product series.
204
205@@ -33,7 +34,7 @@
206
207 >>> nominater_browser.getControl("Beta").selected = True
208 >>> nominater_other_browser.getControl("Beta").selected = True
209- >>> nominater_browser.getControl("Submit").click()
210+ >>> nominater_browser.getControl("Nominate").click()
211
212 >>> for tag in find_tags_by_class(nominater_browser.contents, 'message'):
213 ... print tag
214@@ -42,7 +43,7 @@
215 Now, if the nominater, having the form open in another browser window,
216 accidentally nominates the bug for Beta a second time, an error is raised.
217
218- >>> nominater_other_browser.getControl("Submit").click()
219+ >>> nominater_other_browser.getControl("Nominate").click()
220
221 >>> for tag in find_tags_by_class(nominater_other_browser.contents,
222 ... 'message'):
223@@ -57,7 +58,7 @@
224 ... "http://launchpad.dev/widget/+bug/%s/+nominate" % bug.id)
225
226 >>> admin_browser.getControl("Trunk").selected = True
227- >>> admin_browser.getControl("Submit").click()
228+ >>> admin_browser.getControl("Target").click()
229
230 >>> for tag in find_tags_by_class(admin_browser.contents, 'message'):
231 ... print tag
232
233=== modified file 'lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt'
234--- lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt 2010-10-18 20:20:01 +0000
235+++ lib/lp/bugs/stories/bug-release-management/60-defer-product-bug.txt 2010-12-21 23:52:24 +0000
236@@ -5,7 +5,7 @@
237 >>> admin_browser.open(
238 ... "http://launchpad.dev/products/firefox/+bug/4/+nominate")
239 >>> admin_browser.getControl("Trunk").selected = True
240- >>> admin_browser.getControl("Submit").click()
241+ >>> admin_browser.getControl("Target").click()
242
243 >>> user_browser.open('http://bugs.launchpad.dev/firefox/+bug/4')
244 >>> firefox_edit_url = (
245
246=== modified file 'lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt'
247--- lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt 2010-10-20 15:55:27 +0000
248+++ lib/lp/bugs/stories/bug-release-management/xx-anonymous-bug-nomination.txt 2010-12-21 23:52:24 +0000
249@@ -1,11 +1,12 @@
250-= Anonymous Nomination of Bugs for Release =
251+Anonymous Nomination of Bugs for Release
252+========================================
253
254 Anonymous users should not be able to nominate bugs for release because
255 launchpad.Edit permission is required to do so.:
256
257 >>> anon_browser.open('http://bugs.launchpad.dev/jokosher/+bug/12')
258
259- >>> anon_browser.getLink('Nominate for release').click()
260+ >>> anon_browser.getLink('Nominate for series').click()
261 Traceback (most recent call last):
262 ...
263 Unauthorized:...'launchpad.Edit'...
264
265=== modified file 'lib/lp/bugs/stories/cve/cve-linking.txt'
266--- lib/lp/bugs/stories/cve/cve-linking.txt 2010-10-18 22:24:59 +0000
267+++ lib/lp/bugs/stories/cve/cve-linking.txt 2010-12-21 23:52:24 +0000
268@@ -1,10 +1,12 @@
269-= Bug Links =
270+Bug Links
271+=========
272
273 CVE report can be linked to bugs. Users will do that when a bug exposes
274 the vulnerability in the report.
275
276
277-== Adding Links ==
278+Adding Links
279+------------
280
281 Let say that Launchpad Bug #5 records the vulnerability described in
282 CVE-2005-2737. A user that wants to document that relationship goes to
283@@ -21,21 +23,24 @@
284 >>> user_browser.open('http://launchpad.dev/bugs/cve/2005-2737')
285 >>> user_browser.getLink('Link to bug').click()
286
287-To link the bug, the user enters the bug ID and click the 'Link'
288-button.
289+To link the bug, the user enters the bug ID and click the 'Link' button.
290
291 >>> user_browser.getControl('Bug ID').value = '5'
292 >>> user_browser.getControl('Link').click()
293
294-The bug is now listed under the 'Related Bugs' heading:
295+The bug is now listed under the 'Related Bugs' heading, and the bug
296+title is linked
297
298- >>> print extract_text(
299- ... find_tag_by_id(user_browser.contents, 'related-bugs'))
300+ >>> content = find_tag_by_id(user_browser.contents, 'related-bugs')
301+ >>> print extract_text(content)
302 Related bugs and status ...
303 Bug #5:...Firefox install instructions should be complete ...
304
305-It is also possible to link a bug using its nickname. For example,
306-bug #2 has 'blackhole' as its nickname:
307+ >>> print content.a
308+ <a href=".../bugs/5" class="sprite bug">Bug #5: ...
309+
310+It is also possible to link a bug using its nickname. For example, bug
311+#2 has 'blackhole' as its nickname:
312
313 >>> user_browser.getLink('Link to bug').click()
314 >>> user_browser.getControl('Bug ID').value = 'blackholes'
315@@ -72,7 +77,6 @@
316 ... admin_browser.contents).findAll('form'):
317 ... print form.renderContents()
318
319-
320 Similarly, there should be no links allowing the user to mark the bug as
321 affecting another product or distribution.
322
323@@ -80,10 +84,11 @@
324 False
325
326
327-== Removing links ==
328+Removing links
329+--------------
330
331-To remove bug links, the user would use the 'Remove Bug Link' action.
332-He can select the bug reports, he wants to unlink from the CVE.
333+To remove bug links, the user would use the 'Remove Bug Link' action. He
334+can select the bug reports, he wants to unlink from the CVE.
335
336 >>> user_browser.getLink('Remove bug link').click()
337 >>> user_browser.getControl('#2: Blackhole').selected = True
338@@ -101,12 +106,14 @@
339 True
340
341
342-== Linking private bug reports ==
343+Linking private bug reports
344+---------------------------
345
346 (Let's mark bug #6 as private and only accessible by an
347 administrator or its subscribers.
348 # XXX flacoste 2006-08-22 bug=57307:
349 # This should use a private bug in our sample data.
350+
351 >>> from zope.component import getUtility
352 >>> from canonical.launchpad.ftests import login, logout
353 >>> from canonical.database.sqlbase import flush_database_updates
354@@ -117,12 +124,13 @@
355 >>> current_user = getUtility(ILaunchBag).user
356 >>> private_bug.setPrivate(True, current_user)
357 True
358+
359 >>> private_bug.unsubscribe(current_user, current_user)
360 >>> flush_database_updates()
361 >>> logout()
362
363-It is possible for a user having access to the private to link the CVE to
364-that bug.
365+It is possible for a user having access to the private to link the CVE
366+to that bug.
367
368 >>> admin_browser.open('http://launchpad.dev/bugs/cve/2005-2737')
369 >>> admin_browser.getLink('Link to bug').click()
370@@ -145,107 +153,3 @@
371 ... find_tag_by_id(anon_browser.contents, 'related-bugs'))
372 Related bugs and status ...
373 Bug #6: private bug
374-
375-
376-== Linking CVEs to bug reports ==
377-
378-Similarly, we should be able to unlink and re-link a CVE to a bug. Let's
379-look at Bug #1. We should see that it is linked to CVE 1999-8979.
380-
381- >>> print http(r"""
382- ... GET /firefox/+bug/1 HTTP/1.1
383- ... """)
384- HTTP/1.1 200 Ok
385- ...1999-8979...
386-
387-Let's remove that link. First, make sure we can see the page.We'll use
388-Sample Person again.
389-
390- >>> print http(r"""
391- ... GET /firefox/+bug/1/+unlinkcve HTTP/1.1
392- ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q=
393- ... """)
394- HTTP/1.1 200 Ok
395- ...
396-
397-And that we can POST to it.
398-
399- >>> print http(r"""
400- ... POST /firefox/+bug/1/+unlinkcve HTTP/1.1
401- ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q=
402- ... Content-Length: 317
403- ... Content-Type: multipart/form-data; boundary=---------------------------192921188714487939411191642790
404- ...
405- ... -----------------------------192921188714487939411191642790
406- ... Content-Disposition: form-data; name="field.sequence"
407- ...
408- ... 1999-8979
409- ... -----------------------------192921188714487939411191642790
410- ... Content-Disposition: form-data; name="field.actions.continue"
411- ...
412- ... Continue
413- ... -----------------------------192921188714487939411191642790--
414- ... """)
415- HTTP/1.1 303 See Other
416- ...
417- Content-Length: 0
418- ...
419- Location: http://.../firefox/+bug/1
420- ...
421-
422-And add it back. Make sure we can see the "Link CVE" page.
423-
424- >>> print http(r"""
425- ... GET /firefox/+bug/1/+linkcve HTTP/1.1
426- ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q=
427- ... """)
428- HTTP/1.1 200 Ok
429- ...
430-
431-And check if the CVE validator is working.
432-
433- >>> print http(r"""
434- ... POST /firefox/+bug/1/+linkcve HTTP/1.1
435- ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q=
436- ... Content-Length: 314
437- ... Content-Type: multipart/form-data; boundary=---------------------------10715549571845379851634356273
438- ...
439- ... -----------------------------10715549571845379851634356273
440- ... Content-Disposition: form-data; name="field.sequence"
441- ...
442- ... invalid
443- ... -----------------------------10715549571845379851634356273
444- ... Content-Disposition: form-data; name="field.actions.continue"
445- ...
446- ... Continue
447- ... -----------------------------10715549571845379851634356273--
448- ... """)
449- HTTP/1.1 200 Ok
450- ...
451- ...invalid is not a valid CVE number...
452- ...
453-
454-And POST to it.
455-
456- >>> print http(r"""
457- ... POST /firefox/+bug/1/+linkcve HTTP/1.1
458- ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q=
459- ... Content-Length: 314
460- ... Content-Type: multipart/form-data; boundary=---------------------------10715549571845379851634356273
461- ...
462- ... -----------------------------10715549571845379851634356273
463- ... Content-Disposition: form-data; name="field.sequence"
464- ...
465- ... 1999-8979
466- ... -----------------------------10715549571845379851634356273
467- ... Content-Disposition: form-data; name="field.actions.continue"
468- ...
469- ... Continue
470- ... -----------------------------10715549571845379851634356273--
471- ... """)
472- HTTP/1.1 303 See Other
473- ...
474- Content-Length: 0
475- ...
476- Location: http://.../firefox/+bug/1
477- ...
478
479=== modified file 'lib/lp/bugs/templates/bug-nominate-for-series.pt'
480--- lib/lp/bugs/templates/bug-nominate-for-series.pt 2009-09-01 14:57:35 +0000
481+++ lib/lp/bugs/templates/bug-nominate-for-series.pt 2010-12-21 23:52:24 +0000
482@@ -16,15 +16,15 @@
483 <div metal:fill-slot="extra_info">
484 <tal:targeting-mode condition="view/userIsReleaseManager">
485 <p>
486- Release targeting allows you to track the status, assignee, and
487- importance of a bug in one or more official releases.
488+ Series targeting allows you to track the status, assignee, and
489+ importance of a bug in one or more official series.
490 </p>
491 </tal:targeting-mode>
492
493 <tal:nomination-mode condition="not:view/userIsReleaseManager">
494 <p>
495 Bug nominations are evaluated by release managers and accepted
496- or declined for fixing in a release.
497+ or declined for fixing in a series.
498 </p>
499 </tal:nomination-mode>
500
501@@ -47,17 +47,6 @@
502 Foo Bar
503 </a>.
504 </p>
505-
506- <p tal:condition="not:view/getReleaseManager"
507- tal:define="release_context view/getReleaseContext">
508- There is no
509- <span tal:condition="not:view/userCanChangeDriver"
510- tal:content="string:release manager for ${release_context/displayname}"
511- /><a tal:condition="view/userCanChangeDriver"
512- tal:attributes="href string:${release_context/fmt:url}/+driver"
513- tal:content="string:release manager for ${release_context/displayname}"/>.
514- </p>
515-
516 </div>
517
518 </div>
519
520=== modified file 'lib/lp/bugs/templates/bugnomination-edit.pt'
521--- lib/lp/bugs/templates/bugnomination-edit.pt 2009-09-08 15:19:00 +0000
522+++ lib/lp/bugs/templates/bugnomination-edit.pt 2010-12-21 23:52:24 +0000
523@@ -15,8 +15,8 @@
524 </h1>
525 <p>
526 Approving a nomination will target the bug to be fixed in a specific
527- release. Declining a nomination will show on the bug page that this bug will
528- not be fixed in that specific release.
529+ series. Declining a nomination will show on the bug page that this bug will
530+ not be fixed in that specific series.
531 </p>
532 <div tal:content="structure context/@@+edit-form" />
533 </div>
534
535=== modified file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
536--- lib/lp/bugs/templates/bugtarget-bugs.pt 2010-11-23 21:24:29 +0000
537+++ lib/lp/bugs/templates/bugtarget-bugs.pt 2010-12-21 23:52:24 +0000
538@@ -155,7 +155,7 @@
539 </table>
540 <p id="more-hot-bugs"
541 tal:condition="view/hot_bugs_info/has_more_bugs">
542- <a tal:attributes="href string:${context/fmt:url/+bugs}?orderby=-heat&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.omit_dupes=on">See all hot bugs</a>
543+ <a tal:attributes="href string:${context/fmt:url/+bugs}?orderby=-heat&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field.omit_dupes=on">Show all bugs by heat</a>
544 </p>
545 </div>
546
547
548=== modified file 'lib/lp/bugs/templates/cve-index.pt'
549--- lib/lp/bugs/templates/cve-index.pt 2009-11-14 22:05:18 +0000
550+++ lib/lp/bugs/templates/cve-index.pt 2010-12-21 23:52:24 +0000
551@@ -31,8 +31,15 @@
552 </p>
553
554 <div tal:repeat="link view/buglinks">
555- <strong class="sprite bug">Bug #<span tal:replace="link/bug/id" />:
556- <span tal:replace="link/title" /></strong>
557+ <strong>
558+ <a tal:condition="link/bug/required:launchpad.View"
559+ tal:replace="structure link/bug/fmt:link"/>
560+ <span class="sprite bug"
561+ tal:condition="not: link/bug/required:launchpad.View">
562+ Bug #<tal:number replace="link/bug/id" />:
563+ <tal:title replace="link/title" />
564+ </span>
565+ </strong>
566 <tal:details condition="link/can_view_bug">
567 <div
568 tal:replace="structure link/bug/@@+bugtasks-and-nominations-table" />
569@@ -40,7 +47,7 @@
570 </div>
571 </div>
572
573- <div style="margin-top: 1em">
574+ <div style="margin-top: 1em">
575 See the <img src="/@@/link" />
576 <a tal:attributes="href context/url">CVE page on Mitre.org</a>
577 for more details.
578
579=== modified file 'lib/lp/registry/stories/milestone/object-milestones.txt'
580--- lib/lp/registry/stories/milestone/object-milestones.txt 2010-12-20 23:13:36 +0000
581+++ lib/lp/registry/stories/milestone/object-milestones.txt 2010-12-21 23:52:24 +0000
582@@ -380,13 +380,13 @@
583 >>> print backslashreplace(browser.title)
584 Bug...in Mozilla Firefox...
585
586- >>> browser.getLink('Target to release').click()
587+ >>> browser.getLink('Target to series').click()
588 >>> print browser.title
589 Target bug #19 to series...
590
591 >>> browser.getControl('1.0').selected = True
592 >>> browser.getControl('2.0').selected = True
593- >>> browser.getControl('Submit').click()
594+ >>> browser.getControl('Target').click()
595
596 The bug page now lists a bug task for each series:
597
598@@ -474,12 +474,12 @@
599 bug still appears in the milestone's bug listing:
600
601 >>> browser.open(bug_2_url)
602- >>> browser.getLink('Target to release').click()
603+ >>> browser.getLink('Target to series').click()
604 >>> print browser.url
605 http://bugs.launchpad.dev/firefox/+bug/.../+nominate
606
607 >>> browser.getControl('Trunk').selected = True
608- >>> browser.getControl('Submit').click()
609+ >>> browser.getControl('Target').click()
610 >>> print extract_text(first_tag_by_class(browser.contents, 'listing'))
611 Affects Status ...
612 Mozilla Firefox ... Status tracked in Trunk ...