Merge lp:~james-w/launchpad/export-specification-bug-links into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Merged at revision: | 12022 | ||||
| Proposed branch: | lp:~james-w/launchpad/export-specification-bug-links | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
109 lines (+30/-5) 4 files modified
lib/lp/blueprints/interfaces/specification.py (+3/-1) lib/lp/blueprints/tests/test_webservice.py (+11/-0) lib/lp/bugs/interfaces/buglink.py (+14/-4) lib/lp/bugs/interfaces/webservice.py (+2/-0) |
||||
| To merge this branch: | bzr merge lp:~james-w/launchpad/export-specification-bug-links | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Guilherme Salgado (community) | code | 2010-12-01 | Approve on 2010-12-02 |
| Linaro Infrastructure | informational | 2010-12-01 | Pending |
|
Review via email:
|
|||
Commit Message
[r=salgado]
Description of the Change
Hi,
Here is a small branch to export specification/bug links, which is the
last thing required to get the Ubuntu work items tracker using the API
for blueprints, rather than screen-scraping.
I'm not entirely sure that List->Collectio
behavior, but lazr.restful doesn't do the right thing with List.
Also, I needed to add the inheritance to have lazr.restful add the bugs
property to the specifications. Previously the model just had
implements(
that.
Thanks,
James
| Guilherme Salgado (salgado) wrote : | # |
| James Westby (james-w) wrote : | # |
On Thu, 02 Dec 2010 12:11:14 -0000, Guilherme Salgado <email address hidden> wrote:
> I don't think we use the field you changed for constructing any forms,
> so I'd be surprised if this has any side effects.
That's good news.
> As we talked on IRC, I thought just exporting IBugLinkTarget as an entry
> would make it work, but apparently it didn't?
Nope, I had this diff minus the inheritence change and it didn't
work. I'm asking again for some advice on this on IRC.
> A trivial conflict here.
Fixed.
> I think you should use Reference instead of Object here. I don't
> remember why we have Reference (which is a wrapper around Object), but
> that's what we seem to use in conjunction with CollectionFields.
Ok.
> Also, this interface is provided only by ISpecification and IQuestion
> (which is not yet exposed on the API), so I think it makes sense to
> expose it only on the 'devel' version of the webservice, like all the
> Blueprints bits that are currently exposed. To do that you just need a
> couple extra arguments to exported:
>
> ('devel', dict(exported=
I also fixed the docstring to match the current state of the code.
Thanks,
James

On Wed, 2010-12-01 at 22:24 +0000, James Westby wrote: nField doesn't change other
> You have been requested to review the proposed merge of lp:~james-w/launchpad/export-specification-bug-links into lp:launchpad.
>
> Hi,
>
> Here is a small branch to export specification/bug links, which is the
> last thing required to get the Ubuntu work items tracker using the API
> for blueprints, rather than screen-scraping.
>
> I'm not entirely sure that List->Collectio
> behavior, but lazr.restful doesn't do the right thing with List.
I don't think we use the field you changed for constructing any forms,
so I'd be surprised if this has any side effects.
> IBugLinkTarget) . I don't know if there is another way to achieve
> Also, I needed to add the inheritance to have lazr.restful add the bugs
> property to the specifications. Previously the model just had
> implements(
> that.
As we talked on IRC, I thought just exporting IBugLinkTarget as an entry
would make it work, but apparently it didn't?
> === modified file 'lib/lp/ blueprints/ interfaces/ specification. py' blueprints/ interfaces/ specification. py 2010-12-01 12:54:42 +0000 blueprints/ interfaces/ specification. py 2010-12-01 22:24:03 +0000 arget, interfaces. buglink import IBugLinkTarget interfaces. sprint import ISprint interfaces. branchlink import IHasLinkedBranches interfaces. milestone import IMilestone ISpecificationP ublic, ISpecificationE ditRestricted) : ISpecificationP ublic, ISpecificationE ditRestricted, as_webservice_ entry() blueprints/ tests/test_ webservice. py' blueprints/ tests/test_ webservice. py 2010-12-01 12:54:42 +0000 blueprints/ tests/test_ webservice. py 2010-12-01 22:24:03 +0000 for_anonymous, tory,
> --- lib/lp/
> +++ lib/lp/
> @@ -58,6 +58,7 @@
> IHasSpecifications,
> ISpecificationT
> )
> +from lp.bugs.
> from lp.blueprints.
> from lp.code.
> from lp.registry.
> @@ -529,7 +530,8 @@
> """Return the SpecificationBranch link for the branch, or None."""
>
>
> -class ISpecification(
> +class ISpecification(
> + IBugLinkTarget):
> """A Specification."""
>
> export_
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -14,7 +14,11 @@
> )
> from lp.testing import (
> launchpadlib_for,
> +<<<<<<< TREE
> launchpadlib_
> +=======
> + person_logged_in,
> +>>>>>>> MERGE-SOURCE
> TestCaseWithFac
A trivial conflict here.
> ws_object, .dependencies. total_size) l(spec2. name, spec_webservice .dependencies[ 0].name) tion_contains_ bug_links( self): makeSpecificati on() makeBug( ) makePerson( ) logged_ in(person) : ebservice( spec) .bugs.total_ size) l(bug.id, spec_webservice .bugs[0] .id) rgetTests( SpecificationWe bserviceTestCas e):
> )
> @@ -154,6 +158,16 @@
> self.assertEqual(1, spec_webservice
> self.assertEqua
>
> + def test_representa
> + spec = self.factory.
> + bug = self.factory.
> + person = self.factory.
> + with person_
> + spec.linkBug(bug)
> + spec_webservice = self.getSpecOnW
> + self.assertEqual(1, spec_webservice
> + self.assertEqua
> +
>
> class SpecificationTa
> """Tests for accessing specifications via their targets."""
>
> === mo...