Expose API to find Blueprints associated with a Bug
Bug #1321338 reported by
John Agosta
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
Problem Statement:
We have a development process where every LP Bug must have an associated Blueprint. We have a *master* project and many sub-projects. The master project holds all the Blueprints for sub-projects. What I would like to determine is "do I have any Bugs without a Blueprint?"
Ultimately, I would like to generate an offline report that shows the Bug detail and any Blueprint the Bug is related to (or not related to).
The LP API to extract Blueprint data is not currently exposed in the API documentation.
Request:
Please expose the API to allow locating the blueprints for a Bug.
tags: | added: api trivial |
Changed in launchpad: | |
status: | New → Triaged |
importance: | Undecided → Low |
To post a comment you must log in.
While it might well make sense to export this anyway, given this description, it's possible that your task would actually run faster the other way round, which only requires currently-exported API. You probably have fewer blueprints than bugs, so you could iterate over all your blueprints and get the collection of linked bugs for each one more quickly than you could iterate over all your bugs and find any linked blueprint for each one.
Something like:
all_bugs = set(project. searchTasks( )) with_blueprints = set() valid_specifica tions: with_blueprints .update( spec.bugs)
bugs_
for spec in project.
bugs_
Then the difference between all_bugs and bugs_with_ blueprints is the answer to your question. (And of course you could also use project. searchTasks( linked_ blueprints= "Show only Bugs without linked Blueprints").)
For the full report, likewise, you could do something like:
bug_to_blueprint = {} valid_specifica tions:
bug_ to_blueprint[ bug] = spec
for spec in project.
for bug in spec.bugs:
This wouldn't make sense if you were looking at a more limited set of bugs, but for everything in the project it's probably reasonable.