Merge lp:~deryck/launchpad/bugs-embargoed-or-proprietary-1079352 into lp:launchpad

Proposed by Deryck Hodge on 2012-11-16
Status: Merged
Approved by: Aaron Bentley on 2012-11-16
Approved revision: no longer in the source branch.
Merged at revision: 16289
Proposed branch: lp:~deryck/launchpad/bugs-embargoed-or-proprietary-1079352
Merge into: lp:launchpad
Diff against target: 90 lines (+15/-4)
4 files modified
lib/lp/bugs/interfaces/bugtarget.py (+3/-0)
lib/lp/registry/enums.py (+8/-1)
lib/lp/registry/model/product.py (+1/-1)
lib/lp/registry/tests/test_product.py (+3/-2)
To merge this branch: bzr merge lp:~deryck/launchpad/bugs-embargoed-or-proprietary-1079352
Reviewer Review Type Date Requested Status
Aaron Bentley (community) 2012-11-16 Approve on 2012-11-16
Review via email: mp+134746@code.launchpad.net

Commit Message

Add an EMBARGOED_OR_PROPRIETARY option to BugSharingPolicy which will allow private projects created with an EMBARGOED information type to have a bug sharing policy that matches everything else.

Description of the Change

This branch ensures that BugSharingPolicy has an EMBARGOED_OR_PROPRIETARY policy just like branches and specifications. Originally, there was no reason to have embargoed bugs, but now that projects can start as EMBARGOED project-wide it makes sense to have a matching policy for Bugs.

The work here is pretty simple -- update the existing test for creating embargoed projects to assert that the bugs policy is EMBARGOED_OR_PROPRIETARY rather than PROPRIETARY. Then, update the BugSharingPolicy and related constants for default and allowed types to get the test passing.

Lint free.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/interfaces/bugtarget.py
  lib/lp/registry/enums.py
  lib/lp/registry/model/product.py
  lib/lp/registry/tests/test_product.py

To post a comment you must log in.
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/interfaces/bugtarget.py'
2--- lib/lp/bugs/interfaces/bugtarget.py 2012-10-05 05:34:13 +0000
3+++ lib/lp/bugs/interfaces/bugtarget.py 2012-11-19 02:10:25 +0000
4@@ -56,6 +56,7 @@
5 FREE_INFORMATION_TYPES,
6 InformationType,
7 NON_EMBARGOED_INFORMATION_TYPES,
8+ PROPRIETARY_INFORMATION_TYPES,
9 )
10 from lp.bugs.interfaces.bugtask import IBugTask
11 from lp.bugs.interfaces.bugtasksearch import (
12@@ -207,6 +208,7 @@
13 BugSharingPolicy.PROPRIETARY_OR_PUBLIC: NON_EMBARGOED_INFORMATION_TYPES,
14 BugSharingPolicy.PROPRIETARY: (InformationType.PROPRIETARY,),
15 BugSharingPolicy.FORBIDDEN: [],
16+ BugSharingPolicy.EMBARGOED_OR_PROPRIETARY: PROPRIETARY_INFORMATION_TYPES,
17 }
18
19 BUG_POLICY_DEFAULT_TYPES = {
20@@ -215,6 +217,7 @@
21 BugSharingPolicy.PROPRIETARY_OR_PUBLIC: InformationType.PROPRIETARY,
22 BugSharingPolicy.PROPRIETARY: InformationType.PROPRIETARY,
23 BugSharingPolicy.FORBIDDEN: None,
24+ BugSharingPolicy.EMBARGOED_OR_PROPRIETARY: InformationType.EMBARGOED,
25 }
26
27
28
29=== modified file 'lib/lp/registry/enums.py'
30--- lib/lp/registry/enums.py 2012-09-21 00:28:49 +0000
31+++ lib/lp/registry/enums.py 2012-11-19 02:10:25 +0000
32@@ -130,6 +130,14 @@
33 No new bugs may be reported, but existing bugs may still be updated.
34 """)
35
36+ EMBARGOED_OR_PROPRIETARY = DBItem(6, """
37+ Embargoed, can be proprietary
38+
39+ New bugs are embargoed, but can be made proprietary later.
40+ Only people who can see the project's proprietary information can
41+ create new bugs.
42+ """)
43+
44
45 class SpecificationSharingPolicy(DBEnumeratedType):
46
47@@ -176,7 +184,6 @@
48 """)
49
50
51-
52 class TeamMembershipRenewalPolicy(DBEnumeratedType):
53 """TeamMembership Renewal Policy.
54
55
56=== modified file 'lib/lp/registry/model/product.py'
57--- lib/lp/registry/model/product.py 2012-11-16 14:21:43 +0000
58+++ lib/lp/registry/model/product.py 2012-11-19 02:10:25 +0000
59@@ -337,7 +337,7 @@
60 bug_policy_default = {
61 InformationType.PUBLIC: BugSharingPolicy.PUBLIC,
62 InformationType.PROPRIETARY: BugSharingPolicy.PROPRIETARY,
63- InformationType.EMBARGOED: BugSharingPolicy.PROPRIETARY,
64+ InformationType.EMBARGOED: BugSharingPolicy.EMBARGOED_OR_PROPRIETARY,
65 }
66
67
68
69=== modified file 'lib/lp/registry/tests/test_product.py'
70--- lib/lp/registry/tests/test_product.py 2012-11-16 14:21:43 +0000
71+++ lib/lp/registry/tests/test_product.py 2012-11-19 02:10:25 +0000
72@@ -363,7 +363,7 @@
73 licenses=[License.OTHER_PROPRIETARY],
74 information_type=InformationType.EMBARGOED)
75 self.assertEqual(
76- BugSharingPolicy.PROPRIETARY,
77+ BugSharingPolicy.EMBARGOED_OR_PROPRIETARY,
78 product.bug_sharing_policy)
79 self.assertEqual(
80 BranchSharingPolicy.EMBARGOED_OR_PROPRIETARY,
81@@ -415,7 +415,8 @@
82 BranchSharingPolicy.EMBARGOED_OR_PROPRIETARY,
83 product.branch_sharing_policy)
84 self.assertEqual(
85- BugSharingPolicy.PROPRIETARY, product.bug_sharing_policy)
86+ BugSharingPolicy.EMBARGOED_OR_PROPRIETARY,
87+ product.bug_sharing_policy)
88 self.assertEqual(
89 SpecificationSharingPolicy.EMBARGOED_OR_PROPRIETARY,
90 product.specification_sharing_policy)