How to force a rebuild of a pull request?

We are using the Jenkins Webhook plugin to notify Jenkins of a changes in the Stash repo. This works as long as new commits are push to Stash.

But how can we trigger a rebuild of a pull request when no new commit has been pushed?

1 answer

Hi Kurt,

As you pointed out, Stash will only notify Jenkins when new commits are added. If you want to rebuild a pull request at the same commit (due to a flaky test, say) I'd recommend re-running the failed build from the Jenkins UI. I'm not that familiar with Jenkins as we use Bamboo internally, but something like the Jenkins Rebuild Plugin may help you here.

cheers,

Tim

Well, actually we also tried the Rebuild Plugin, but that does not work either because the Git Plugin keeps the latest checkout in memory.
I implemented a workaround by implementing a bookmarklet that searches for the latest commit id in the HTML page of Stash; this plugin is then using the REST API of the Jenkins Git Plugin to trigger the correct build.

This issue is registered at https://github.com/Nerdwin15/stash-jenkins-postreceive-webhook/issues/64. Currently a solution is being worked out; see: https://github.com/Nerdwin15/stash-jenkins-postreceive-webhook/pulls

Maybe Atlassian can have a helping hand there :-) ?

Looks like a fun project, if I can steal some time I'll take a look at it - though as I mentioned, my experience with Jenkins is a little limited :)

Suggest an answer

Log in or Join to answer
Community showcase
Ignacio Pulgar
Posted yesterday in Off-topic

Friday Fun: What's your favorite quote?

Hi all! You've probably heard a lot of famous quotes: smart, hilarious, inspiring ones... Maybe some of them kind-of related to an Atlassian product? I really love those pieces of wisdom concentrat...

35 views 2 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot