Completing a Build when Build Isn't Necessary
![]()
If not using the JBE, one can implement their own build loop using the Ant tasks. But, how does one cancel a build request using completeBuildTask?
completeBuildTask needs a buildResultUUID, but the task typically called prior to that, getNextTeamBuildRequest, returns a buildRequestUUID. The only way I know to get a buildResultUUID is to use the startTeamBuild task. But, then calling completeBuildTask (with buildNotNecessary=true) yields an exception since the build would already be in an in-process state. Is there some way to "convert" a buildRequestUUID into a buildResultUUID without starting the build? |
3 answers
![]()
kvogen wrote:
If not using the JBE, one can implement their own build loop using the Unfortunately, there isn't a way to do that. Work item 87583, which is unresolved and currently unplanned, looks at the problem from a slightly different point of view, abandoning the build and deleting the build result after the build has been started. But it's trying to solve the same problem. https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/87583 |
![]()
Thanks for the response. As an alternative, is it possible to programmatically delete a build result?
There is a cancelBuild method on the ITeamBuildRequestClient that allows me to cancel a build when I detect that it isn't necessary. That works great, except that it keeps a canceled build result around. Is it possible to programmatically delete that canceled build result? |
![]()
I figured out a solution. It can be done using the underlying Java API.
An instance of IBuildResult returns the IBuildResultHandle instance via the getBuildResult() method. From there, makeBuildComplete method can be called. The end result is that the build request disappears from the UI since it wasn't necessary.
|