← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/information_type-notification-flag into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/information_type-notification-flag into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #933766 in Launchpad itself: "Update bug to use information_visibility_policy"
  https://bugs.launchpad.net/launchpad/+bug/933766

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/information_type-notification-flag/+merge/105014

In order to make it safer and possible to switch to showing information_type in the UI for a portion of our users, switch the notifications code to using a separate feature flag.
-- 
https://code.launchpad.net/~stevenk/launchpad/information_type-notification-flag/+merge/105014
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/information_type-notification-flag into lp:launchpad.
=== modified file 'lib/lp/bugs/adapters/bugchange.py'
--- lib/lp/bugs/adapters/bugchange.py	2012-04-30 01:57:48 +0000
+++ lib/lp/bugs/adapters/bugchange.py	2012-05-08 01:12:19 +0000
@@ -108,7 +108,7 @@
     # log and in notification emails.
     bug_change_field_names = ['duplicateof', 'title', 'description']
     if bool(getFeatureFlag(
-        'disclosure.show_information_type_in_ui.enabled')):
+        'disclosure.information_type_notifications.enabled')):
         bug_change_field_names.append('information_type')
     else:
         bug_change_field_names.extend(('private', 'security_related'))
@@ -573,7 +573,7 @@
                 self.title(self.old_value), self.title(self.new_value))}
 
 
-# XXX: This can be deleted when show_information_type_in_ui is removed.
+# XXX: This can be deleted when information_type_notifications is removed.
 class BugVisibilityChange(AttributeChange):
     """Describes a change to a bug's visibility."""
 
@@ -605,7 +605,7 @@
         return {'text': "** Visibility changed to: %s" % visibility_string}
 
 
-# XXX: This can be deleted when show_information_type_in_ui is removed.
+# XXX: This can be deleted when information_type_notifications is removed.
 class BugSecurityChange(AttributeChange):
     """Describes a change to a bug's security setting."""
 

=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt	2012-04-30 01:57:48 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt	2012-05-08 01:12:19 +0000
@@ -323,7 +323,7 @@
 
     >>> from lp.services.features.testing import FeatureFixture
     >>> feature_flag = {
-    ...     'disclosure.show_information_type_in_ui.enabled': 'on'}
+    ...     'disclosure.information_type_notifications.enabled': 'on'}
     >>> with FeatureFixture(feature_flag):
     ...     admin_browser.open(
     ...         "http://bugs.launchpad.dev/jokosher/+bug/14/+secrecy";)

=== modified file 'lib/lp/bugs/subscribers/bug.py'
--- lib/lp/bugs/subscribers/bug.py	2012-04-27 05:56:48 +0000
+++ lib/lp/bugs/subscribers/bug.py	2012-05-08 01:12:19 +0000
@@ -118,7 +118,7 @@
     changes = {}
     fields = ["title", "description", "name"]
     if bool(getFeatureFlag(
-        'disclosure.show_information_type_in_ui.enabled')):
+        'disclosure.information_type_notifications.enabled')):
         fields.append('information_type')
     else:
         fields.extend(('private', 'security_related'))

=== modified file 'lib/lp/bugs/tests/test_bugchanges.py'
--- lib/lp/bugs/tests/test_bugchanges.py	2012-05-03 01:14:29 +0000
+++ lib/lp/bugs/tests/test_bugchanges.py	2012-05-08 01:12:19 +0000
@@ -624,7 +624,7 @@
         bug = self.factory.makeBug()
         self.saveOldChanges(bug=bug)
         feature_flag = {
-            'disclosure.show_information_type_in_ui.enabled': 'on'}
+            'disclosure.information_type_notifications.enabled': 'on'}
         bug_before_modification = Snapshot(bug, providing=providedBy(bug))
         with FeatureFixture(feature_flag):
             bug.transitionToInformationType(
@@ -656,7 +656,7 @@
         bug = self.factory.makeBug()
         self.saveOldChanges(bug=bug)
         feature_flags = {
-            'disclosure.show_information_type_in_ui.enabled': 'on',
+            'disclosure.information_type_notifications.enabled': 'on',
             'disclosure.display_userdata_as_private.enabled': 'on'}
         bug_before_modification = Snapshot(bug, providing=providedBy(bug))
         with FeatureFixture(feature_flags):
@@ -688,7 +688,7 @@
         bug = self.factory.makeBug(owner=person)
         self.saveOldChanges(bug=bug)
         feature_flag = {
-            'disclosure.show_information_type_in_ui.enabled': 'on'}
+            'disclosure.information_type_notifications.enabled': 'on'}
         webservice = launchpadlib_for('test', person)
         lp_bug = webservice.load(api_url(bug))
         with FeatureFixture(feature_flag):

=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py	2012-05-07 07:38:01 +0000
+++ lib/lp/services/features/flags.py	2012-05-08 01:12:19 +0000
@@ -320,6 +320,13 @@
      '',
      '',
      ''),
+    ('disclosure.information_type_notifications.enabled',
+     'boolean',
+     ('If true, calculates and stores bugchange notifications to reference '
+      'information_type rather than private/security_related.'),
+     '',
+     '',
+     ''),
     ])
 
 # The set of all flag names that are documented.


Follow ups