launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #13352
[Merge] lp:~stevenk/launchpad/destroy-old-bugactivity into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/destroy-old-bugactivity into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1017824 in Launchpad itself: "BugVisibilityChange and BugSecurityChange continue to exist"
https://bugs.launchpad.net/launchpad/+bug/1017824
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/destroy-old-bugactivity/+merge/129339
Destroy Bug{Security,Visibility}Change and only make use of BugInformationTypeChange.
I have changed all of the tests I could find, but I suspect ec2 may find some that I may have missed.
I have corrected a small bug in database/schema/Makefile -- it will now use the current year when regenerating sampledata, like update-copyright does.
--
https://code.launchpad.net/~stevenk/launchpad/destroy-old-bugactivity/+merge/129339
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/destroy-old-bugactivity into lp:launchpad.
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2012-10-11 04:37:46 +0000
+++ database/sampledata/current-dev.sql 2012-10-12 03:23:19 +0000
@@ -4335,7 +4335,6 @@
ALTER TABLE featureflag DISABLE TRIGGER ALL;
-INSERT INTO featureflag (scope, priority, flag, value, date_modified) VALUES ('default', 0, 'disclosure.information_type_notifications.enabled', 'true', '2012-05-18 07:34:39.239649');
INSERT INTO featureflag (scope, priority, flag, value, date_modified) VALUES ('default', 0, 'js.combo_loader.enabled', 'true', '2012-05-18 07:34:39.239649');
INSERT INTO featureflag (scope, priority, flag, value, date_modified) VALUES ('default', 1, 'longpoll.merge_proposals.enabled', 'true', '2012-05-18 07:34:39.239649');
=== modified file 'database/schema/Makefile'
--- database/schema/Makefile 2012-07-12 09:58:32 +0000
+++ database/schema/Makefile 2012-10-12 03:23:19 +0000
@@ -38,7 +38,8 @@
# The command we use to drop (if exists) and recreate a database.
CREATEDB=${PYTHON} ../../utilities/pgmassacre.py -t
-HEADER="-- Copyright 2010-2011 Canonical Ltd. This software is licensed \
+YEAR=$(shell date +'%Y')
+HEADER="-- Copyright 2010-${YEAR} Canonical Ltd. This software is licensed \
under the\n-- GNU Affero General Public License version 3 (see the file \
LICENSE)."
=== modified file 'lib/lp/bugs/adapters/bugchange.py'
--- lib/lp/bugs/adapters/bugchange.py 2012-07-17 03:57:26 +0000
+++ lib/lp/bugs/adapters/bugchange.py 2012-10-12 03:23:19 +0000
@@ -24,7 +24,6 @@
'BugDescriptionChange',
'BugDuplicateChange',
'BugInformationTypeChange',
- 'BugSecurityChange',
'BugTagsChange',
'BugTaskAdded',
'BugTaskAssigneeChange',
@@ -35,7 +34,6 @@
'BugTaskStatusChange',
'BugTaskTargetChange',
'BugTitleChange',
- 'BugVisibilityChange',
'BugWatchAdded',
'BugWatchRemoved',
'CveLinkedToBug',
@@ -59,7 +57,6 @@
UNRESOLVED_BUGTASK_STATUSES,
)
from lp.registry.interfaces.product import IProduct
-from lp.services.features import getFeatureFlag
from lp.services.librarian.browser import ProxiedLibraryFileAlias
from lp.services.webapp.publisher import canonical_url
@@ -105,12 +102,8 @@
# The order of the field names in this list is important; this is
# the order in which changes will appear both in the bug activity
# log and in notification emails.
- bug_change_field_names = ['duplicateof', 'title', 'description']
- if bool(getFeatureFlag(
- 'disclosure.information_type_notifications.enabled')):
- bug_change_field_names.append('information_type')
- else:
- bug_change_field_names.extend(('private', 'security_related'))
+ bug_change_field_names = ['duplicateof', 'title', 'description',
+ 'information_type', 'tags', 'attachment']
bug_change_field_names.extend(('tags', 'attachment'))
for field_name in bug_change_field_names:
field_delta = getattr(bug_delta, field_name)
@@ -562,70 +555,6 @@
self.old_value.title, self.new_value.title)}
-# XXX: This can be deleted when information_type_notifications is removed.
-class BugVisibilityChange(AttributeChange):
- """Describes a change to a bug's visibility."""
-
- def _getVisibilityString(self, private):
- """Return a string representation of `private`.
-
- :return: 'Public' if private is False, 'Private' if
- private is True.
- """
- if private:
- return 'Private'
- else:
- return 'Public'
-
- def getBugActivity(self):
- # Use _getVisibilityString() to set old and new values
- # correctly. We lowercase them for UI consistency in the
- # activity log.
- old_value = self._getVisibilityString(self.old_value)
- new_value = self._getVisibilityString(self.new_value)
- return {
- 'oldvalue': old_value.lower(),
- 'newvalue': new_value.lower(),
- 'whatchanged': 'visibility',
- }
-
- def getBugNotification(self):
- visibility_string = self._getVisibilityString(self.new_value)
- return {'text': "** Visibility changed to: %s" % visibility_string}
-
-
-# XXX: This can be deleted when information_type_notifications is removed.
-class BugSecurityChange(AttributeChange):
- """Describes a change to a bug's security setting."""
-
- activity_mapping = {
- (False, True): ('no', 'yes'),
- (True, False): ('yes', 'no'),
- }
-
- notification_mapping = {
- (False, True):
- u"** This bug has been flagged as a security vulnerability",
- (True, False):
- u"** This bug is no longer flagged as a security vulnerability",
- }
-
- def getBugActivity(self):
- old_value, new_value = self.activity_mapping[
- (self.old_value, self.new_value)]
- return {
- 'oldvalue': old_value,
- 'newvalue': new_value,
- 'whatchanged': 'security vulnerability',
- }
-
- def getBugNotification(self):
- return {
- 'text': self.notification_mapping[
- (self.old_value, self.new_value)],
- }
-
-
class BugTagsChange(AttributeChange):
"""Used to represent a change to an `IBug`s tags."""
@@ -940,8 +869,6 @@
BUG_CHANGE_LOOKUP = {
'description': BugDescriptionChange,
- 'private': BugVisibilityChange,
- 'security_related': BugSecurityChange,
'information_type': BugInformationTypeChange,
'tags': BugTagsChange,
'title': BugTitleChange,
=== modified file 'lib/lp/bugs/doc/bug-change.txt'
--- lib/lp/bugs/doc/bug-change.txt 2012-08-08 11:48:29 +0000
+++ lib/lp/bugs/doc/bug-change.txt 2012-10-12 03:23:19 +0000
@@ -312,50 +312,6 @@
'whatchanged': 'marked as duplicate'}
-=== BugVisibilityChange ===
-
-BugVisibilityChange is used to represent a change in a Bug's `private`
-attribute.
-
- >>> from lp.bugs.adapters.bugchange import (
- ... BugVisibilityChange)
-
- >>> bug_visibility_change = BugVisibilityChange(
- ... when=nowish, person=example_person,
- ... what_changed='private', old_value=example_bug.private,
- ... new_value=True)
-
-IBug.private is a boolean but to make it more readable we express it in
-activity and notification records as a string, where True = 'Private'
-and False = 'Public'. We also refer to it as "visibility" rather than
-privacy.
-
- >>> print pretty(bug_visibility_change.getBugActivity())
- {'newvalue': 'private',
- 'oldvalue': 'public',
- 'whatchanged': 'visibility'}
-
-We also use the 'Private', 'Public' and 'Visibility' terms in the
-notification text.
-
- >>> print bug_visibility_change.getBugNotification()['text']
- ** Visibility changed to: Private
-
-If we reverse the changes we'll see the opposite values in the
-notification and activity entries.
-
- >>> bug_visibility_change = BugVisibilityChange(
- ... when=nowish, person=example_person,
- ... what_changed='private', old_value=True, new_value=False)
- >>> print pretty(bug_visibility_change.getBugActivity())
- {'newvalue': 'public',
- 'oldvalue': 'private',
- 'whatchanged': 'visibility'}
-
- >>> print bug_visibility_change.getBugNotification()['text']
- ** Visibility changed to: Public
-
-
== BugTagsChange ==
BugTagsChange is used to represent a change in a Bug's tag list.
@@ -385,49 +341,6 @@
** Tags added: zillionth-tag
-=== BugSecurityChange ===
-
-BugSecurityChange is used to represent a change in a Bug's
-`security_related` attribute.
-
- >>> from lp.bugs.adapters.bugchange import (
- ... BugSecurityChange)
-
- >>> bug_security_change = BugSecurityChange(
- ... when=nowish, person=example_person,
- ... what_changed='security_related',
- ... old_value=False, new_value=True)
-
-IBug.security_related is a boolean but to make it more readable we
-express it in activity and notification records as a short phrase.
-
-Marking a bug as security related causes one set of terms/phrases to
-be used.
-
- >>> print pretty(bug_security_change.getBugActivity())
- {'newvalue': 'yes',
- 'oldvalue': 'no',
- 'whatchanged': 'security vulnerability'}
-
- >>> print bug_security_change.getBugNotification()['text']
- ** This bug has been flagged as a security vulnerability
-
-Going the other way the phrases are similar.
-
- >>> bug_security_change = BugSecurityChange(
- ... when=nowish, person=example_person,
- ... what_changed='security_related',
- ... old_value=True, new_value=False)
-
- >>> print pretty(bug_security_change.getBugActivity())
- {'newvalue': 'no',
- 'oldvalue': 'yes',
- 'whatchanged': 'security vulnerability'}
-
- >>> print bug_security_change.getBugNotification()['text']
- ** This bug is no longer flagged as a security vulnerability
-
-
=== CveLinkedToBug / CveUnlinkedFromBug ===
These describe the linking or unlinking of a CVE to a bug.
=== modified file 'lib/lp/bugs/doc/bugnotification-email.txt'
--- lib/lp/bugs/doc/bugnotification-email.txt 2012-09-17 16:13:40 +0000
+++ lib/lp/bugs/doc/bugnotification-email.txt 2012-10-12 03:23:19 +0000
@@ -233,10 +233,9 @@
... bug=edited_bug,
... bugurl="http://www.example.com/bugs/6",
... user=sample_person,
- ... private={'old': False, 'new': edited_bug.private},
- ... security_related={
- ... 'old': False,
- ... 'new': edited_bug.security_related,
+ ... information_type = {
+ ... 'old': InformationType.PUBLIC,
+ ... 'new': InformationType.PRIVATESECURITY
... })
>>> for change in get_bug_changes(bug_delta):
@@ -244,9 +243,7 @@
... text_representation = notification['text']
... print text_representation #doctest: -NORMALIZE_WHITESPACE
... print "-----------------------------"
- ** Visibility changed to: Private
- -----------------------------
- ** This bug has been flagged as a security vulnerability
+ ** Information type change from Public to Private Security
-----------------------------
Now we set the bug public, and not security-related and check if the
@@ -267,9 +264,7 @@
... notification = change.getBugNotification()
... print notification['text'] #doctest: -NORMALIZE_WHITESPACE
... print "-----------------------------"
- ** Visibility changed to: Public
- -----------------------------
- ** This bug is no longer flagged as a security vulnerability
+ ** Information type changed from Private Security to Public
-----------------------------
Let's add some tags to a bug:
=== modified file 'lib/lp/bugs/doc/bugnotification-sending.txt'
--- lib/lp/bugs/doc/bugnotification-sending.txt 2012-09-19 13:21:13 +0000
+++ lib/lp/bugs/doc/bugnotification-sending.txt 2012-10-12 03:23:19 +0000
@@ -166,16 +166,16 @@
Let's add a few changes and see how it looks like:
>>> from lp.bugs.adapters.bugchange import (
- ... BugTitleChange, BugVisibilityChange)
+ ... BugTitleChange, BugInformationTypeChange)
>>> bug_one.addChange(
... BugTitleChange(
... ten_minutes_ago, sample_person, "title",
... "Old summary", "New summary"))
>>> bug_one.addChange(
- ... BugVisibilityChange(
- ... ten_minutes_ago, sample_person, "private",
- ... False, True))
+ ... BugInformationTypeChange(
+ ... ten_minutes_ago, sample_person, "information_type",
+ ... "PUBLIC", "PRIVATE"))
>>> pending_notifications = getUtility(
... IBugNotificationSet).getNotificationsToSend()
>>> len(pending_notifications)
@@ -196,7 +196,7 @@
- Old summary
+ New summary
<BLANKLINE>
- ** Visibility changed to: Private
+ ** Information type changed from Public to Private
<BLANKLINE>
--
...
@@ -216,9 +216,9 @@
... ten_minutes_ago, sample_person, "title",
... "New summary", "Another summary"))
>>> bug_one.addChange(
- ... BugVisibilityChange(
- ... ten_minutes_ago, sample_person, "private",
- ... True, False))
+ ... BugInformationTypeChange(
+ ... ten_minutes_ago, sample_person, "information_type",
+ ... "PRIVATE", "PUBLIC"))
>>> pending_notifications = getUtility(
... IBugNotificationSet).getNotificationsToSend()
>>> len(pending_notifications)
@@ -283,9 +283,9 @@
>>> now = datetime.now(pytz.timezone('UTC'))
>>> for minutes_ago in reversed(range(10)):
... bug_one.addChange(
- ... BugVisibilityChange(
+ ... BugInformationTypeChange(
... now - timedelta(minutes=minutes_ago), sample_person,
- ... "private", False, True))
+ ... "information_type", "PUBLIC", "PRIVATE"))
>>> pending_notifications = getUtility(
... IBugNotificationSet).getNotificationsToSend()
>>> len(pending_notifications)
@@ -471,13 +471,13 @@
... ten_minutes_ago, sample_person, "title",
... "Old summary", "New summary"))
>>> bug_two.addChange(
- ... BugVisibilityChange(
+ ... BugInformationTypeChange(
... ten_minutes_ago, sample_person, "title",
- ... False, True))
+ ... "PUBLIC", "PRIVATE"))
>>> bug_two.addChange(
- ... BugVisibilityChange(
+ ... BugInformationTypeChange(
... ten_minutes_ago, sample_person, "title",
- ... True, False))
+ ... "PRIVATE", "PUBLIC"))
>>> notifications = getUtility(
... IBugNotificationSet).getNotificationsToSend()
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2012-08-03 01:42:13 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2012-10-12 03:23:19 +0000
@@ -98,44 +98,6 @@
+ A new title for this bug
--------
-Alterations to a bug's privacy will show up as 'visibility' changes.
-
- >>> admin_browser.open(
- ... 'http://bugs.launchpad.dev/redfish/+bug/15/+secrecy')
- >>> admin_browser.getControl("Private", index=1).selected = True
- >>> admin_browser.getControl("Change").click()
-
- >>> admin_browser.open('http://launchpad.dev/bugs/15')
- >>> print_comments(admin_browser.contents)
- Foo Bar
- ... ago
- summary:
- - Nonsensical bugs are useless
- + A new title for this bug
- visibility:
- public => private
- --------
-
-Changes to a bug's security_related field will be displayed as
-'security vulnerability' changes, with values of 'yes' or 'no'. Note
-that changes are grouped together if they occur at similar times, but
-are still shown in the order the changes were made.
-
- >>> admin_browser.open(
- ... 'http://bugs.launchpad.dev/redfish/+bug/15/+secrecy')
- >>> admin_browser.getControl("Private Security").selected = True
- >>> admin_browser.getControl("Change").click()
-
- >>> admin_browser.open('http://launchpad.dev/bugs/15')
- >>> print_comments(admin_browser.contents)
- Foo Bar (name16)
- ... ago
- summary:
- ...
- security vulnerability:
- no => yes
- --------
-
Changes to the bug's description will simply be displayed as 'description:
updated', since such changes can be quite long.
@@ -310,31 +272,26 @@
ubuntu
--------
-Changes to information_type are shown when the feature flag is set.
+Changes to information_type are shown.
- >>> from lp.services.features.testing import FeatureFixture
- >>> feature_flag = {
- ... 'disclosure.information_type_notifications.enabled': 'on'}
- >>> with FeatureFixture(feature_flag):
- ... admin_browser.open(
- ... "http://bugs.launchpad.dev/evolution/+bug/7/+secrecy")
- ... admin_browser.getControl("Private", index=1).selected = True
- ... admin_browser.getControl('Change').click()
- ... admin_browser.open("http://bugs.launchpad.dev/evolution/+bug/7")
- ... print_comments(admin_browser.contents)
+ >>> admin_browser.open(
+ >>> "http://bugs.launchpad.dev/evolution/+bug/7/+secrecy")
+ >>> admin_browser.getControl("Private", index=1).selected = True
+ >>> admin_browser.getControl('Change').click()
+ >>> admin_browser.open("http://bugs.launchpad.dev/evolution/+bug/7")
+ >>> print_comments(admin_browser.contents)
Foo Bar (name16)
... ago
information type:
Public => Private
--------
- >>> with FeatureFixture(feature_flag):
- ... admin_browser.open(
- ... "http://bugs.launchpad.dev/jokosher/+bug/14/+secrecy")
- ... admin_browser.getControl("Private", index=1).selected = True
- ... admin_browser.getControl('Change').click()
- ... admin_browser.open("http://bugs.launchpad.dev/jokosher/+bug/14")
- ... print_comments(admin_browser.contents)
+ >>> admin_browser.open(
+ >>> "http://bugs.launchpad.dev/jokosher/+bug/14/+secrecy")
+ >>> admin_browser.getControl("Private", index=1).selected = True
+ >>> admin_browser.getControl('Change').click()
+ >>> admin_browser.open("http://bugs.launchpad.dev/jokosher/+bug/14")
+ >>> print_comments(admin_browser.contents)
Foo Bar (name16)
... ago
information type:
=== modified file 'lib/lp/bugs/subscribers/bug.py'
--- lib/lp/bugs/subscribers/bug.py 2012-09-20 04:49:19 +0000
+++ lib/lp/bugs/subscribers/bug.py 2012-10-12 03:23:19 +0000
@@ -30,7 +30,6 @@
from lp.registry.interfaces.person import IPerson
from lp.services.config import config
from lp.services.database.sqlbase import block_implicit_flushes
-from lp.services.features import getFeatureFlag
from lp.services.mail.helpers import get_contact_email_addresses
from lp.services.mail.sendmail import (
format_address,
@@ -110,12 +109,8 @@
IBugDelta if there are changes, or None if there were no changes.
"""
changes = {}
- fields = ["title", "description", "name"]
- if bool(getFeatureFlag(
- 'disclosure.information_type_notifications.enabled')):
- fields.append('information_type')
- else:
- fields.extend(('private', 'security_related'))
+ fields = ["title", "description", "name", "information_type",
+ "duplicateof", "tags"]
fields.extend(("duplicateof", "tags"))
for field_name in fields:
# fields for which we show old => new when their values change
=== modified file 'lib/lp/bugs/tests/test_bugchanges.py'
--- lib/lp/bugs/tests/test_bugchanges.py 2012-09-18 18:36:09 +0000
+++ lib/lp/bugs/tests/test_bugchanges.py 2012-10-12 03:23:19 +0000
@@ -25,7 +25,6 @@
from lp.bugs.interfaces.cve import ICveSet
from lp.bugs.model.bugnotification import BugNotification
from lp.bugs.scripts.bugnotification import construct_email_notifications
-from lp.services.features.testing import FeatureFixture
from lp.services.librarian.browser import ProxiedLibraryFileAlias
from lp.services.webapp.interfaces import ILaunchBag
from lp.services.webapp.publisher import canonical_url
@@ -47,8 +46,7 @@
super(TestBugChanges, self).setUp('foo.bar@xxxxxxxxxxxxx')
self.admin_user = getUtility(ILaunchBag).user
self.user = self.factory.makePerson(
- displayname='Arthur Dent',
- selfgenerated_bugnotifications=True)
+ displayname='Arthur Dent', selfgenerated_bugnotifications=True)
self.product = self.factory.makeProduct(
owner=self.user, official_malone=True)
self.bug = self.factory.makeBug(target=self.product, owner=self.user)
@@ -57,11 +55,9 @@
# Add some structural subscribers to show that notifications
# aren't sent to LIFECYCLE subscribers by default.
self.product_lifecycle_subscriber = self.newSubscriber(
- self.product, "product-lifecycle",
- BugNotificationLevel.LIFECYCLE)
+ self.product, "product-lifecycle", BugNotificationLevel.LIFECYCLE)
self.product_metadata_subscriber = self.newSubscriber(
- self.product, "product-metadata",
- BugNotificationLevel.METADATA)
+ self.product, "product-metadata", BugNotificationLevel.METADATA)
self.saveOldChanges()
@@ -226,8 +222,7 @@
self.assertEqual(activity.target, None)
unsubscribe_activity = dict(
- whatchanged='removed subscriber Arthur Dent',
- person=self.user)
+ whatchanged='removed subscriber Arthur Dent', person=self.user)
self.assertRecordedChange(expected_activity=unsubscribe_activity)
def test_unsubscribe_private_bug(self):
@@ -242,8 +237,7 @@
self.saveOldChanges(bug=bug)
bug.unsubscribe(subscriber, subscriber)
unsubscribe_activity = dict(
- whatchanged=u'removed subscriber Mom',
- person=subscriber)
+ whatchanged=u'removed subscriber Mom', person=subscriber)
self.assertRecordedChange(
expected_activity=unsubscribe_activity, bug=bug)
@@ -562,77 +556,17 @@
self.bug.unlinkBranch(branch, self.user)
self.assertRecordedChange()
- def test_make_private(self):
- # Marking a bug as private adds items to the bug's activity log
- # and notifications.
- bug_before_modification = Snapshot(
- self.bug, providing=providedBy(self.bug))
- self.bug.setPrivate(True, self.user)
- notify(ObjectModifiedEvent(
- self.bug, bug_before_modification, ['private'], user=self.user))
-
- visibility_change_activity = {
- 'person': self.user,
- 'whatchanged': 'visibility',
- 'oldvalue': 'public',
- 'newvalue': 'private',
- }
-
- visibility_change_notification = {
- 'text': '** Visibility changed to: Private',
- 'person': self.user,
- }
-
- self.assertRecordedChange(
- expected_activity=visibility_change_activity,
- expected_notification=visibility_change_notification)
-
- def test_make_public(self):
- # Marking a bug as public adds items to the bug's activity log
- # and notifications.
- private_bug = self.factory.makeBug(
- information_type=InformationType.USERDATA)
- self.saveOldChanges(private_bug)
- self.assertTrue(private_bug.private)
- bug_before_modification = Snapshot(
- private_bug, providing=providedBy(private_bug))
- private_bug.transitionToInformationType(
- InformationType.PUBLIC, self.user)
- notify(ObjectModifiedEvent(
- private_bug, bug_before_modification, ['private'],
- user=self.user))
-
- visibility_change_activity = {
- 'person': self.user,
- 'whatchanged': 'visibility',
- 'oldvalue': 'private',
- 'newvalue': 'public',
- }
-
- visibility_change_notification = {
- 'text': '** Visibility changed to: Public',
- 'person': self.user,
- }
-
- self.assertRecordedChange(
- expected_activity=visibility_change_activity,
- expected_notification=visibility_change_notification,
- bug=private_bug)
-
def test_change_information_type(self):
# Changing the information type of a bug adds items to the activity
# log and notifications.
bug = self.factory.makeBug()
self.saveOldChanges(bug=bug)
- feature_flag = {
- 'disclosure.information_type_notifications.enabled': 'on'}
bug_before_modification = Snapshot(bug, providing=providedBy(bug))
- with FeatureFixture(feature_flag):
- bug.transitionToInformationType(
- InformationType.PRIVATESECURITY, self.user)
- notify(ObjectModifiedEvent(
- bug, bug_before_modification, ['information_type'],
- user=self.user))
+ bug.transitionToInformationType(
+ InformationType.PRIVATESECURITY, self.user)
+ notify(ObjectModifiedEvent(
+ bug, bug_before_modification, ['information_type'],
+ user=self.user))
information_type_change_activity = {
'person': self.user,
@@ -656,13 +590,9 @@
person = self.factory.makePerson()
bug = self.factory.makeBug(owner=person)
self.saveOldChanges(bug=bug)
- feature_flag = {
- 'disclosure.information_type_notifications.enabled': 'on'}
webservice = launchpadlib_for('test', person)
lp_bug = webservice.load(api_url(bug))
- with FeatureFixture(feature_flag):
- lp_bug.transitionToInformationType(
- information_type='Private Security')
+ lp_bug.transitionToInformationType(information_type='Private Security')
information_type_change_activity = {
'person': person,
@@ -800,7 +730,7 @@
# This checks the activity's attribute and target attributes.
activity = self.bug.activity[-1]
self.assertEqual(activity.attribute, 'attachments')
- self.assertEqual(activity.target, None)
+ self.assertIsNone(activity.target)
attachment_added_activity = {
'person': self.user,
@@ -1686,8 +1616,7 @@
self.assertRecordedChange(
expected_activity=expected_activity,
- expected_notification=expected_notification,
- bug=duplicate_bug)
+ expected_notification=expected_notification, bug=duplicate_bug)
def test_convert_to_question_no_comment(self):
# When a bug task is converted to a question, its status is
@@ -1754,8 +1683,7 @@
self.assertRecordedChange(
expected_activity=expected_activity,
- expected_notification=expected_notification,
- bug=new_bug)
+ expected_notification=expected_notification, bug=new_bug)
def test_description_changed_no_self_email(self):
# Users who have selfgenerated_bugnotifications set to False
@@ -1805,9 +1733,9 @@
# If a person has a structural METADATA subscription,
# and a direct LIFECYCLE subscription, they should
# get no emails for a non-LIFECYCLE change (bug 713382).
- self.bug.subscribe(self.product_metadata_subscriber,
- self.product_metadata_subscriber,
- level=BugNotificationLevel.LIFECYCLE)
+ self.bug.subscribe(
+ self.product_metadata_subscriber, self.product_metadata_subscriber,
+ level=BugNotificationLevel.LIFECYCLE)
self.changeAttribute(
self.bug, 'description', 'New description')
=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py 2012-10-04 23:15:35 +0000
+++ lib/lp/services/features/flags.py 2012-10-12 03:23:19 +0000
@@ -220,13 +220,6 @@
'',
'',
''),
- ('disclosure.information_type_notifications.enabled',
- 'boolean',
- ('If true, calculate and store bugchange notifications to reference '
- 'information_type rather than private/security_related.'),
- '',
- '',
- ''),
('auditor.enabled',
'boolean',
'If true, send audit data to an auditor instance.',
Follow ups