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

Parameterize build #2

Closed tomasbjerre closed 9 years ago

tomasbjerre commented 9 years ago

I created a Stash plugin that can trigger this plugin, so that polling can be avoided: https://github.com/tomasbjerre/pull-request-notifier-for-stash It has an admin GUI where checkboxes for different events can be enabled. And a custom URL, supporting variables, is added. Then when any of the events are triggered, the URL is rendered and invoked.

For example when a pull request is OPENED, or REOPENED, the plugin can invoke a URL that includes, from repo, from hash, to repo and to hash.

But then this plugin will need to enable parameters the build.

By the way, my plugin will be available in Atlassian Marketplace within a few days.

nemccarthy commented 9 years ago

Looks awesome! It would be great to get these two working together. I guess I need more info on the use case/how they would function together.

tomasbjerre commented 9 years ago

The use case is:

  1. A pull request is opnened, repopened or updated
  2. Pull Request Notifier for Stash triggers on that event and invokes: http://server/job/theStashPullrequestBuilderEnabledJob/buildWithParameters?token=TOKEN&FROM_REPO=a&FROM_COMMIT=b&TO_REPO=c&TO_COMMIT=d&PROJECT=e
  3. This plugin will retrieve the parameters and build that pull request

In "2" the job can also be triggered with the pull request id, if thats better.

nemccarthy commented 9 years ago

Yeah that sounds like an interesting idea, I'm assuming that this trigger should pick up the parametrized request.

Is there a reason polling the Stash PR list via their rest api every minute doesnt work for you? I understand this doesn't scale if you have 100s of repos to watch but it seems like a corner case. Do we just need to add some other states to support (i.e. re-opened) are there any bugs that this plugin could fix?

Happy to take a PR on this one. :)