Provide option to retrigger a failed build.
mkjkec2005 opened this issue · 5 comments
What feature do you want to see added?
Currently the plugin does not provide an option to retrigger failed builds. Users need to go to Jenkins and run the failed PR build job. Is there a way to achieve this from Bitbucket?
Upstream changes
No response
Are you interested in contributing this feature?
No response
Gentle reminder. Could you please help? Or please suggest if there is an alternative.
Does Bitbucket support such a feature? It seems a rebuild button would need a plugin for Bitbucket too, not only for Jenkins.
On Bitbucket Data Center:
- Store a build status
POST /api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds
doesn't appear to support telling Bitbucket how to trigger a rebuild. - Create a Code Insights report
PUT /insights/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/reports/{key}
could add a rebuild button asLINK
data, but I think that would not be more convenient to use than following the build status link to Jenkins and clicking "Rebuild" from there. - Webhook event payloads don't mention a rebuild request event.
On Bitbucket Cloud:
- Create a build status for a commit
POST /repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build
doesn't mention a rebuild feature. - Create or update a report
PUT /repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
likewise supportsLINK
data. - Webhook event payloads don't mention a rebuild request event.
- [BCLOUD-20539] As a customer, I want to be able to manually trigger a webhook has only 11 votes.
Possibly though, you could make Jenkins add a comment to the pull request when the build fails. That comment could then include a rebuild link. There may be some Jenkins plugin for this already.
Thank you @KalleOlaviNiemitalo. The problem with comment is how do we ensure that we post using a rebuild link? Jenkins rebuild will needs a crumb for form submission or post request.
There is the Build Authorization Token Root plugin for triggering builds with an API token rather than an anti-CSRF crumb. I don't have experience with it. There are also other plugins in the Build Triggers category; some of them might be better for your scenario.