Merge lp:~sinzui/launchpad/release-timeout-bug-513321 into lp:launchpad/db-devel

Proposed by Curtis Hovey
Status: Merged
Approved by: Edwin Grubbs
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/release-timeout-bug-513321
Merge into: lp:launchpad/db-devel
Diff against target: 80 lines (+19/-5)
4 files modified
lib/lp/registry/configure.zcml (+1/-0)
lib/lp/registry/doc/milestone.txt (+4/-3)
lib/lp/registry/interfaces/milestone.py (+9/-0)
lib/lp/registry/model/milestone.py (+5/-2)
To merge this branch: bzr merge lp:~sinzui/launchpad/release-timeout-bug-513321
Reviewer Review Type Date Requested Status
Gary Poster (community) release-critical Approve
Edwin Grubbs (community) code Approve
Review via email: mp+18160@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Curtis Hovey has proposed merging lp:~sinzui/launchpad/release-timeout-bug-513321 into lp:launchpad/devel.

    Requested reviews:
    Canonical Launchpad Engineering (launchpad)

This is my branch to fix the timeout when creating a release with bugs.
This is a hack, I will reopen https://bugs.edge.launchpad.net/bugs/341687
and create an alternate implementation.

    lp:~sinzui/launchpad/release-timeout-bug-513321
    Diff size: 81
    Launchpad bug: https://bugs.launchpad.net/bugs/513321
    Test command: ./bin/test -vv -t reg.*doc/milestone
    Pre-implementation: gary, deryck
    Target release: 10.01

Fix the timeout when creating a release with bugs
--------------------------------------------------------------------

Oops OOPS-1488EA819 shows that creating a release from a milestone times out
because all the sql time is consumed looking up the bug subscribers because
all the fix committed bugs were changed to fix released.

    bug.setStatus -> notify -> bug-mail -> timeout

Rules
-----

This is a feature that I personally love and is much desired by release
managers. It cannot work the way it is implemented though. We probably
want a cronscript or some other async proc that completes the bug update
after the release is created.

    * Move the bug status rules to a new method that is not called.
    * Update the test to verify the method.
    * Leave an XXX to complete the refactoring in another branch.

QA
--

This is hard because many released were created on staging without a
timeout. Edge/lpnet is timing out.

    * Create a release and verify the release is created and
      that the bugs are not updated.

Lint
----

Linting changed files:
  lib/lp/registry/configure.zcml
  lib/lp/registry/doc/milestone.txt
  lib/lp/registry/interfaces/milestone.py
  lib/lp/registry/model/milestone.py

Test
----

    * lib/lp/registry/doc/milestone.txt
      * Updated the test to exercise the new method closeBugsAndBlueprints().

Implementation
--------------

    * lib/lp/registry/configure.zcml
      * Register the new method
    * lib/lp/registry/interfaces/milestone.py
      * Declared closeBugsAndBlueprints()
      * Left an XXX to finish this feature.
    * lib/lp/registry/model/milestone.py
      * Moved the bug status loop to closeBugsAndBlueprints()
The attached diff has been truncated due to its size.

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

merge-approved

review: Approve (code)
Revision history for this message
Gary Poster (gary) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/configure.zcml'
2--- lib/lp/registry/configure.zcml 2010-01-20 05:42:33 +0000
3+++ lib/lp/registry/configure.zcml 2010-01-27 20:42:19 +0000
4@@ -900,6 +900,7 @@
5 permission="launchpad.Edit"
6 attributes="
7 createProductRelease
8+ closeBugsAndBlueprints
9 destroySelf"/>
10 <allow
11 interface="lp.bugs.interfaces.bugtarget.IHasBugs"/>
12
13=== modified file 'lib/lp/registry/doc/milestone.txt'
14--- lib/lp/registry/doc/milestone.txt 2010-01-25 05:16:26 +0000
15+++ lib/lp/registry/doc/milestone.txt 2010-01-27 20:42:19 +0000
16@@ -508,8 +508,8 @@
17 subscriptions.
18
19
20-Creating a release from a milestone with targeted bugs
21-------------------------------------------------------
22+Closing milestone targeted bugs
23+-------------------------------
24
25 When a milestone with bug tasks creates a release, those bug tasks in fix
26 committed status are updated to fix released. An ObjectModifiedEvent
27@@ -531,10 +531,11 @@
28 >>> triaged_bugtask = factory.makeBugTask(target=upstream_firefox)
29 >>> triaged_bugtask.transitionToMilestone(milestone, owner)
30 >>> triaged_bugtask.transitionToStatus(BugTaskStatus.TRIAGED, owner)
31+ >>> release = milestone.createProductRelease(owner, datetime.now(UTC))
32 >>> bugtask_event_listener = TestEventListener(
33 ... IBugTask, IObjectModifiedEvent, print_event)
34
35- >>> release = milestone.createProductRelease(owner, datetime.now(UTC))
36+ >>> milestone.closeBugsAndBlueprints(owner)
37 Received ObjectModifiedEvent on BugTask
38
39 >>> fixed_bugtask.status
40
41=== modified file 'lib/lp/registry/interfaces/milestone.py'
42--- lib/lp/registry/interfaces/milestone.py 2009-12-05 18:50:48 +0000
43+++ lib/lp/registry/interfaces/milestone.py 2010-01-27 20:42:19 +0000
44@@ -163,6 +163,15 @@
45 :returns: `IProductRelease` object.
46 """
47
48+ def closeBugsAndBlueprints(user):
49+ """Close completed bugs and blueprints.
50+
51+ Bugs that are fix committed status are updated to fix released.
52+ Blueprints that are in deployment status are updated to implemented
53+ status.
54+ XXX sinzui 2010-01-27 bug=341687: blueprints not yet implemented.
55+ """
56+
57 @export_write_operation()
58 @export_operation_as('delete')
59 def destroySelf():
60
61=== modified file 'lib/lp/registry/model/milestone.py'
62--- lib/lp/registry/model/milestone.py 2010-01-25 18:03:40 +0000
63+++ lib/lp/registry/model/milestone.py 2010-01-27 20:42:19 +0000
64@@ -183,11 +183,14 @@
65 release_notes=release_notes,
66 datereleased=datereleased,
67 milestone=self)
68+ return release
69+
70+ def closeBugsAndBlueprints(self, user):
71+ """See `IMilestone`."""
72 for bugtask in self.open_bugtasks:
73 if bugtask.status == BugTaskStatus.FIXCOMMITTED:
74 bugtask.bug.setStatus(
75- bugtask.target, BugTaskStatus.FIXRELEASED, owner)
76- return release
77+ bugtask.target, BugTaskStatus.FIXRELEASED, user)
78
79 def destroySelf(self):
80 """See `IMilestone`."""

Subscribers

People subscribed via source and target branches

to status/vote changes: