← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/proprietary-team-branches into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/proprietary-team-branches into lp:launchpad.

Commit message:
All personal branches get all the free information types (including Private and Private Security), and private team personal branches get Proprietary too.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1063546 in Launchpad itself: "Private team junk branches are still Private (not Proprietary) by default"
  https://bugs.launchpad.net/launchpad/+bug/1063546

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/proprietary-team-branches/+merge/129141

Private team junk branches have historically been Private (aka. user data) branches, but now that we support Proprietary they should use that instead. While I was there I also enabled the freely-available private types for public person/team junk branches, as we do for non-commercial nowadays.
-- 
https://code.launchpad.net/~wgrant/launchpad/proprietary-team-branches/+merge/129141
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/proprietary-team-branches into lp:launchpad.
=== modified file 'lib/lp/code/model/branchnamespace.py'
--- lib/lp/code/model/branchnamespace.py	2012-10-11 04:14:37 +0000
+++ lib/lp/code/model/branchnamespace.py	2012-10-11 10:16:27 +0000
@@ -324,14 +324,14 @@
         """See `IBranchNamespace`."""
         # Private teams get private branches, everyone else gets public ones.
         if self._is_private_team:
+            return NON_EMBARGOED_INFORMATION_TYPES
+        else:
             return FREE_INFORMATION_TYPES
-        else:
-            return PUBLIC_INFORMATION_TYPES
 
     def getDefaultInformationType(self, who=None):
         """See `IBranchNamespace`."""
         if self._is_private_team:
-            return InformationType.USERDATA
+            return InformationType.PROPRIETARY
         else:
             return InformationType.PUBLIC
 

=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py	2012-10-08 07:07:19 +0000
+++ lib/lp/code/model/tests/test_branch.py	2012-10-11 10:16:27 +0000
@@ -2406,7 +2406,7 @@
             visibility=PersonVisibility.PRIVATE)
         branch = self.factory.makePersonalBranch(owner=team)
         self.assertTrue(branch.private)
-        self.assertEqual(InformationType.USERDATA, branch.information_type)
+        self.assertEqual(InformationType.PROPRIETARY, branch.information_type)
 
     def test__reconcileAccess_for_product_branch(self):
         # _reconcileAccess uses a product policy for a product branch.

=== modified file 'lib/lp/code/model/tests/test_branchnamespace.py'
--- lib/lp/code/model/tests/test_branchnamespace.py	2012-10-08 14:05:57 +0000
+++ lib/lp/code/model/tests/test_branchnamespace.py	2012-10-11 10:16:27 +0000
@@ -968,7 +968,7 @@
         person = self.factory.makePerson()
         namespace = PersonalNamespace(person)
         self.assertContentEqual(
-            PUBLIC_INFORMATION_TYPES,
+            FREE_INFORMATION_TYPES,
             namespace.getAllowedInformationTypes())
 
     def test_public_team(self):
@@ -976,7 +976,7 @@
         team = self.factory.makeTeam()
         namespace = PersonalNamespace(team)
         self.assertContentEqual(
-            PUBLIC_INFORMATION_TYPES,
+            FREE_INFORMATION_TYPES,
             namespace.getAllowedInformationTypes())
 
     def test_private_team(self):
@@ -984,7 +984,7 @@
         team = self.factory.makeTeam(visibility=PersonVisibility.PRIVATE)
         namespace = PersonalNamespace(team)
         self.assertContentEqual(
-            FREE_INFORMATION_TYPES,
+            NON_EMBARGOED_INFORMATION_TYPES,
             namespace.getAllowedInformationTypes())
 
 
@@ -1111,7 +1111,8 @@
         """
         namespace = get_branch_namespace(owner)
         self.assertNotIn(
-            InformationType.USERDATA, namespace.getAllowedInformationTypes())
+            InformationType.PROPRIETARY,
+            namespace.getAllowedInformationTypes())
 
     def assertPolicyCheckRaises(self, error, creator, owner):
         """Assert that the policy check raises an exception.


Follow ups