nemccarthy / stash-pullrequest-builder-plugin

A Jenkins plugin for Building Stash Pull Requests
https://wiki.jenkins-ci.org/display/JENKINS/Stash+pullrequest+builder+plugin
Other
64 stars 130 forks source link

Control notifications sent back to Stash #44

Closed blaffoy closed 8 years ago

blaffoy commented 9 years ago

My Jenkins setup involves a fairly complex pipeline of jobs, of which I only wish one to be triggered by pull request changes. This job will in turn trigger other downstream jobs.

This conflicts with the design of this plugin, in that a notification is returned to the Stash pull request API as soon as this trigger job is complete. This is a problem, as it means a "success" notification is returned before Jenkins has built or tested anything on the branch. This could result in the pull request being marked good while builds have failed in the background.

I would like for there to be config options that turn on or off the notifications sent to Stash.

(pull request incoming)

blaffoy commented 9 years ago

https://github.com/nemccarthy/stash-pullrequest-builder-plugin/pull/45

blaffoy commented 8 years ago

I have a further problem with the notifications being sent to Stash by this plugin: a large number of spurious comments to PullRequests causes lots of email/hipchat spam to be sent to contributors of my repository, and to pollute the PullRequest discussion.

I now understand that the plugin relies on the BuildStarted/BuildFinished comments in order to prevent itself from continually rebuilding the same branches.

This seems to me to be a pretty noisy way for the plugin to keep track of its own work. By contrast, the Jenkins Git plugin seems to be able to record which branches/commits it has built without writing anything to the remote repo.

I don't yet know exactly how the Git plugin achieves that, but if I figure it out, I'd like to change this plugin to replicate that behaviour.

nemccarthy commented 8 years ago

You would need to save some meta data in Jenkins. For now I'm going to mark this as a feature request. If you want to raise a PR please do.