Merge lp:~wallyworld/launchpad/recipe-request-builds-existing into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Ian Booth |
Approved revision: | no longer in the source branch. |
Merged at revision: | 12562 |
Proposed branch: | lp:~wallyworld/launchpad/recipe-request-builds-existing |
Merge into: | lp:launchpad |
Diff against target: |
112 lines (+29/-23) 1 file modified
lib/lp/code/javascript/requestbuild_overlay.js (+29/-23) |
To merge this branch: | bzr merge lp:~wallyworld/launchpad/recipe-request-builds-existing |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Launchpad code reviewers | code | Pending | |
Leonard Richardson | code | Pending | |
Review via email: mp+52389@code.launchpad.net |
Commit message
[r=thumper][bug=728789] Fix the mechanism used by the recipe request builds popup form to determine the currently pending builds for the recipe.
Description of the change
Fix the mechanism used by the recipe request builds popup form to determine the currently pending builds for the recipe. The currently pending builds are required so that the corresponding distro series checkboxes on the popup form can be disabled, preventing the user from asking for an already pending build.
== Implementation ==
The original implementation was broken - there was no web service api available to do the job and a crap implementation was done. Now, the pending_builds property on a recipe has been exported to the web service. This branch uses that api.
The web service is invoked as follows:
lp_client.
The result is a list of build entries. We are interested in the build's "distro_series" and "archive" properties (which have been exported to the web service):
build_
build_
By way of example, the distro_series_link resolves to something like: "https:/
We need to use the information we now have to figure out what checkboxes on the request build popup to disable. The checkboxes are labelled with the distro series name so that's what we need to match on. Strictly speaking, we would need to make yet another back end call to get the name of the distro series defined by the distro series link. However, this merge proposal uses the fact that the distro_series_link value ends with a segment corresponding to the distro series name. So we avoid having to make another back end call.
The same approach is used for the archive - the archive link value ends with a path segment which is sufficient to define which archive has been chosen from archive combo box.
I need advice as to whether the above approach is considered kosher. The alternative is to make 2 additional back end calls to fetch the distro series and archive names. However, as stated, the link values contain sufficient information so that these additional back end calls can be avoided.
In addition to the aboce changes, the invocation of the disable_
== Tests==
Use the existing code.windmill.
Code looks reasonable.