Merge lp:~ttx/launchpad/lp690712 into lp:launchpad

Proposed by Thierry Carrez
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 12299
Proposed branch: lp:~ttx/launchpad/lp690712
Merge into: lp:launchpad
Diff against target: 50 lines (+16/-2)
3 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+1/-0)
lib/lp/blueprints/interfaces/specification.py (+7/-2)
lib/lp/blueprints/tests/test_webservice.py (+8/-0)
To merge this branch: bzr merge lp:~ttx/launchpad/lp690712
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+45400@code.launchpad.net

Commit message

[r=allenap][ui=none][bug=690712] Exposes the missing linked_branches in the blueprint API (version='devel' only), fixes LP: #690712

Description of the change

Exposes the missing linked_branches in the blueprint API (version='devel' only), fixes LP: #690712

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

Looks good, but why export in "devel" only? As it's not breaking anything I would have guessed that it's okay to export it in all versions. That said, I'm not really familiar with the new web service API versioning policy.

review: Approve
Revision history for this message
Thierry Carrez (ttx) wrote :

@Gavin: everything in blueprint is only exported in 'devel'. This is because the long-term solution is to merge blueprints and bugs, not to improve blueprints.

Revision history for this message
Gavin Panella (allenap) wrote :

Interesting, thanks for the explanation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py'
2--- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2010-12-21 09:34:17 +0000
3+++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-01-06 15:33:54 +0000
4@@ -525,6 +525,7 @@
5
6 # ISpecification
7 patch_collection_property(ISpecification, 'dependencies', ISpecification)
8+patch_collection_property(ISpecification, 'linked_branches', ISpecificationBranch)
9
10 # ISpecificationTarget
11 patch_entry_return_type(
12
13=== modified file 'lib/lp/blueprints/interfaces/specification.py'
14--- lib/lp/blueprints/interfaces/specification.py 2010-12-08 01:20:51 +0000
15+++ lib/lp/blueprints/interfaces/specification.py 2011-01-06 15:33:54 +0000
16@@ -399,8 +399,13 @@
17 "All the dependencies, including dependencies of dependencies.")
18 all_blocked = Attribute(
19 "All specs blocked on this, and those blocked on the blocked ones.")
20- linked_branches = Attribute(
21- 'The entries that link the branches to the spec.')
22+ linked_branches = exported(
23+ CollectionField(
24+ title=_("Branches associated with this spec, usually "
25+ "branches on which this spec is being implemented."),
26+ value_type=Reference(schema=Interface), # ISpecificationBranch
27+ readonly=True),
28+ ('devel', dict(exported=True)), exported=False)
29
30 # emergent properties
31 informational = Attribute('Is True if this spec is purely informational '
32
33=== modified file 'lib/lp/blueprints/tests/test_webservice.py'
34--- lib/lp/blueprints/tests/test_webservice.py 2010-12-17 23:59:00 +0000
35+++ lib/lp/blueprints/tests/test_webservice.py 2011-01-06 15:33:54 +0000
36@@ -154,6 +154,14 @@
37 self.assertEqual(1, spec_webservice.dependencies.total_size)
38 self.assertEqual(spec2.name, spec_webservice.dependencies[0].name)
39
40+ def test_representation_contains_linked_branches(self):
41+ spec = self.factory.makeSpecification()
42+ branch = self.factory.makeBranch()
43+ person = self.factory.makePerson()
44+ spec.linkBranch(branch, person)
45+ spec_webservice = self.getSpecOnWebservice(spec)
46+ self.assertEqual(1, spec_webservice.linked_branches.total_size)
47+
48 def test_representation_contains_bug_links(self):
49 spec = self.factory.makeSpecification()
50 bug = self.factory.makeBug()