Open jimCresswell opened 10 years ago
These would be awesome if that would be possible. I think this feature is crucial for using PRs together with Jenkins. Only by this you can make sure that the PR merge product is green on the one hand, but that on the other hand that you can use the Stash PR feature "Requires X Numbers of successful builds" before a PR can be approved.
See also the discussion at http://nerdwin15.com/2013/04/continuous-integration-with-stash-and-jenkins/#comment-1560212586
So +1 from my side to implement this.
I found a way to get this running. For this the plugin is combined with the [Stash Build Status Plugin](https://bitbucket.org/bolyuba/stash-build-status-plugin/overview plugin). The Stash Jenkins plugin is used to notify Jenkins and the Stash Build Status plugin is used to assign the build status of the auto merge commit to the last commit of the changeset this PR is about. By this Stash has a build status for the PR based not on the checkin but on the auto merge result of between the source and target of the PR.
I will try to write up the necessary steps in the next 1-2 days.
@christiangalsterer I would be very interested to know the necessary steps you used! +1
Identify the SHA of the current head of a pull request merge product (refs/pull-requests/*/merge) and use that to trigger a build of the merge product in Jenkins.
Note that this might break reporting by the Jenkins StashNotifier plugin as that relies on the SHA to report, I imagine the reporting itself will happen correctly but the merge product SHA is not one of the commits listed in the Stash pull request UI. It would be an acceptable hack if we could somehow send the source branch SHA as a parameter and use that for reporting build results back to Stash.