jenkinsci / bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source
MIT License
217 stars 349 forks source link

Provide option to retrigger a failed build. #828

Open mkjkec2005 opened 3 months ago

mkjkec2005 commented 3 months ago

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

mkjkec2005 commented 3 months ago

Gentle reminder. Could you please help? Or please suggest if there is an alternative.

KalleOlaviNiemitalo commented 3 months ago

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:

On Bitbucket Cloud:

KalleOlaviNiemitalo commented 3 months ago

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.

mkjkec2005 commented 3 months ago

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.

KalleOlaviNiemitalo commented 3 months ago

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.