Merge lp:~brian-murray/launchpad/api-export-bug-linked-branches-take2 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Michael Nelson on 2010-03-05 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | not available |
| Proposed branch: | lp:~brian-murray/launchpad/api-export-bug-linked-branches-take2 |
| Merge into: | lp:launchpad |
| Diff against target: |
75 lines (+40/-3) 2 files modified
lib/lp/bugs/interfaces/bug.py (+7/-3) lib/lp/bugs/stories/webservice/xx-bug.txt (+33/-0) |
| To merge this branch: | bzr merge lp:~brian-murray/launchpad/api-export-bug-linked-branches-take2 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Nelson (community) | code | 2010-03-03 | Approve on 2010-03-04 |
|
Review via email:
|
|||
Commit Message
Exports IBug.linked_
| Brian Murray (brian-murray) wrote : | # |
| Michael Nelson (michael.nelson) wrote : | # |
Hi Brian, thanks for getting in there and fixing this.
I was a bit confused at first, as the original MP says it was merged (https:/
Now, with this branch, I have one main question and a small request. The question is: Why are we declaring and exporting the the linked_branches CollectionField attribute on IBug, when it is already exported on IHasLinkedBranches (which is inherited by IBug)? I'll ping a bugs person to see if they know.
And regarding the tests, if you look at around line 1793 of xx-bug.txt, you'll see the "And for every bug we can look at the CVEs linked to it..." part of the story which shows how the exported cves_collection
Thanks!
-Michael
| Abel Deuring (adeuring) wrote : | # |
bugs 4 and 5 of the test data have linked branches
| Abel Deuring (adeuring) wrote : | # |
Ah, one more detail:
19 + linked_branches = exported(
20 + CollectionField(
21 + title=_("Branches associated with this bug, usually "
22 + "branches on which this bug is being fixed."),
23 + value_type=
24 + readonly=True))
That should be "schema=
| Michael Nelson (michael.nelson) wrote : | # |
Hi Brian,
So from the conversation below, I now understand why the original MP says Merged, and why you're needing to re-define linked_branches on IBug (because the declaration on IHasLinkedBranches uses the schema IBranch, whereas Abel mentions below that IBugBranch should be the used as the schema, as it has a few extra fields.)
So, please switch the schema to IBugBranch (I just checked and your current test still passes), and then add the example showing how it can be used (as mentioned above for cves_collection
Thanks!
10:04 < noodles775> Hi adeuring, would you be able to have a look at the comment I just added to https:/
10:04 < noodles775> adeuring: do you know if there's a reason why linked_branches is declared both in IBug and IHasLinkedBranches (which is inherited by IBug)?
10:05 < adeuring> noodles775: more or less. (1) class IBugBranch defines a few more properties, like revision_hint or bug_task
10:06 < adeuring> erm that was it, no (2)
10:07 < adeuring> noodles775: and the history of Brian's branch is quite complex. It was merged into a another branch, and that branch landed after Brian's changed had been reverted.
10:08 < noodles775> adeuring: sorry, I don't understand what that has to do with IBug.linked_
10:08 < noodles775> adeuring: oh, ok.
10:08 < adeuring> noodles775: yes, that's quite convoluted ;)
10:09 < noodles775> adeuring: the declaration should only be required on IHasLinkedBranches right? (although the test fails if you remove the one on IBug)? Or what did I miss?
10:09 < adeuring> noodles775: and: Brian should use IBugBranch as the reference type
10:10 < adeuring> noodles775: sorry wrote the last line too early...
10:10 < adeuring> we need the new declaration at least now, for the export, because of schema=IBranch, which is wrong
10:11 < adeuring> it should be schema=IBugBranch, in the export declaration
10:11 < noodles775> Ah, so it's actually meant to override the IHasLinkedBranches declaration?
10:12 < noodles775> (as it uses the wrong schema). OK.
10:12 < adeuring> noodles775: well, I did not write the code ;) But I assume, yes
10:12 < noodles775> adeuring: ok, thanks for the help!
10:16 < adeuring> noodles775: an odd detail of overriding linked_branches is that there is not very much left from IHasLinkedBranches ;) But that's nothing we should nag Brain with ;)
10:17 < noodles775> adeuring: yes, afaics IHasLinkedBranches is used by other objects (blueprints).
10:17 < adeuring> right
| Brian Murray (brian-murray) wrote : | # |
I've made the recommended changes and pushed them in revision 10429.

This is a redo of the branch in https:/ /code.edge. launchpad. net/~brian- murray/ launchpad/ api-export- bug-linked- branches. That was failing ec2 testing and make build due to the schema for linked branches being wrong. I've resolved that in this branch.
This may also resolve bug 528569.