launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #09190
[Merge] lp:~stevenk/launchpad/destroy-old-privacy-ui into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/destroy-old-privacy-ui 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
Bug #933768 in Launchpad itself: "Update branch to use information_visibility_policy"
https://bugs.launchpad.net/launchpad/+bug/933768
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/destroy-old-privacy-ui/+merge/112002
Remove the old privacy UI from the code, and fix up/delete a bunch of tests. To be frank, I'm not sure if I've hit everything, but there is a bunch marked for the chopping block (BugVisibilityChange and BugSecurityChange prime among those.)
--
https://code.launchpad.net/~stevenk/launchpad/destroy-old-privacy-ui/+merge/112002
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/destroy-old-privacy-ui into lp:launchpad.
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2012-06-22 06:12:53 +0000
+++ database/sampledata/current-dev.sql 2012-06-26 04:38:24 +0000
@@ -4301,7 +4301,6 @@
INSERT INTO featureflag (scope, priority, flag, value, date_modified) VALUES ('default', 0, 'disclosure.enhanced_sharing.writable', 'true', '2012-05-18 07:34:39.239649');
INSERT INTO featureflag (scope, priority, flag, value, date_modified) VALUES ('default', 0, 'disclosure.enhanced_sharing_details.enabled', 'true', '2012-05-18 07:34:39.239649');
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, 'disclosure.show_information_type_in_ui.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 'lib/lp/app/browser/informationtype.py'
--- lib/lp/app/browser/informationtype.py 2012-06-07 15:22:52 +0000
+++ lib/lp/app/browser/informationtype.py 2012-06-26 04:38:24 +0000
@@ -27,16 +27,10 @@
for term in InformationTypeVocabulary()]
cache.objects['private_types'] = [
type.title for type in PRIVATE_INFORMATION_TYPES]
- cache.objects['show_information_type_in_ui'] = (
- self.show_information_type_in_ui)
cache.objects['show_userdata_as_private'] = (
self.show_userdata_as_private)
@property
- def show_information_type_in_ui(self):
- raise NotImplementedError()
-
- @property
def show_userdata_as_private(self):
return bool(getFeatureFlag(
'disclosure.display_userdata_as_private.enabled'))
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2012-05-30 05:04:40 +0000
+++ lib/lp/bugs/browser/bug.py 2012-06-26 04:38:24 +0000
@@ -35,13 +35,8 @@
)
from lazr.lifecycle.event import ObjectModifiedEvent
from lazr.lifecycle.snapshot import Snapshot
-from lazr.restful import (
- EntryResource,
- ResourceJSONEncoder,
- )
from lazr.restful.interface import copy_field
from lazr.restful.interfaces import IJSONRequestCache
-from simplejson import dumps
from zope import formlib
from zope.app.form.browser import TextWidget
from zope.component import getUtility
@@ -65,8 +60,6 @@
from lp.app.errors import NotFoundError
from lp.app.widgets.itemswidgets import LaunchpadRadioWidgetWithDescription
from lp.app.widgets.project import ProjectScopeWidget
-from lp.bugs.adapters.bug import convert_to_information_type
-from lp.bugs.browser.bugsubscription import BugPortletSubscribersWithDetails
from lp.bugs.browser.widgets.bug import BugTagsWidget
from lp.bugs.enums import BugNotificationLevel
from lp.bugs.interfaces.bug import (
@@ -81,7 +74,6 @@
from lp.bugs.interfaces.bugtask import (
BugTaskSearchParams,
BugTaskStatus,
- IBugTask,
IFrontPageBugTaskSearch,
)
from lp.bugs.interfaces.bugwatch import IBugWatchSet
@@ -91,12 +83,8 @@
from lp.bugs.model.structuralsubscription import (
get_structural_subscriptions_for_bug,
)
-from lp.registry.enums import (
- InformationType,
- PRIVATE_INFORMATION_TYPES,
- )
+from lp.registry.enums import PRIVATE_INFORMATION_TYPES
from lp.registry.vocabularies import InformationTypeVocabulary
-from lp.services.features import getFeatureFlag
from lp.services.fields import DuplicateBug
from lp.services.librarian.browser import ProxiedLibraryFileAlias
from lp.services.mail.mailwrapper import MailWrapper
@@ -531,11 +519,6 @@
all the pages off IBugTask instead of IBug.
"""
- @property
- def show_information_type_in_ui(self):
- return bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled'))
-
@cachedproperty
def page_description(self):
return IBug(self.context).description
@@ -817,80 +800,41 @@
self.updateBugFromData(data)
-# XXX: This can move to using LaunchpadEditFormView when
-# show_information_type_in_ui is removed.
class BugSecrecyEditView(LaunchpadFormView, BugSubscriptionPortletDetails):
"""Form for marking a bug as a private/public."""
@property
def label(self):
- label = 'Bug #%i - Set ' % self.context.bug.id
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- label += 'information type'
- else:
- label += 'visibility and security'
- return label
+ return 'Bug #%i - Set information type' % self.context.bug.id
page_title = label
@property
def field_names(self):
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- return ['information_type']
- else:
- return ['private', 'security_related']
+ return ['information_type']
custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
@property
def schema(self):
"""Schema for editing the information type of a `IBug`."""
- class privacy_schema(Interface):
- private_field = copy_field(IBug['private'], readonly=False)
- security_related_field = copy_field(
- IBug['security_related'], readonly=False)
-
class information_type_schema(Interface):
information_type_field = copy_field(
IBug['information_type'], readonly=False,
vocabulary=InformationTypeVocabulary())
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- return information_type_schema
- else:
- return privacy_schema
-
- def setUpFields(self):
- """See `LaunchpadFormView`."""
- super(BugSecrecyEditView, self).setUpFields()
- if not bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- bug = self.context.bug
- if (bug.information_type == InformationType.PROPRIETARY
- and len(bug.affected_pillars) > 1):
- self.form_fields = self.form_fields.omit('private')
+ return information_type_schema
@property
def next_url(self):
"""Return the next URL to call when this call completes."""
- if not self.request.is_ajax:
- return canonical_url(self.context)
- return None
+ return canonical_url(self.context)
cancel_url = next_url
@property
def initial_values(self):
"""See `LaunchpadFormView.`"""
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- return {'information_type': self.context.bug.information_type}
- else:
- return {
- 'private': self.context.bug.private,
- 'security_related': self.context.bug.security_related}
+ return {'information_type': self.context.bug.information_type}
@action('Change', name='change')
def change_action(self, action, data):
@@ -898,20 +842,8 @@
data = dict(data)
bug = self.context.bug
bug_before_modification = Snapshot(bug, providing=providedBy(bug))
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- information_type = data.pop('information_type')
- changed_fields = ['information_type']
- else:
- changed_fields = []
- private = data.pop('private', bug.private)
- if bug.private != private:
- changed_fields.append('private')
- security_related = data.pop('security_related')
- if bug.security_related != security_related:
- changed_fields.append('security_related')
- information_type = convert_to_information_type(
- private, security_related)
+ information_type = data.pop('information_type')
+ changed_fields = ['information_type']
user_will_be_subscribed = (
information_type in PRIVATE_INFORMATION_TYPES and
bug.getSubscribersForPerson(self.user).is_empty())
@@ -923,33 +855,6 @@
ObjectModifiedEvent(
bug, bug_before_modification, changed_fields,
user=self.user))
- if self.request.is_ajax:
- if changed:
- return self._getSubscriptionDetails()
- else:
- return ''
-
- def _getSubscriptionDetails(self):
- cache = dict()
- # The subscription details for the current user.
- self.extractBugSubscriptionDetails(self.user, self.context.bug, cache)
-
- # The subscription details for other users to populate the subscribers
- # list in the portlet.
- if IBugTask.providedBy(self.context):
- bug = self.context.bug
- else:
- bug = self.context
- subscribers_portlet = BugPortletSubscribersWithDetails(
- bug, self.request)
- subscription_data = subscribers_portlet.subscriber_data
- result_data = dict(
- cache_data=cache,
- subscription_data=subscription_data)
- self.request.response.setHeader('content-type', 'application/json')
- return dumps(
- result_data, cls=ResourceJSONEncoder,
- media_type=EntryResource.JSON_TYPE)
def _handlePrivacyChanged(self, user_will_be_subscribed):
"""Handle the case where the privacy of the bug has been changed.
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2012-06-12 22:17:49 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2012-06-26 04:38:24 +0000
@@ -121,6 +121,7 @@
from lp.registry.enums import (
InformationType,
PRIVATE_INFORMATION_TYPES,
+ PUBLIC_INFORMATION_TYPES,
SECURITY_INFORMATION_TYPES,
)
from lp.registry.interfaces.distribution import IDistribution
@@ -257,17 +258,9 @@
schema = IBug
@property
- def show_information_type_in_ui(self):
- return bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled'))
-
- @property
def field_names(self):
"""Return the list of field names to display."""
- if self.show_information_type_in_ui:
- return ['information_type']
- else:
- return ['security_related']
+ return ['information_type']
custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
@@ -276,8 +269,6 @@
cache = IJSONRequestCache(self.request)
cache.objects['private_types'] = [
type.name for type in PRIVATE_INFORMATION_TYPES]
- cache.objects['show_information_type_in_ui'] = (
- self.show_information_type_in_ui)
cache.objects['show_userdata_as_private'] = bool(getFeatureFlag(
'disclosure.display_userdata_as_private.enabled'))
cache.objects['bug_private_by_default'] = (
@@ -307,30 +298,20 @@
"""Set up the form fields. See `LaunchpadFormView`."""
super(FileBugReportingGuidelines, self).setUpFields()
- if self.show_information_type_in_ui:
- information_type_field = copy_field(
- IBug['information_type'], readonly=False,
- vocabulary=InformationTypeVocabulary(self.context))
- self.form_fields = self.form_fields.omit('information_type')
- self.form_fields += Fields(information_type_field)
- else:
- security_related_field = copy_field(
- IBug['security_related'], readonly=False)
- self.form_fields = self.form_fields.omit('security_related')
- self.form_fields += Fields(security_related_field)
+ information_type_field = copy_field(
+ IBug['information_type'], readonly=False,
+ vocabulary=InformationTypeVocabulary(self.context))
+ self.form_fields = self.form_fields.omit('information_type')
+ self.form_fields += Fields(information_type_field)
@property
def initial_values(self):
"""See `LaunchpadFormView`."""
- if self.show_information_type_in_ui:
- value = InformationType.PUBLIC
- if (
- self.context and IProduct.providedBy(self.context) and
- self.context.private_bugs):
- value = InformationType.USERDATA
- return {'information_type': value}
- else:
- return {}
+ value = InformationType.PUBLIC
+ if (self.context and IProduct.providedBy(self.context) and
+ self.context.private_bugs):
+ value = InformationType.USERDATA
+ return {'information_type': value}
@property
def bug_reporting_guidelines(self):
@@ -454,15 +435,9 @@
def field_names(self):
"""Return the list of field names to display."""
context = self.context
- field_names = ['title', 'comment', 'tags']
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- field_names.append('information_type')
- else:
- field_names.append('security_related')
- field_names.extend([
+ field_names = ['title', 'comment', 'tags', 'information_type',
'bug_already_reported_as', 'filecontent', 'patch',
- 'attachment_description', 'subscribe_to_existing_bug'])
+ 'attachment_description', 'subscribe_to_existing_bug']
if (IDistribution.providedBy(context) or
IDistributionSourcePackage.providedBy(context)):
field_names.append('packagename')
@@ -635,12 +610,8 @@
title = data["title"]
comment = data["comment"].rstrip()
packagename = data.get("packagename")
- if bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- information_type = data.get(
- "information_type", InformationType.PUBLIC)
- else:
- security_related = data.get("security_related", False)
+ information_type = data.get(
+ "information_type", InformationType.PUBLIC)
distribution = data.get(
"distribution", getUtility(ILaunchBag).distribution)
@@ -659,15 +630,6 @@
if self.request.form.get("packagename_option") == "none":
packagename = None
- if not bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')):
- # If the old UI is enabled, security bugs are always embargoed
- # when filed, but can be disclosed after they've been reported.
- if security_related:
- information_type = InformationType.EMBARGOEDSECURITY
- else:
- information_type = InformationType.PUBLIC
-
linkified_ack = structured(FormattersAPI(
self.getAcknowledgementMessage(self.context)).text_to_html(
last_paragraph_class="last"))
@@ -703,10 +665,8 @@
notifications.append(
'Additional information was added to the bug description.')
- if (not bool(getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')) and
- extra_data.private):
- if params.information_type == InformationType.PUBLIC:
+ if extra_data.private:
+ if params.information_type in PUBLIC_INFORMATION_TYPES:
params.information_type = InformationType.USERDATA
# Apply any extra options given by privileged users.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2012-06-03 23:11:40 +0000
+++ lib/lp/bugs/browser/bugtask.py 2012-06-26 04:38:24 +0000
@@ -706,13 +706,9 @@
def information_type(self):
use_private_flag = getFeatureFlag(
'disclosure.display_userdata_as_private.enabled')
- info_type_enabled_flag = getFeatureFlag(
- 'disclosure.show_information_type_in_ui.enabled')
- value = None
- if info_type_enabled_flag:
- value = self.context.bug.information_type.title
- if (use_private_flag and value == InformationType.USERDATA.title):
- value = "Private"
+ value = self.context.bug.information_type.title
+ if (use_private_flag and value == InformationType.USERDATA.title):
+ value = "Private"
return value
def initialize(self):
=== modified file 'lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt'
--- lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt 2012-04-10 14:01:17 +0000
+++ lib/lp/bugs/browser/tests/bugtarget-filebug-views.txt 2012-06-26 04:38:24 +0000
@@ -384,11 +384,8 @@
<BLANKLINE>
This bug should be private.
- >>> filebug_view.added_bug.private
- True
-
- >>> filebug_view.added_bug.security_related
- False
+ >>> filebug_view.added_bug.information_type
+ <DBItem InformationType.USERDATA, (4) User Data>
Since the bug was marked private before it was filed, only the bug
reporter has been subscribed to the bug and there should be no indirect
@@ -688,9 +685,10 @@
The base class allows security bugs to be filed.
+ >>> from lp.registry.enums import InformationType
>>> bug_data = dict(
... title=u'Security bug', comment=u'Test description.',
- ... security_related=True)
+ ... information_type=InformationType.EMBARGOEDSECURITY)
>>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
>>> filebug_view.validate(bug_data) is None
=== modified file 'lib/lp/bugs/browser/tests/test_bug_views.py'
--- lib/lp/bugs/browser/tests/test_bug_views.py 2012-04-30 01:57:48 +0000
+++ lib/lp/bugs/browser/tests/test_bug_views.py 2012-06-26 04:38:24 +0000
@@ -6,7 +6,6 @@
__metaclass__ = type
from BeautifulSoup import BeautifulSoup
-import simplejson
from soupmatchers import (
HTMLContains,
Tag,
@@ -297,8 +296,7 @@
layer = DatabaseFunctionalLayer
- def createInitializedSecrecyView(self, person=None, bug=None,
- request=None, security_related=False):
+ def createInitializedSecrecyView(self, person=None, bug=None):
"""Create and return an initialized BugSecrecyView."""
if person is None:
person = self.factory.makePerson()
@@ -307,12 +305,9 @@
with person_logged_in(person):
view = create_initialized_view(
bug.default_bugtask, name='+secrecy', form={
- 'field.private': 'on',
- 'field.security_related':
- 'on' if security_related else 'off',
+ 'field.information_type': 'USERDATA',
'field.actions.change': 'Change',
- },
- request=request)
+ })
return view
def test_notification_shown_if_marking_private_and_not_subscribed(self):
@@ -351,66 +346,15 @@
view = self.createInitializedSecrecyView(person, bug)
self.assertContentEqual([], view.request.response.notifications)
- def test_secrecy_view_ajax_render(self):
- # When the bug secrecy view is called from an ajax request, it should
- # provide a json encoded dict when rendered. The dict contains bug
- # subscription information resulting from the update to the bug
- # privacy as well as information used to populate the updated
- # subscribers list.
- person = self.factory.makePerson()
- bug = self.factory.makeBug(owner=person)
- with person_logged_in(person):
- bug.subscribe(person, person)
-
- extra = {'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest'}
- request = LaunchpadTestRequest(
- method='POST', form={
- 'field.actions.change': 'Change',
- 'field.private': 'on',
- 'field.security_related': 'off'},
- **extra)
- view = self.createInitializedSecrecyView(person, bug, request)
- result_data = simplejson.loads(view.render())
-
- cache_data = result_data['cache_data']
- self.assertFalse(cache_data['other_subscription_notifications'])
- subscription_data = cache_data['subscription']
- self.assertEqual(
- 'http://launchpad.dev/api/devel/bugs/%s' % bug.id,
- subscription_data['bug_link'])
- self.assertEqual(
- 'http://launchpad.dev/api/devel/~%s' % person.name,
- subscription_data['person_link'])
- self.assertEqual(
- 'Discussion', subscription_data['bug_notification_level'])
-
- [subscriber_data] = result_data['subscription_data']
- subscriber = removeSecurityProxy(bug).default_bugtask.pillar.owner
- self.assertEqual(
- subscriber.name, subscriber_data['subscriber']['name'])
- self.assertEqual('Discussion', subscriber_data['subscription_level'])
-
- def test_set_security_related(self):
- # Test that the bug attribute 'security_related' can be updated
- # using the view.
- owner = self.factory.makePerson()
- bug = self.factory.makeBug(owner=owner)
- self.createInitializedSecrecyView(bug=bug, security_related=True)
- with person_logged_in(owner):
- self.assertTrue(bug.security_related)
-
def test_set_information_type(self):
# Test that the bug's information_type can be updated using the
# view with the feature flag on.
bug = self.factory.makeBug()
- feature_flag = {
- 'disclosure.show_information_type_in_ui.enabled': 'on'}
- with FeatureFixture(feature_flag):
- with person_logged_in(bug.owner):
- view = create_initialized_view(
- bug.default_bugtask, name='+secrecy', form={
- 'field.information_type': 'USERDATA',
- 'field.actions.change': 'Change'})
+ with person_logged_in(bug.owner):
+ view = create_initialized_view(
+ bug.default_bugtask, name='+secrecy', form={
+ 'field.information_type': 'USERDATA',
+ 'field.actions.change': 'Change'})
self.assertEqual([], view.errors)
self.assertEqual(InformationType.USERDATA, bug.information_type)
@@ -418,7 +362,6 @@
# Test that the view creates the vocabulary correctly.
bug = self.factory.makeBug()
feature_flags = {
- 'disclosure.show_information_type_in_ui.enabled': 'on',
'disclosure.proprietary_information_type.disabled': 'on',
'disclosure.display_userdata_as_private.enabled': 'on'}
with FeatureFixture(feature_flags):
=== modified file 'lib/lp/bugs/browser/tests/test_bugtarget_filebug.py'
--- lib/lp/bugs/browser/tests/test_bugtarget_filebug.py 2012-06-14 05:18:22 +0000
+++ lib/lp/bugs/browser/tests/test_bugtarget_filebug.py 2012-06-26 04:38:24 +0000
@@ -357,8 +357,6 @@
self.assertEqual(expected_guidelines, view.bug_reporting_guidelines)
def filebug_via_view(self, private_bugs=False, information_type=None):
- feature_flag = {
- 'disclosure.show_information_type_in_ui.enabled': 'on'}
form = {
'field.title': 'A bug',
'field.comment': 'A comment',
@@ -369,13 +367,12 @@
product = self.factory.makeProduct(official_malone=True)
if private_bugs:
removeSecurityProxy(product).private_bugs = True
- with FeatureFixture(feature_flag):
- with person_logged_in(product.owner):
- view = create_initialized_view(
- product, '+filebug', form=form, principal=product.owner)
- bug_url = view.request.response.getHeader('Location')
- bug_number = bug_url.split('/')[-1]
- return getUtility(IBugSet).getByNameOrID(bug_number)
+ with person_logged_in(product.owner):
+ view = create_initialized_view(
+ product, '+filebug', form=form, principal=product.owner)
+ bug_url = view.request.response.getHeader('Location')
+ bug_number = bug_url.split('/')[-1]
+ return getUtility(IBugSet).getByNameOrID(bug_number)
def test_filebug_default_information_type(self):
# If we don't specify the bug's information_type, it is PUBLIC for
@@ -399,7 +396,6 @@
# The vocabulary for information_type when filing a bug is created
# correctly when 'User Data' is to be replaced by 'Private'.
feature_flags = {
- 'disclosure.show_information_type_in_ui.enabled': 'on',
'disclosure.proprietary_information_type.disabled': 'on',
'disclosure.display_userdata_as_private.enabled': 'on'}
product = self.factory.makeProduct(official_malone=True)
@@ -416,31 +412,25 @@
def test_filebug_information_type_vocabulary(self):
# The vocabulary for information_type when filing a bug is created
# correctly.
- feature_flags = {
- 'disclosure.show_information_type_in_ui.enabled': 'on'}
product = self.factory.makeProduct(official_malone=True)
- with FeatureFixture(feature_flags):
- with person_logged_in(product.owner):
- view = create_initialized_view(
- product, '+filebug', principal=product.owner)
- html = view.render()
- soup = BeautifulSoup(html)
+ with person_logged_in(product.owner):
+ view = create_initialized_view(
+ product, '+filebug', principal=product.owner)
+ html = view.render()
+ soup = BeautifulSoup(html)
for info_type in InformationType:
self.assertIsNotNone(soup.find('label', text=info_type.title))
def test_filebug_information_type_vocabulary_private_projects(self):
# The vocabulary for information_type when filing a bug only has
# private info types for private bug projects.
- feature_flags = {
- 'disclosure.show_information_type_in_ui.enabled': 'on'}
product = self.factory.makeProduct(
official_malone=True, private_bugs=True)
- with FeatureFixture(feature_flags):
- with person_logged_in(product.owner):
- view = create_initialized_view(
- product, '+filebug', principal=product.owner)
- html = view.render()
- soup = BeautifulSoup(html)
+ with person_logged_in(product.owner):
+ view = create_initialized_view(
+ product, '+filebug', principal=product.owner)
+ html = view.render()
+ soup = BeautifulSoup(html)
for info_type in PRIVATE_INFORMATION_TYPES:
self.assertIsNotNone(soup.find('label', text=info_type.title))
for info_type in PUBLIC_INFORMATION_TYPES:
=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
--- lib/lp/bugs/browser/tests/test_bugtask.py 2012-06-20 18:35:49 +0000
+++ lib/lp/bugs/browser/tests/test_bugtask.py 2012-06-26 04:38:24 +0000
@@ -299,11 +299,9 @@
information_type=InformationType.USERDATA)
login_person(owner)
bugtask = self.factory.makeBugTask(bug=bug)
- features = {'disclosure.show_information_type_in_ui.enabled': True}
- with FeatureFixture(features):
- view = create_initialized_view(bugtask, name="+index")
- self.assertEqual('User Data', view.information_type)
- features['disclosure.display_userdata_as_private.enabled'] = True
+ view = create_initialized_view(bugtask, name="+index")
+ self.assertEqual('User Data', view.information_type)
+ features = {'disclosure.display_userdata_as_private.enabled': True}
with FeatureFixture(features):
view = create_initialized_view(bugtask, name="+index")
self.assertEqual('Private', view.information_type)
=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js 2012-06-16 13:12:41 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js 2012-06-26 04:38:24 +0000
@@ -110,51 +110,9 @@
privacy_link = Y.one('#privacy-link');
- if (privacy_link && LP.cache.show_information_type_in_ui) {
+ if (privacy_link) {
Y.lp.bugs.information_type_choice.setup_information_type_choice(
privacy_link, lp_client);
- } else if (privacy_link) {
- var privacy_link_url = privacy_link.getAttribute('href') +
- '/++form++';
- var privacy_div = Y.one('#privacy-text');
- var privacy_html = privacy_link.get('innerHTML') + ' ';
- privacy_div.set('innerHTML', privacy_html);
- var privacy_text = Y.one('#privacy-text');
- privacy_link = Y.Node.create(
- '<a id="privacy-link" class="sprite edit action-icon"' +
- ' title="[edit]">Edit</a>');
- privacy_link.set('href', privacy_link_url);
- privacy_text.appendChild(privacy_link);
- privacy_spinner = Y.Node.create(
- '<img src="/@@/spinner" style="display: none" />');
- privacy_text.appendChild(privacy_spinner);
-
-
- privacy_form_overlay = new Y.lazr.FormOverlay({
- headerContent: '<h2>Change privacy settings</h2>',
- form_submit_button: Y.Node.create(submit_button_html),
- form_cancel_button: Y.Node.create(cancel_button_html),
- centered: true,
- form_submit_callback: update_privacy_settings,
- visible: false
- });
- privacy_form_overlay.render('#privacy-form-container');
- privacy_form_overlay.loadFormContentAndRender(privacy_link_url);
- privacy_link.on('click', function(e) {
- if (privacy_form_overlay) {
- e.preventDefault();
- privacy_form_overlay.show();
- // XXX Abel Deuring 2009-04-23, bug 365462
- // Y.one('#field.private') returns null.
- // Seems that YUI does not like IDs containing a '.'
- var field_private
- = document.getElementById('field.private');
- if (field_private !== null) {
- field_private.focus();
- }
- }
- });
- privacy_link.addClass('js-action');
}
setup_add_attachment();
setup_link_branch_picker();
=== modified file 'lib/lp/bugs/javascript/filebug.js'
--- lib/lp/bugs/javascript/filebug.js 2012-06-12 22:17:49 +0000
+++ lib/lp/bugs/javascript/filebug.js 2012-06-26 04:38:24 +0000
@@ -28,11 +28,7 @@
if (Y.Lang.isValue(search_button )) {
search_button.set('value', 'Check again');
}
- if (LP.cache.show_information_type_in_ui) {
- setup_information_type();
- } else {
- setup_security_related();
- }
+ setup_information_type();
setupChoiceWidgets();
}
var filebug_privacy_text = "This report will be private. " +
@@ -86,21 +82,6 @@
'information_type', LP.cache.information_type_data, true);
};
-var setup_security_related = function() {
- var sec = Y.one('[id="field.security_related"]');
- if (!Y.Lang.isValue(sec)) {
- return;
- }
- var notification_text = "This report will be private " +
- "because it is a security " +
- "vulnerability. You can " +
- "disclose it later.";
- sec.on('change', function() {
- var checked = sec.get('checked');
- update_privacy_banner(checked, notification_text);
- });
-};
-
namespace.setup_filebug = setup_filebug;
}, "0.1", {"requires": [
=== modified file 'lib/lp/bugs/javascript/information_type_choice.js'
--- lib/lp/bugs/javascript/information_type_choice.js 2012-06-13 01:16:09 +0000
+++ lib/lp/bugs/javascript/information_type_choice.js 2012-06-26 04:38:24 +0000
@@ -73,17 +73,12 @@
};
namespace.get_information_type_banner_text = function(value) {
- var fallback_text = "The information on this page is private.";
var text_template = "This page contains {info_type} information.";
if (value === "User Data" && LP.cache.show_userdata_as_private) {
value = "Private";
}
- if (LP.cache.show_information_type_in_ui) {
- return Y.Lang.substitute(text_template, {'info_type': value});
- } else {
- return fallback_text;
- }
+ return Y.Lang.substitute(text_template, {'info_type': value});
};
namespace.information_type_save_success = function(widget, value) {
=== modified file 'lib/lp/bugs/javascript/tests/test_filebug.js'
--- lib/lp/bugs/javascript/tests/test_filebug.js 2012-06-15 01:13:39 +0000
+++ lib/lp/bugs/javascript/tests/test_filebug.js 2012-06-26 04:38:24 +0000
@@ -76,7 +76,6 @@
// Selecting a private info type using the legacy radio buttons
// turns on the privacy banner.
test_legacy_select_private_info_type: function () {
- window.LP.cache.show_information_type_in_ui = true;
Y.lp.bugs.filebug.setup_filebug(true);
var banner_hidden = Y.one('.yui3-privacybanner-hidden');
Y.Assert.isNotNull(banner_hidden);
@@ -92,7 +91,6 @@
// Selecting a public info type using the legacy radio buttons
// turns off the privacy banner.
test_legacy_select_public_info_type: function () {
- window.LP.cache.show_information_type_in_ui = true;
window.LP.cache.bug_private_by_default = true;
Y.lp.bugs.filebug.setup_filebug(true);
Y.one('[id=field.information_type.2]').simulate('click');
@@ -209,7 +207,6 @@
// Selecting a private info type using the popup choice widget
// turns on the privacy banner.
test_select_private_info_type: function () {
- window.LP.cache.show_information_type_in_ui = true;
Y.lp.bugs.filebug.setup_filebug(true);
var banner_hidden = Y.one('.yui3-privacybanner-hidden');
Y.Assert.isNotNull(banner_hidden);
@@ -227,7 +224,6 @@
},
test_select_private_info_type_with_private_flag: function () {
- window.LP.cache.show_information_type_in_ui = true;
window.LP.cache.show_userdata_as_private = true;
Y.lp.bugs.filebug.setup_filebug(true);
var banner_hidden = Y.one('.yui3-privacybanner-hidden');
@@ -247,7 +243,6 @@
// Selecting a public info type using the popup choice widget
// turns off the privacy banner.
test_select_public_info_type: function () {
- window.LP.cache.show_information_type_in_ui = true;
window.LP.cache.bug_private_by_default = true;
Y.lp.bugs.filebug.setup_filebug(true);
var information_type_popup = Y.one('#information_type-content a');
=== modified file 'lib/lp/bugs/javascript/tests/test_information_type_choice.js'
--- lib/lp/bugs/javascript/tests/test_information_type_choice.js 2012-06-13 01:16:09 +0000
+++ lib/lp/bugs/javascript/tests/test_information_type_choice.js 2012-06-26 04:38:24 +0000
@@ -22,7 +22,6 @@
information_type: 'Public',
self_link: '/bug/1'
},
- show_information_type_in_ui: true,
private_types: ['Private', 'User Data'],
information_types: [
{'value': 'Public', 'name': 'Public',
=== modified file 'lib/lp/bugs/stories/bug-also-affects/xx-also-affects-upstream-private-bug.txt'
--- lib/lp/bugs/stories/bug-also-affects/xx-also-affects-upstream-private-bug.txt 2012-04-04 05:46:26 +0000
+++ lib/lp/bugs/stories/bug-also-affects/xx-also-affects-upstream-private-bug.txt 2012-06-26 04:38:24 +0000
@@ -12,8 +12,7 @@
>>> admin_browser.open(
... 'http://bugs.launchpad.dev/jokosher/+bug/12/+secrecy')
- >>> admin_browser.getControl(
- ... 'This bug report should be private').selected = True
+ >>> admin_browser.getControl('User Data').selected = True
>>> admin_browser.getControl('Change').click()
>>> admin_browser.open(
@@ -22,10 +21,6 @@
>>> admin_browser.getControl('Project:').value = 'firefox'
>>> admin_browser.getControl('Continue').click()
- >>> print admin_browser.contents
- <!DOCTYPE...
- ...This is a private bug...Foo Bar...won’t be notified...
-
>>> admin_browser.getLink('additional contacts').click()
>>> 'Page not found' not in admin_browser.contents
True
=== modified file 'lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.txt'
--- lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.txt 2012-04-19 20:57:17 +0000
+++ lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.txt 2012-06-26 04:38:24 +0000
@@ -8,11 +8,7 @@
Foo Bar is not Cc'd on this bug, but is able to set the bug private
anyway, because he is an admin.
- >>> browser.open(
- ... "http://bugs.launchpad.dev/debian/+source/mozilla-firefox/"
- ... "+bug/2/+secrecy")
- >>> browser.getControl("This bug report should be private").selected = (
- ... True)
+ >>> browser.getControl("User Data").selected = True
>>> browser.getControl("Change").click()
>>> print browser.url
http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/2
@@ -22,7 +18,7 @@
>>> browser.open(
... "http://bugs.launchpad.dev/debian/+source/mozilla-firefox/"
... "+bug/2/+secrecy")
- >>> browser.getControl("This bug report should be private").selected
+ >>> browser.getControl("User Data").selected
True
Foo Bar files a security (private) bug on Ubuntu Linux. He gets
@@ -38,16 +34,10 @@
... "a private bug")
>>> browser.getControl('Continue').click()
- >>> print browser.contents
- <!DOCTYPE...
- ...The maintainer of...Ubuntu...Ubuntu Team...will be notified...
- ...
-
>>> browser.getControl(name="packagename_option").value = ["choose"]
>>> browser.getControl(name="field.packagename").value = "evolution"
>>> browser.getControl(name="field.comment").value = "secret info"
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> bug_id = browser.url.split("/")[-1]
@@ -95,16 +85,10 @@
... "a private bug")
>>> browser.getControl('Continue').click()
- >>> print browser.contents
- <!DOCTYPE...
- ...The security contact for...Ubuntu...Sample Person...will be notified...
- ...
-
>>> browser.getControl(name="packagename_option").value = ["choose"]
>>> browser.getControl(name="field.packagename").value = "evolution"
>>> browser.getControl(name="field.comment").value = "secret info"
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> other_bug_id = browser.url.split("/")[-1]
=== modified file 'lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.txt'
--- lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.txt 2011-04-20 14:56:23 +0000
+++ lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.txt 2012-06-26 04:38:24 +0000
@@ -6,26 +6,25 @@
>>> browser = setupBrowser(auth="Basic foo.bar@xxxxxxxxxxxxx:test")
>>> browser.open("http://launchpad.dev/bugs/4")
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This report is public
+ This report contains Public information...
But when marked private, it gains the standard Launchpad presentation
for private things.
>>> browser.open("http://bugs.launchpad.dev/firefox/+bug/4/+secrecy")
- >>> browser.getControl(
- ... "This bug report should be private").selected = True
+ >>> browser.getControl("User Data").selected = True
>>> browser.getControl("Change").click()
>>> print browser.url
http://bugs.launchpad.dev/firefox/+bug/4
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This report is private
+ This report contains User Data information...
Bugs created before we started recording the date and time and who
marked the bug private show only a simple message:
>>> browser.open("http://launchpad.dev/bugs/14")
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This report is private...
+ This report contains Embargoed Security information...
But newer bugs that are filed private at creation time (like security
bugs or where the product requests that bugs are private by default)
@@ -37,14 +36,13 @@
>>> browser.getControl('Continue').click()
>>> browser.getControl("Further information").value = "foo"
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> print browser.url
http://bugs.launchpad.dev/firefox/+bug/...
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This report is private...
+ This report contains Embargoed Security information...
XXX 20080708 mpt: Bug 246671 again.
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-activity.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2012-05-08 06:02:05 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-activity.txt 2012-06-26 04:38:24 +0000
@@ -101,8 +101,7 @@
>>> admin_browser.open(
... 'http://bugs.launchpad.dev/redfish/+bug/15/+secrecy')
- >>> admin_browser.getControl(
- ... "This bug report should be private").selected = True
+ >>> admin_browser.getControl("User Data").selected = True
>>> admin_browser.getControl("Change").click()
>>> admin_browser.open('http://launchpad.dev/bugs/15')
@@ -116,12 +115,6 @@
public => private
--------
- >>> admin_browser.open(
- ... 'http://bugs.launchpad.dev/redfish/+bug/15/+secrecy')
- >>> admin_browser.getControl(
- ... "This bug report should be private").selected = False
- >>> admin_browser.getControl("Change").click()
-
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
@@ -129,8 +122,7 @@
>>> admin_browser.open(
... 'http://bugs.launchpad.dev/redfish/+bug/15/+secrecy')
- >>> admin_browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> admin_browser.getControl("Embargoed Security").selected = True
>>> admin_browser.getControl("Change").click()
>>> admin_browser.open('http://launchpad.dev/bugs/15')
@@ -322,13 +314,12 @@
Changes to information_type are shown when the feature flag is set.
>>> from lp.services.features.testing import FeatureFixture
- >>> feature_flags = {
+ >>> feature_flag = {
... 'disclosure.information_type_notifications.enabled': 'on'}
- >>> with FeatureFixture(feature_flags):
+ >>> with FeatureFixture(feature_flag):
... admin_browser.open(
... "http://bugs.launchpad.dev/evolution/+bug/7/+secrecy")
- ... admin_browser.getControl(
- ... "This bug report should be private").selected = True
+ ... admin_browser.getControl("User Data").selected = True
... admin_browser.getControl('Change').click()
... admin_browser.open("http://bugs.launchpad.dev/evolution/+bug/7")
... print_comments(admin_browser.contents)
@@ -338,11 +329,7 @@
Public => User Data
--------
- >>> from lp.services.features.testing import FeatureFixture
- >>> feature_flags = {
- ... 'disclosure.show_information_type_in_ui.enabled': 'on',
- ... 'disclosure.information_type_notifications.enabled': 'on'}
- >>> with FeatureFixture(feature_flags):
+ >>> with FeatureFixture(feature_flag):
... admin_browser.open(
... "http://bugs.launchpad.dev/jokosher/+bug/14/+secrecy")
... admin_browser.getControl("User Data").selected = True
=== modified file 'lib/lp/bugs/stories/bugs/xx-duplicate-of-private-bug.txt'
--- lib/lp/bugs/stories/bugs/xx-duplicate-of-private-bug.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/bugs/stories/bugs/xx-duplicate-of-private-bug.txt 2012-06-26 04:38:24 +0000
@@ -9,8 +9,7 @@
>>> admin_browser.open(
... 'http://bugs.launchpad.dev/'
... 'debian/+source/mozilla-firefox/+bug/8/+secrecy')
- >>> admin_browser.getControl(
- ... 'This bug report should be private').selected = True
+ >>> admin_browser.getControl('User Data').selected = True
>>> admin_browser.getControl('Change').click()
>>> print admin_browser.url
http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/8
@@ -19,7 +18,7 @@
Bug #8 ...Printing doesn't work...
>>> print extract_text(find_tag_by_id(admin_browser.contents, 'privacy'))
- This report is private
+ This report contains User Data information...
Next we mark another bug as a duplicate of the private bug:
=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt'
--- lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt 2012-04-04 05:46:26 +0000
+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker-remote-bug.txt 2012-06-26 04:38:24 +0000
@@ -55,11 +55,8 @@
Mark bug 1 as private:
>>> browser.addHeader('Authorization', 'Basic test@xxxxxxxxxxxxx:test')
- >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/1')
- >>> browser.getLink('This report is public').click()
- >>> browser.url
- 'http://bugs.launchpad.dev/firefox/+bug/1/+secrecy'
- >>> browser.getControl('This bug report should be private').selected = True
+ >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+secrecy')
+ >>> browser.getControl('User Data').selected = True
>>> browser.getControl('Change').click()
>>> browser.url
'http://bugs.launchpad.dev/firefox/+bug/1'
@@ -103,11 +100,8 @@
Set the bug back to public:
- >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/1')
- >>> browser.getLink('This report is private').click()
- >>> browser.url
- 'http://bugs.launchpad.dev/firefox/+bug/1/+secrecy'
- >>> browser.getControl('This bug report should be private').selected = False
+ >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/1/+secrecy')
+ >>> browser.getControl('Public').selected = True
>>> browser.getControl('Change').click()
>>> browser.url
'http://bugs.launchpad.dev/firefox/+bug/1'
=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt'
--- lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2012-02-22 22:17:46 +0000
+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2012-06-26 04:38:24 +0000
@@ -606,10 +606,9 @@
details are displayed. For example, when a bug watch is associated with
a private bug:
- >>> admin_browser.open('http://launchpad.dev/bugs/3')
- >>> admin_browser.getLink('This report is public').click()
- >>> admin_browser.getControl(
- ... 'This bug report should be private').selected = True
+ >>> admin_browser.open(
+ ... 'http://launchpad.dev/debian/+source/mozilla-firefox/+bug/3/+secrecy')
+ >>> admin_browser.getControl('User Data').selected = True
>>> admin_browser.getControl('Change').click()
>>> anon_browser.open(
=== modified file 'lib/lp/bugs/stories/initial-bug-contacts/xx-initial-bug-contacts.txt'
--- lib/lp/bugs/stories/initial-bug-contacts/xx-initial-bug-contacts.txt 2012-01-06 11:08:30 +0000
+++ lib/lp/bugs/stories/initial-bug-contacts/xx-initial-bug-contacts.txt 2012-06-26 04:38:24 +0000
@@ -149,8 +149,7 @@
>>> browser.getControl('Continue').click()
>>> browser.getControl(name="field.comment").value = "a PRIVATE bug"
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> other_bug_id = browser.url.split("/")[-1]
@@ -223,8 +222,7 @@
>>> browser.getControl('Continue').click()
>>> browser.getControl(name="field.comment").value = "top sekrit"
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> other_bug_id = browser.url.split("/")[-1]
=== modified file 'lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt'
--- lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt 2011-12-24 15:18:32 +0000
+++ lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.txt 2012-06-26 04:38:24 +0000
@@ -7,18 +7,11 @@
... "this is a newly created private bug")
>>> browser.getControl("Continue").click()
- >>> print browser.contents
- <!DOCTYPE...
- ...The maintainer of...Mozilla Firefox...Sample Person...will be notified...
- ...
-
>>> browser.getControl(name="field.title").value = (
... "this is a newly created private bug")
>>> browser.getControl(name="field.comment").value = (
... "very secret info here")
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
-
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> bug_id = browser.url.split("/")[-1]
@@ -78,16 +71,9 @@
... "this is a newly created private bug")
>>> browser.getControl("Continue").click()
- >>> print browser.contents
- <!DOCTYPE...
- ...The security contact for...Mozilla Firefox...Mark Shuttleworth...will be notified...
- ...
-
>>> browser.getControl(name="field.comment").value = (
... "very secret info here")
- >>> browser.getControl(
- ... "This bug is a security vulnerability").selected = True
-
+ >>> browser.getControl("Embargoed Security").selected = True
>>> browser.getControl("Submit Bug Report").click()
>>> other_bug_id = browser.url.split("/")[-1]
=== modified file 'lib/lp/bugs/templates/bug-portlet-privacy.pt'
--- lib/lp/bugs/templates/bug-portlet-privacy.pt 2012-06-15 16:23:50 +0000
+++ lib/lp/bugs/templates/bug-portlet-privacy.pt 2012-06-26 04:38:24 +0000
@@ -9,7 +9,6 @@
tal:define="link context/menu:context/visibility"
>
<div id="privacy-text">
- <tal:information_type tal:condition="view/show_information_type_in_ui">
<span id="information-type-summary"
tal:attributes="class view/information_type_css;">This report
contains
@@ -20,26 +19,5 @@
>Edit</a>
<div id="information-type-description" style="padding-top: 5px"
tal:content="view/information_type_description"></div>
- </tal:information_type>
- <tal:privacy tal:condition="not:view/show_information_type_in_ui">
- <div tal:condition="not:context/private" id="privacy-text">
- <a class="sprite edit" id="privacy-link"
- tal:attributes="href link/path; title link/text"
- tal:condition="link/enabled">This report is public</a>
- <tal:unchangeable condition="not:link/enabled">
- This report is public
- </tal:unchangeable>
- </div>
- <div tal:condition="context/private" id="privacy-text">
- <a class="sprite edit" id="privacy-link"
- tal:attributes="href link/path; title link/text"
- tal:condition="link/enabled">This report is <strong>private</strong></a>
- <tal:unchangeable condition="not:link/enabled">
- This report is private
- </tal:unchangeable>
- </div>
- <div class="sprite security" id="security-message"
- tal:condition="context/security_related">Security vulnerability</div>
- </tal:privacy>
</div>
</div>
=== modified file 'lib/lp/bugs/templates/bugtarget-filebug-guidelines.pt'
--- lib/lp/bugs/templates/bugtarget-filebug-guidelines.pt 2012-04-19 06:24:16 +0000
+++ lib/lp/bugs/templates/bugtarget-filebug-guidelines.pt 2012-06-26 04:38:24 +0000
@@ -11,7 +11,6 @@
</tr>
<tr tal:define="security_context view/getMainContext">
- <tal:information_type tal:condition="view/show_information_type_in_ui">
<td colspan="2" width="100%"
tal:define="widget nocall: view/widgets/information_type|nothing"
tal:condition="widget">
@@ -20,44 +19,6 @@
</label>
<input tal:replace="structure widget" />
</td>
- </tal:information_type>
- <tal:security_related tal:condition="not: view/show_information_type_in_ui">
- <td colspan="2" width="100%"
- tal:define="widget nocall: view/widgets/security_related|nothing"
- tal:condition="widget">
- <table>
- <tbody>
- <tr>
- <td>
- <input type="checkbox" tal:replace="structure widget" />
- </td>
- <td>
- <label tal:attributes="for widget/name">
- This bug is a security vulnerability
- </label>
- <div tal:define="security_contact security_context/security_contact|nothing">
- <tal:security-contact tal:condition="security_contact">
- The security contact for
- <tal:security-context content="security_context/displayname" />,
- <a tal:replace="structure security_contact/fmt:link" />,
- will be notified.
- </tal:security-contact>
- <tal:maintainer condition="not:security_contact"
- define="maintainer security_context/owner">
- The maintainer of
- <tal:security-context content="security_context/displayname">
- Mozilla Firefox</tal:security-context>,
- <a tal:replace="structure maintainer/fmt:link">
- Sample Person</a>,
- will be notified.
- </tal:maintainer>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tal:security_related>
</tr>
</tbody></table></td></tr>
</tal:root>
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2012-06-01 05:25:56 +0000
+++ lib/lp/code/browser/branch.py 2012-06-26 04:38:24 +0000
@@ -132,7 +132,6 @@
from lp.services import searchbuilder
from lp.services.config import config
from lp.services.database.constants import UTC_NOW
-from lp.services.features import getFeatureFlag
from lp.services.feeds.browser import (
BranchFeedLink,
FeedsMixin,
@@ -444,11 +443,6 @@
label = page_title
- @property
- def show_information_type_in_ui(self):
- return bool(getFeatureFlag(
- 'disclosure.show_information_type_in_branch_ui.enabled'))
-
def initialize(self):
super(BranchView, self).initialize()
self.branch = self.context
@@ -745,8 +739,6 @@
information_type = copy_field(
IBranch['information_type'], readonly=False,
vocabulary=InformationTypeVocabulary())
- explicitly_private = copy_field(
- IBranch['explicitly_private'], readonly=False)
reviewer = copy_field(IBranch['reviewer'], required=True)
owner = copy_field(IBranch['owner'], readonly=False)
return BranchEditSchema
@@ -789,20 +781,6 @@
information_type = data.pop('information_type')
self.context.transitionToInformationType(
information_type, self.user)
- if 'explicitly_private' in data:
- private = data.pop('explicitly_private')
- if (private != self.context.private
- and self.context.private == self.context.explicitly_private):
- # We only want to show notifications if it actually changed.
- self.context.setPrivate(private, self.user)
- changed = True
- if private:
- self.request.response.addNotification(
- "The branch is now private, and only visible to the "
- "owner and to subscribers.")
- else:
- self.request.response.addNotification(
- "The branch is now publicly accessible.")
if 'reviewer' in data:
reviewer = data.pop('reviewer')
if reviewer != self.context.code_reviewer:
@@ -1039,18 +1017,10 @@
"""The main branch for editing the branch attributes."""
@property
- def show_information_type_in_ui(self):
- return bool(getFeatureFlag(
- 'disclosure.show_information_type_in_branch_ui.enabled'))
-
- @property
def field_names(self):
- fields = [
- 'owner', 'name', 'explicitly_private', 'url', 'description',
+ return [
+ 'owner', 'name', 'information_type', 'url', 'description',
'lifecycle_status']
- if self.show_information_type_in_ui:
- fields[2] = 'information_type'
- return fields
custom_widget('lifecycle_status', LaunchpadRadioWidgetWithDescription)
custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
@@ -1095,8 +1065,7 @@
user_has_special_branch_access(self.user))
if not show_private_field:
- self.form_fields = self.form_fields.omit(
- 'explicitly_private', 'information_type')
+ self.form_fields = self.form_fields.omit('information_type')
# If the user can administer branches, then they should be able to
# assign the ownership of the branch to any valid person or team.
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2012-06-08 06:01:50 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2012-06-26 04:38:24 +0000
@@ -908,15 +908,12 @@
# the feature flag is enabled.
person = self.factory.makePerson()
branch = self.factory.makeProductBranch(owner=person)
- feature_flag = {
- 'disclosure.show_information_type_in_branch_ui.enabled': 'on'}
admins = getUtility(ILaunchpadCelebrities).admin
admin = admins.teamowner
- with FeatureFixture(feature_flag):
- browser = self.getUserBrowser(
- canonical_url(branch) + '/+edit', user=admin)
- browser.getControl("Embargoed Security").click()
- browser.getControl("Change Branch").click()
+ browser = self.getUserBrowser(
+ canonical_url(branch) + '/+edit', user=admin)
+ browser.getControl("Embargoed Security").click()
+ browser.getControl("Change Branch").click()
with person_logged_in(person):
self.assertEqual(
InformationType.EMBARGOEDSECURITY, branch.information_type)
@@ -926,12 +923,11 @@
# has been correctly created.
person = self.factory.makePerson()
branch = self.factory.makeProductBranch(owner=person)
- feature_flags = {
- 'disclosure.show_information_type_in_branch_ui.enabled': 'on',
+ feature_flag = {
'disclosure.proprietary_information_type.disabled': 'on'}
admins = getUtility(ILaunchpadCelebrities).admin
admin = admins.teamowner
- with FeatureFixture(feature_flags):
+ with FeatureFixture(feature_flag):
browser = self.getUserBrowser(
canonical_url(branch) + '/+edit', user=admin)
self.assertRaises(LookupError, browser.getControl, "Proprietary")
@@ -978,17 +974,13 @@
layer = LaunchpadFunctionalLayer
def test_information_type_in_ui(self):
- # With the show_information_type_in_branch_ui feature flag on, the
- # privacy portlet shows the information_type.
+ # The privacy portlet shows the information_type.
owner = self.factory.makePerson()
branch = self.factory.makeBranch(
owner=owner, information_type=InformationType.USERDATA)
- feature_flag = {
- 'disclosure.show_information_type_in_branch_ui.enabled': 'on'}
- with FeatureFixture(feature_flag):
- with person_logged_in(owner):
- view = create_initialized_view(branch, '+portlet-privacy')
- soup = BeautifulSoup(view.render())
+ with person_logged_in(owner):
+ view = create_initialized_view(branch, '+portlet-privacy')
+ soup = BeautifulSoup(view.render())
information_type = soup.find('strong')
description = soup.find('div', id='information-type-description')
self.assertEqual('User Data', information_type.renderContents())
@@ -998,16 +990,14 @@
description.renderContents())
def test_information_type_in_ui_with_display_as_private(self):
- # With both show_information_type_in_branch_ui and
- # display_userdata_as_private, the information_type is shown with
- # User Data masked as Private.
+ # With display_userdata_as_private, the information_type is shown
+ # with User Data masked as Private.
owner = self.factory.makePerson()
branch = self.factory.makeBranch(
owner=owner, information_type=InformationType.USERDATA)
- feature_flags = {
- 'disclosure.show_information_type_in_branch_ui.enabled': 'on',
+ feature_flag = {
'disclosure.display_userdata_as_private.enabled': 'on'}
- with FeatureFixture(feature_flags):
+ with FeatureFixture(feature_flag):
with person_logged_in(owner):
view = create_initialized_view(branch, '+portlet-privacy')
soup = BeautifulSoup(view.render())
=== modified file 'lib/lp/code/stories/branches/xx-branch-edit-privacy.txt'
--- lib/lp/code/stories/branches/xx-branch-edit-privacy.txt 2012-05-25 01:48:31 +0000
+++ lib/lp/code/stories/branches/xx-branch-edit-privacy.txt 2012-06-26 04:38:24 +0000
@@ -39,13 +39,13 @@
>>> admin_browser.open('http://code.launchpad.dev/~eric/fooix/trunk')
>>> admin_browser.getLink('Change branch details').click()
- >>> admin_browser.getControl('Keep branch confidential').click()
+ >>> admin_browser.getControl('User Data').click()
>>> admin_browser.getControl('Change Branch').click()
The branch is now private, so it assumes the standard private presentation.
>>> print_tag_with_id(admin_browser.contents, 'privacy')
- This branch is private
+ This branch contains User Data information...
Private branches allowed
@@ -68,33 +68,23 @@
>>> browser = setupBrowser(auth='Basic test@xxxxxxxxxxxxx:test')
>>> browser.open('http://code.launchpad.dev/~name12/firefox/main')
>>> browser.getLink('Change branch details').click()
- >>> browser.getControl('Keep branch confidential').selected = True
+ >>> browser.getControl('User Data').selected = True
>>> browser.getControl('Change Branch').click()
-A notification is added to say the branch is now private.
-
- >>> print_feedback_messages(browser.contents)
- The branch is now private, and only visible to the owner and to subscribers.
-
Since the branch is now private, it will have the standard Launchpad
presentation for private things.
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This branch is private
+ This branch contains User Data information...
If Sample Person changes the branch from private back to public, the page
reverts to its normal presentation.
>>> browser.getLink('Change branch details').click()
- >>> browser.getControl('Keep branch confidential').selected = False
+ >>> browser.getControl('Public').selected = True
>>> browser.getControl('Change Branch').click()
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This branch is public
-
-A notification is added to say the branch is now public.
-
- >>> print_feedback_messages(browser.contents)
- The branch is now publicly accessible.
+ This branch contains Public information...
Private Only branches
@@ -113,19 +103,19 @@
Mark the public branch private.
>>> browser.getLink('Change branch details').click()
- >>> browser.getControl('Keep branch confidential').selected = True
+ >>> browser.getControl('User Data').selected = True
>>> browser.getControl('Change Branch').click()
The branch is now private, so it assumes the standard private presentation.
>>> print extract_text(find_tag_by_id(browser.contents, 'privacy'))
- This branch is private
+ This branch contains User Data information...
However when the user now looks to edit the branch details, there
is no option to mark the branch as public.
>>> browser.getLink('Change branch details').click()
- >>> browser.getControl('Keep branch confidential')
+ >>> browser.getControl('Public')
Traceback (most recent call last):
...
- LookupError: label 'Keep branch confidential'
+ LookupError: label 'Public'
=== modified file 'lib/lp/code/stories/branches/xx-branch-index.txt'
--- lib/lp/code/stories/branches/xx-branch-index.txt 2012-05-24 04:21:10 +0000
+++ lib/lp/code/stories/branches/xx-branch-index.txt 2012-06-26 04:38:24 +0000
@@ -407,7 +407,7 @@
>>> browser.open(url)
>>> content = find_tag_by_id(browser.contents, 'document')
>>> print extract_text(find_tag_by_id(content, 'privacy'))
- This branch is public
+ This branch contains Public information...
Navigation Context
..................
=== modified file 'lib/lp/code/stories/branches/xx-branch-listings.txt'
--- lib/lp/code/stories/branches/xx-branch-listings.txt 2011-06-27 15:14:46 +0000
+++ lib/lp/code/stories/branches/xx-branch-listings.txt 2012-06-26 04:38:24 +0000
@@ -229,9 +229,8 @@
If the bug is not visible to the user that is looking at the page, then the
badge is not shown.
- >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/4')
- >>> browser.getLink('This report is public').click()
- >>> browser.getControl('This bug report should be private').click()
+ >>> browser.open('http://bugs.launchpad.dev/firefox/+bug/4/+secrecy')
+ >>> browser.getControl('User Data').click()
>>> browser.getControl('Change').click()
Now the badge is still shown for Sample Person...
=== modified file 'lib/lp/code/stories/branches/xx-bug-branch-links.txt'
--- lib/lp/code/stories/branches/xx-bug-branch-links.txt 2011-11-28 00:35:15 +0000
+++ lib/lp/code/stories/branches/xx-bug-branch-links.txt 2012-06-26 04:38:24 +0000
@@ -81,12 +81,11 @@
branch page for people that are not able to see it. Get an admin
to mark the bug private.
- >>> admin_browser.open('http://launchpad.dev/bugs/4')
- >>> admin_browser.getLink('This report is public').click()
- >>> admin_browser.getControl('This bug report should be private').click()
+ >>> admin_browser.open('http://launchpad.dev/firefox/+bug/4/+secrecy')
+ >>> admin_browser.getControl('User Data').click()
>>> admin_browser.getControl('Change').click()
>>> print extract_text(find_tag_by_id(admin_browser.contents, 'privacy'))
- This report is private
+ This report contains User Data information...
Sample person can see it...
=== modified file 'lib/lp/code/templates/branch-portlet-privacy.pt'
--- lib/lp/code/templates/branch-portlet-privacy.pt 2012-06-07 18:27:33 +0000
+++ lib/lp/code/templates/branch-portlet-privacy.pt 2012-06-26 04:38:24 +0000
@@ -7,20 +7,8 @@
class python: path('context/private') and 'portlet private' or 'portlet public'
"
>
- <tal:information_type tal:condition="view/show_information_type_in_ui">
<span id="information-type-summary"
tal:attributes="class view/information_type_css;">This branch
contains <strong id="information-type" tal:content="view/information_type"></strong> information</span>
<div id="information-type-description" style="padding-top: 5px" tal:content="view/information_type_description"></div>
- </tal:information_type>
- <tal:privacy tal:condition="not:view/show_information_type_in_ui">
- <div tal:condition="not:context/private"
- >This branch is public</div>
- <div tal:condition="context/private">
- This branch is <strong>private</strong>
- <tal:msg condition="not:context/explicitly_private">
- because it is stacked on a private branch.
- </tal:msg>
- </div>
- </tal:privacy>
</div>
=== modified file 'lib/lp/services/features/flags.py'
--- lib/lp/services/features/flags.py 2012-06-21 06:50:10 +0000
+++ lib/lp/services/features/flags.py 2012-06-26 04:38:24 +0000
@@ -326,13 +326,6 @@
'',
'',
''),
- ('disclosure.show_information_type_in_ui.enabled',
- 'boolean',
- ('If true, displays the information_type directly in the UI when '
- 'filing a bug and changing the information_type.'),
- '',
- '',
- ''),
('disclosure.information_type_notifications.enabled',
'boolean',
('If true, calculate and store bugchange notifications to reference '
@@ -340,12 +333,6 @@
'',
'',
''),
- ('disclosure.show_information_type_in_branch_ui.enabled',
- 'boolean',
- 'If true, displays the information_type directly on branch pages.',
- '',
- '',
- ''),
])
# The set of all flag names that are documented.
Follow ups