Merge lp:~sinzui/launchpad/release-love into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Eleanor Berger
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/release-love
Merge into: lp:launchpad
Diff against target: 262 lines (+73/-24)
10 files modified
database/schema/security.cfg (+3/-0)
lib/canonical/launchpad/subscribers/karma.py (+8/-2)
lib/lp/bugs/doc/malone-karma.txt (+32/-1)
lib/lp/registry/browser/productrelease.py (+0/-5)
lib/lp/registry/browser/tests/productrelease-views.txt (+0/-6)
lib/lp/registry/doc/milestone.txt (+23/-0)
lib/lp/registry/model/milestone.py (+6/-2)
lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt (+0/-6)
lib/lp/registry/stories/productrelease/xx-productrelease-view.txt (+0/-1)
lib/lp/registry/templates/milestone-index.pt (+1/-1)
To merge this branch: bzr merge lp:~sinzui/launchpad/release-love
Reviewer Review Type Date Requested Status
Eleanor Berger (community) Approve
Review via email: mp+17864@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (3.6 KiB)

This is my branch to improve the release experience.

    lp:~sinzui/launchpad/release-love
    Diff size: 242
    Launchpad bug: https://bugs.launchpad.net/bugs/403554
                   https://bugs.launchpad.net/bugs/510984
                   https://bugs.launchpad.net/bugs/341687
                   https://bugs.launchpad.net/bugs/386584
                   https://bugs.launchpad.net/bugs/386586
    Test command: ./bin/test -vv \
        -t malone-karma \
        -t productrelease-views \
        -t milestone \
        -t xx-productrelease-basics \
        -t xx-productrelease-view
    Pre-implementation: No one. I really wanted to do this.
    Target release: 10.01

Improve the release experience
------------------------------

This branch fixes several small bugs that irk me when I make releases.
    * Project drivers do not get credit for setting a bug to triaged,
but
      users get credit for setting a bug to confirmed.
    * When creating a release, all the fix committed bugs should be set
to
      fix released.
    * The release manager should not get the karma for marking bugs fix
      released when they are assigned to someone.
    * The release manager should not see a warning about a deactivate
      milestone because 1) the form asked him if he wanted to keep it
active
      and 2) the milestone page clearly and prominently show the state,
    * Do not show the date expected when showing the date released. This
      does not mean much for launchpad, but it means a lot for
milestones
      that are not time-boxed.

Rules
-----

    * Treated triaged as confirmed in karma rules.
    * Add a rule to award karma to the assignee of a fix released bug.
    * Set fix committed bugs to fix released when a milestone creates
      a release.
    * Do not show a warning about a deactivated milestone when the user
      can see the status in both for the form and the page.
    * Do not show the date expect when a milestone has a date released.

QA
--

    * Triage a bug.
    * Verify that you are awarded bugaccepted karma on you karma
activity.

    * Mark a bug that is assigned to someone else as fix committed.
    * Verify that you are NOT awarded bugfixed karma on you karma
activity.
    * Verify that the other user is awarded bugfixed karma on his karma
      activity page.

    * Release a milestone with bugs fix committed.
    * Verify that the milestones are fixed released.

    * When creating a release, verify that you do not see an info
      notification that the milestone was deactivated because you told
      Launchpad to deactivate it

    * Visit https://edge.launchpad.net/libcpuinfo/trunk/0.0.1
    * Verify that the Expected field is not displayed.

Lint
----

Linting changed files:
  lib/canonical/launchpad/subscribers/karma.py
  lib/lp/bugs/doc/malone-karma.txt
  lib/lp/registry/browser/productrelease.py
  lib/lp/registry/browser/tests/productrelease-views.txt
  lib/lp/registry/doc/milestone.txt
  lib/lp/registry/model/milestone.py
  lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt
  lib/lp/registry/stories/productrelease/xx-productrelease-view.txt
  lib/lp/registry/templates/milestone-index.pt

T...

Read more...

Revision history for this message
Eleanor Berger (intellectronica) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2010-01-17 09:15:43 +0000
+++ database/schema/security.cfg 2010-01-22 21:50:26 +0000
@@ -410,6 +410,8 @@
410# Dyson release import script410# Dyson release import script
411type=user411type=user
412groups=script412groups=script
413public.bug = SELECT
414public.bugtask = SELECT, UPDATE
413public.product = SELECT415public.product = SELECT
414public.productseries = SELECT416public.productseries = SELECT
415public.productrelease = SELECT, INSERT, UPDATE417public.productrelease = SELECT, INSERT, UPDATE
@@ -420,6 +422,7 @@
420public.libraryfilealias = SELECT, INSERT422public.libraryfilealias = SELECT, INSERT
421public.libraryfilecontent = SELECT, INSERT423public.libraryfilecontent = SELECT, INSERT
422public.milestone = SELECT, INSERT424public.milestone = SELECT, INSERT
425public.sourcepackagename = SELECT
423426
424[pofilestats]427[pofilestats]
425# Translations POFile statistics verification/update script428# Translations POFile statistics verification/update script
426429
=== modified file 'lib/canonical/launchpad/subscribers/karma.py'
--- lib/canonical/launchpad/subscribers/karma.py 2009-06-25 05:30:52 +0000
+++ lib/canonical/launchpad/subscribers/karma.py 2010-01-22 21:50:26 +0000
@@ -100,13 +100,19 @@
100 actionname_status_mapping = {100 actionname_status_mapping = {
101 BugTaskStatus.FIXRELEASED: 'bugfixed',101 BugTaskStatus.FIXRELEASED: 'bugfixed',
102 BugTaskStatus.INVALID: 'bugrejected',102 BugTaskStatus.INVALID: 'bugrejected',
103 BugTaskStatus.CONFIRMED: 'bugaccepted'}103 BugTaskStatus.CONFIRMED: 'bugaccepted',
104 BugTaskStatus.TRIAGED: 'bugaccepted',
105 }
104106
105 if task_delta.status:107 if task_delta.status:
106 new_status = task_delta.status['new']108 new_status = task_delta.status['new']
107 actionname = actionname_status_mapping.get(new_status)109 actionname = actionname_status_mapping.get(new_status)
108 if actionname is not None:110 if actionname is not None:
109 _assign_karma_using_bugtask_context(user, bugtask, actionname)111 if actionname == 'bugfixed' and bugtask.assignee is not None:
112 _assign_karma_using_bugtask_context(
113 bugtask.assignee, bugtask, actionname)
114 else:
115 _assign_karma_using_bugtask_context(user, bugtask, actionname)
110116
111 if task_delta.importance is not None:117 if task_delta.importance is not None:
112 _assign_karma_using_bugtask_context(118 _assign_karma_using_bugtask_context(
113119
=== modified file 'lib/lp/bugs/doc/malone-karma.txt'
--- lib/lp/bugs/doc/malone-karma.txt 2009-07-23 17:49:31 +0000
+++ lib/lp/bugs/doc/malone-karma.txt 2010-01-22 21:50:26 +0000
@@ -79,6 +79,24 @@
79 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))79 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))
80 Karma added: action=bugfixed, distribution=debian80 Karma added: action=bugfixed, distribution=debian
8181
82Mark a bug task as fixed when it is assigned awards the karma to the assignee:
83
84 >>> from lp.bugs.interfaces.bugtask import IUpstreamBugTask
85
86 >>> ufo_product = factory.makeProduct(name='ufo')
87 >>> assignee = factory.makePerson(name='assignee')
88 >>> assigned_bugtask = factory.makeBugTask(bug=bug, target=ufo_product)
89 >>> assigned_bugtask.transitionToAssignee(assignee)
90 >>> old_bugtask = Snapshot(assigned_bugtask, providing=IUpstreamBugTask)
91 >>> assigned_bugtask.transitionToStatus(
92 ... BugTaskStatus.FIXRELEASED, getUtility(ILaunchBag).user)
93 >>> notify(ObjectModifiedEvent(assigned_bugtask, old_bugtask, ['status']))
94 Karma added: action=bugfixed, product=ufo
95
96 >>> for karma in assignee.latestKarma():
97 ... print karma.action.name
98 bugfixed
99
82Reject a bug task:100Reject a bug task:
83101
84 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)102 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)
@@ -87,7 +105,7 @@
87 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))105 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))
88 Karma added: action=bugrejected, distribution=debian106 Karma added: action=bugrejected, distribution=debian
89107
90Accept a bug task:108User accept a bug task:
91109
92 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)110 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)
93 >>> bugtask.transitionToStatus(111 >>> bugtask.transitionToStatus(
@@ -95,6 +113,17 @@
95 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))113 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))
96 Karma added: action=bugaccepted, distribution=debian114 Karma added: action=bugaccepted, distribution=debian
97115
116Driver accept a bug task:
117
118 >>> login_person(bugtask.target.owner)
119 >>> old_bugtask = Snapshot(bugtask, providing=IDistroBugTask)
120 >>> bugtask.transitionToStatus(
121 ... BugTaskStatus.TRIAGED, getUtility(ILaunchBag).user)
122 >>> notify(ObjectModifiedEvent(bugtask, old_bugtask, ['status']))
123 Karma added: action=bugaccepted, distribution=debian
124
125 >>> login('admin@canonical.com')
126
98Change a bug task's importance:127Change a bug task's importance:
99128
100 >>> from canonical.launchpad.interfaces import BugTaskImportance129 >>> from canonical.launchpad.interfaces import BugTaskImportance
@@ -183,6 +212,7 @@
183 >>> notify(ObjectModifiedEvent(bug, old_bug, ['duplicateof']))212 >>> notify(ObjectModifiedEvent(bug, old_bug, ['duplicateof']))
184 Karma added: action=bugmarkedasduplicate, product=evolution213 Karma added: action=bugmarkedasduplicate, product=evolution
185 Karma added: action=bugmarkedasduplicate, product=evolution214 Karma added: action=bugmarkedasduplicate, product=evolution
215 Karma added: action=bugmarkedasduplicate, product=ufo
186 Karma added: action=bugmarkedasduplicate, distribution=debian216 Karma added: action=bugmarkedasduplicate, distribution=debian
187 Karma added: action=bugmarkedasduplicate, distribution=debian217 Karma added: action=bugmarkedasduplicate, distribution=debian
188218
@@ -194,6 +224,7 @@
194 >>> notify(ObjectCreatedEvent(comment))224 >>> notify(ObjectCreatedEvent(comment))
195 Karma added: action=bugcommentadded, product=evolution225 Karma added: action=bugcommentadded, product=evolution
196 Karma added: action=bugcommentadded, product=evolution226 Karma added: action=bugcommentadded, product=evolution
227 Karma added: action=bugcommentadded, product=ufo
197 Karma added: action=bugcommentadded, distribution=debian228 Karma added: action=bugcommentadded, distribution=debian
198 Karma added: action=bugcommentadded, distribution=debian229 Karma added: action=bugcommentadded, distribution=debian
199230
200231
=== modified file 'lib/lp/registry/browser/productrelease.py'
--- lib/lp/registry/browser/productrelease.py 2009-12-09 11:47:58 +0000
+++ lib/lp/registry/browser/productrelease.py 2010-01-22 21:50:26 +0000
@@ -39,7 +39,6 @@
39 action, canonical_url, ContextMenu, custom_widget,39 action, canonical_url, ContextMenu, custom_widget,
40 enabled_with_permission, LaunchpadEditFormView, LaunchpadFormView,40 enabled_with_permission, LaunchpadEditFormView, LaunchpadFormView,
41 LaunchpadView, Link, Navigation, stepthrough)41 LaunchpadView, Link, Navigation, stepthrough)
42from canonical.launchpad.webapp.menu import structured
43from canonical.widgets import DateTimeWidget42from canonical.widgets import DateTimeWidget
4443
45from lp.registry.browser import MilestoneOverlayMixin, RegistryDeleteViewMixin44from lp.registry.browser import MilestoneOverlayMixin, RegistryDeleteViewMixin
@@ -119,10 +118,6 @@
119 milestone.active = False118 milestone.active = False
120 milestone_link = '<a href="%s">%s milestone</a>' % (119 milestone_link = '<a href="%s">%s milestone</a>' % (
121 canonical_url(milestone), cgi.escape(milestone.name))120 canonical_url(milestone), cgi.escape(milestone.name))
122 self.request.response.addWarningNotification(structured(
123 _("The %s for this project release was deactivated "
124 "so that bugs and blueprints cannot be associated with "
125 "this release." % milestone_link)))
126 self.next_url = canonical_url(newrelease.milestone)121 self.next_url = canonical_url(newrelease.milestone)
127 notify(ObjectCreatedEvent(newrelease))122 notify(ObjectCreatedEvent(newrelease))
128123
129124
=== modified file 'lib/lp/registry/browser/tests/productrelease-views.txt'
--- lib/lp/registry/browser/tests/productrelease-views.txt 2009-12-07 17:09:55 +0000
+++ lib/lp/registry/browser/tests/productrelease-views.txt 2010-01-22 21:50:26 +0000
@@ -50,12 +50,6 @@
50 >>> print view.widget_errors50 >>> print view.widget_errors
51 {}51 {}
5252
53 >>> for notification in view.request.response.notifications:
54 ... print notification.message
55 The <a href="http://launchpad.dev/app/+milestone/0.1">0.1 milestone</a>
56 for this project release was deactivated so that bugs and blueprints
57 cannot be associated with this release.
58
59 >>> print milestone.active53 >>> print milestone.active
60 False54 False
6155
6256
=== modified file 'lib/lp/registry/doc/milestone.txt'
--- lib/lp/registry/doc/milestone.txt 2009-11-06 21:06:38 +0000
+++ lib/lp/registry/doc/milestone.txt 2010-01-22 21:50:26 +0000
@@ -506,3 +506,26 @@
506 ...506 ...
507 AssertionError: You cannot delete a milestone which has structural507 AssertionError: You cannot delete a milestone which has structural
508 subscriptions.508 subscriptions.
509
510
511Creating a release from a milestone with targeted bugs
512------------------------------------------------------
513
514When a milestone with bug tasks creates a release, those bug tasks in fix
515committed status are updated to fix released.
516
517 >>> from lp.bugs.interfaces.bugtask import BugTaskStatus
518
519 >>> milestone = ff_onedotzero.newMilestone('kia')
520 >>> fixed_bugtask = factory.makeBugTask(target=upstream_firefox)
521 >>> fixed_bugtask.transitionToMilestone(milestone, owner)
522 >>> fixed_bugtask.transitionToStatus(BugTaskStatus.FIXCOMMITTED, owner)
523 >>> triaged_bugtask = factory.makeBugTask(target=upstream_firefox)
524 >>> triaged_bugtask.transitionToMilestone(milestone, owner)
525 >>> triaged_bugtask.transitionToStatus(BugTaskStatus.TRIAGED, owner)
526 >>> release = milestone.createProductRelease(owner, datetime.now(UTC))
527 >>> fixed_bugtask.status
528 <DBItem BugTaskStatus.FIXRELEASED, (30) Fix Released>
529
530 >>> triaged_bugtask.status
531 <DBItem BugTaskStatus.TRIAGED, (21) Triaged>
509532
=== modified file 'lib/lp/registry/model/milestone.py'
--- lib/lp/registry/model/milestone.py 2009-12-05 18:37:28 +0000
+++ lib/lp/registry/model/milestone.py 2010-01-22 21:50:26 +0000
@@ -31,7 +31,7 @@
31from lp.registry.model.structuralsubscription import (31from lp.registry.model.structuralsubscription import (
32 StructuralSubscriptionTargetMixin)32 StructuralSubscriptionTargetMixin)
33from lp.bugs.interfaces.bugtask import (33from lp.bugs.interfaces.bugtask import (
34 BugTaskSearchParams, IBugTaskSet)34 BugTaskSearchParams, BugTaskStatus, IBugTaskSet)
35from lp.bugs.interfaces.bugtarget import IHasBugs35from lp.bugs.interfaces.bugtarget import IHasBugs
36from lp.registry.interfaces.milestone import (36from lp.registry.interfaces.milestone import (
37 IHasMilestones, IMilestone, IMilestoneSet, IProjectMilestone)37 IHasMilestones, IMilestone, IMilestoneSet, IProjectMilestone)
@@ -177,12 +177,16 @@
177 if self.product_release is not None:177 if self.product_release is not None:
178 raise AssertionError(178 raise AssertionError(
179 'A milestone can only have one ProductRelease.')179 'A milestone can only have one ProductRelease.')
180 return ProductRelease(180 release = ProductRelease(
181 owner=owner,181 owner=owner,
182 changelog=changelog,182 changelog=changelog,
183 release_notes=release_notes,183 release_notes=release_notes,
184 datereleased=datereleased,184 datereleased=datereleased,
185 milestone=self)185 milestone=self)
186 for bugtask in self.open_bugtasks:
187 if bugtask.status == BugTaskStatus.FIXCOMMITTED:
188 bugtask.transitionToStatus(BugTaskStatus.FIXRELEASED, owner)
189 return release
186190
187 def destroySelf(self):191 def destroySelf(self):
188 """See `IMilestone`."""192 """See `IMilestone`."""
189193
=== modified file 'lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt'
--- lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt 2009-11-26 03:06:58 +0000
+++ lib/lp/registry/stories/productrelease/xx-productrelease-basics.txt 2010-01-22 21:50:26 +0000
@@ -52,12 +52,6 @@
52 >>> browser.url52 >>> browser.url
53 'http://launchpad.dev/firefox/+milestone/1.0'53 'http://launchpad.dev/firefox/+milestone/1.0'
5454
55There is a warning that the milestone has been deactivated.
56
57 >>> print get_feedback_messages(browser.contents)
58 [u'The 1.0 milestone for this project release was deactivated so
59 that bugs and blueprints cannot be associated with this release.']
60
61The release's information is displayed in the page.55The release's information is displayed in the page.
6256
63 >>> print extract_text(find_tag_by_id(browser.contents, 'release-notes'))57 >>> print extract_text(find_tag_by_id(browser.contents, 'release-notes'))
6458
=== modified file 'lib/lp/registry/stories/productrelease/xx-productrelease-view.txt'
--- lib/lp/registry/stories/productrelease/xx-productrelease-view.txt 2009-12-14 13:49:03 +0000
+++ lib/lp/registry/stories/productrelease/xx-productrelease-view.txt 2010-01-22 21:50:26 +0000
@@ -11,7 +11,6 @@
11 Series: trunk11 Series: trunk
12 Version: 0.9.212 Version: 0.9.2
13 Code name: One (secure) Tree Hill13 Code name: One (secure) Tree Hill
14 Expected:
15 Released: 2004-10-1514 Released: 2004-10-15
16 Registrant: Foo Bar15 Registrant: Foo Bar
17 Release registered: 2005-06-0616 Release registered: 2005-06-06
1817
=== modified file 'lib/lp/registry/templates/milestone-index.pt'
--- lib/lp/registry/templates/milestone-index.pt 2010-01-11 14:26:27 +0000
+++ lib/lp/registry/templates/milestone-index.pt 2010-01-22 21:50:26 +0000
@@ -67,7 +67,7 @@
67 </dd>67 </dd>
68 </dl>68 </dl>
6969
70 <dl>70 <dl tal:condition="not: view/release">
71 <dt>Expected:</dt>71 <dt>Expected:</dt>
72 <dd><span72 <dd><span
73 tal:attributes="title context/dateexpected/fmt:datetime"73 tal:attributes="title context/dateexpected/fmt:datetime"