Merge lp:~cjwatson/launchpad/pabj-remove-feature-flag into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: no longer in the source branch.
Merged at revision: 16045
Proposed branch: lp:~cjwatson/launchpad/pabj-remove-feature-flag
Merge into: lp:launchpad
Diff against target: 118 lines (+4/-43)
4 files modified
lib/lp/services/features/flags.py (+0/-6)
lib/lp/soyuz/model/processacceptedbugsjob.py (+0/-10)
lib/lp/soyuz/scripts/processaccepted.py (+2/-5)
lib/lp/soyuz/scripts/tests/test_queue.py (+2/-22)
To merge this branch: bzr merge lp:~cjwatson/launchpad/pabj-remove-feature-flag
Reviewer Review Type Date Requested Status
Richard Harding (community) Approve
Review via email: mp+126090@code.launchpad.net

Commit message

Remove soyuz.processacceptedbugsjob.enabled feature flag, now that ProcessAcceptedBugsJob has been deployed successfully.

Description of the change

The deployment of https://code.launchpad.net/~cjwatson/launchpad/process-accepted-bugs-job/+merge/122420 went well, and the cron script and feature flag are enabled on production now with no issues that I've seen, so we should be able to remove the feature flag and finally close the saga of bug 745799.

(I don't actually intend to land this until after the 12.10 beta-2 freeze has completed and given us some more experimental data, just to make sure, but I might as well parallelise the review process.)

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/features/flags.py'
2--- lib/lp/services/features/flags.py 2012-09-19 11:47:37 +0000
3+++ lib/lp/services/features/flags.py 2012-09-24 20:45:25 +0000
4@@ -264,12 +264,6 @@
5 'disabled',
6 '',
7 'https://dev.launchpad.net/LEP/PrivateProjects'),
8- ('soyuz.processacceptedbugsjob.enabled',
9- 'boolean',
10- 'If true, use a job to close bugs when accepting uploads from a queue.',
11- 'disabled',
12- '',
13- ''),
14
15 ])
16
17
18=== modified file 'lib/lp/soyuz/model/processacceptedbugsjob.py'
19--- lib/lp/soyuz/model/processacceptedbugsjob.py 2012-09-19 11:47:37 +0000
20+++ lib/lp/soyuz/model/processacceptedbugsjob.py 2012-09-24 20:45:25 +0000
21@@ -21,7 +21,6 @@
22 classProvides,
23 implements,
24 )
25-from zope.security.proxy import removeSecurityProxy
26
27 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
28 from lp.bugs.interfaces.bug import IBugSet
29@@ -55,15 +54,6 @@
30 "\n\n---------------\n%s" % (spr.title, spr.changelog_entry))
31
32 for bug in bugs:
33- # We need to remove the security proxy here because the bug might be
34- # private and if this code is called via someone using the +queue
35- # page they will get an OOPS. BE CAREFUL with the unproxied bug
36- # object and look at what you're doing with it that might violate
37- # security.
38- # XXX cjwatson 2012-09-19: This can be removed once the
39- # soyuz.processacceptedbugsjob.enabled feature flag is switched on
40- # everywhere and the code to support disabling it is removed.
41- bug = removeSecurityProxy(bug)
42 edited_task = bug.setStatus(
43 target=target, status=BugTaskStatus.FIXRELEASED, user=janitor)
44 if edited_task is not None:
45
46=== modified file 'lib/lp/soyuz/scripts/processaccepted.py'
47--- lib/lp/soyuz/scripts/processaccepted.py 2012-09-19 11:47:37 +0000
48+++ lib/lp/soyuz/scripts/processaccepted.py 2012-09-24 20:45:25 +0000
49@@ -23,7 +23,6 @@
50 from lp.archiveuploader.tagfiles import parse_tagfile_content
51 from lp.registry.interfaces.distribution import IDistributionSet
52 from lp.registry.interfaces.pocket import PackagePublishingPocket
53-from lp.services.features import getFeatureFlag
54 from lp.services.scripts.base import (
55 LaunchpadCronScript,
56 LaunchpadScriptFailure,
57@@ -180,10 +179,8 @@
58 if not bug_ids_to_close:
59 return
60
61- if (getSecurityPolicy() == LaunchpadPermissiveSecurityPolicy or
62- not getFeatureFlag("soyuz.processacceptedbugsjob.enabled")):
63- # We're already running in a script (or the feature flag to allow
64- # use of the job is disabled), so we can just close the bugs
65+ if getSecurityPolicy() == LaunchpadPermissiveSecurityPolicy:
66+ # We're already running in a script, so we can just close the bugs
67 # directly.
68 close_bug_ids_for_sourcepackagerelease(
69 distroseries, source_release, bug_ids_to_close)
70
71=== modified file 'lib/lp/soyuz/scripts/tests/test_queue.py'
72--- lib/lp/soyuz/scripts/tests/test_queue.py 2012-09-20 15:36:33 +0000
73+++ lib/lp/soyuz/scripts/tests/test_queue.py 2012-09-24 20:45:25 +0000
74@@ -35,7 +35,6 @@
75 from lp.registry.interfaces.series import SeriesStatus
76 from lp.services.config import config
77 from lp.services.database.lpstorm import IStore
78-from lp.services.features.testing import FeatureFixture
79 from lp.services.librarian.interfaces import ILibraryFileAliasSet
80 from lp.services.librarian.model import LibraryFileAlias
81 from lp.services.librarian.utils import filechunks
82@@ -1080,11 +1079,6 @@
83
84 layer = DatabaseFunctionalLayer
85
86- def assertBugChanges(self, series, spr, bug):
87- with celebrity_logged_in("admin"):
88- self.assertEqual(
89- BugTaskStatus.FIXRELEASED, bug.default_bugtask.status)
90-
91 def test_close_bugs_for_sourcepackagerelease_with_private_bug(self):
92 # lp.soyuz.scripts.processaccepted.close_bugs_for_sourcepackagerelease
93 # should work with private bugs where the person using the queue
94@@ -1106,22 +1100,8 @@
95 # But the bug closure should work.
96 close_bugs_for_sourcepackagerelease(series, spr, changes)
97
98- # Verify it was closed.
99- self.assertBugChanges(series, spr, bug)
100-
101-
102-class TestQueuePageClosingBugsJob(TestQueuePageClosingBugs):
103- # Repeat TestQueuePageClosingBugs, but with the feature flag set to
104- # cause close_bugs_for_sourcepackagerelease to create a job rather than
105- # closing bugs immediately.
106-
107- def setUp(self):
108- super(TestQueuePageClosingBugsJob, self).setUp()
109- self.useFixture(FeatureFixture(
110- {"soyuz.processacceptedbugsjob.enabled": "on"},
111- ))
112-
113- def assertBugChanges(self, series, spr, bug):
114+ # Rather than closing the bugs immediately, this creates a
115+ # ProcessAcceptedBugsJob.
116 with celebrity_logged_in("admin"):
117 self.assertEqual(BugTaskStatus.NEW, bug.default_bugtask.status)
118 job_source = getUtility(IProcessAcceptedBugsJobSource)