ghprb-plugin icon indicating copy to clipboard operation
ghprb-plugin copied to clipboard

perform action on PR close

Open paulczar opened this issue 10 years ago • 19 comments

It would be great if the ghprb plugin would react to a PR close(/merge) and be able to perform an action.

example: I want to deploy a test environment every time a PR is made, which is totally possible, however when the PR is closed I would like to be able to destroy that test environment.

paulczar avatar Oct 04 '15 20:10 paulczar

I've the same scenario as described. Is this possible with this plugin? @paulczar have you found any workaround for this?

gvilarino avatar Oct 29 '15 17:10 gvilarino

:+1:

direction avatar Jan 08 '16 21:01 direction

:+1: We would LOVE to have this feature.

chrisferry avatar Jan 08 '16 21:01 chrisferry

I ended working around this manually with a github webhook and a custom job

gvilarino avatar Jan 08 '16 22:01 gvilarino

+1

mbukosky avatar Dec 06 '16 20:12 mbukosky

+1

PatrikSteuer avatar Apr 25 '17 08:04 PatrikSteuer

+1

As an aside @gvilarino if you still happen to have this custom hook and job operating, care to elaborate some? This is something I sort of really, really need.

tykeal avatar May 22 '17 20:05 tykeal

@tykeal yeah! So I use a github webhook that triggers a webtask, that munches github's payload and triggers a jenkins job with the params I need.

You can see (and improve!) the code for the webtask here (you might want to remove the rollbar dep).

gvilarino avatar May 22 '17 22:05 gvilarino

I would love this.

Floby avatar Nov 16 '17 10:11 Floby

I think this is outofscope of the plugin, no? You could simply configure a new build which reacts on the merge.

Does this make sense to you? Thank you!

bjoernhaeuser avatar Nov 18 '17 20:11 bjoernhaeuser

@bjoernhaeuser the problem with that is that this plugin triggers builds with different parameters than say the GitHub Plugin itself. The point behind the request is that there is a webhook condition that this plugin should be passing on / allowing you to trigger based off of that isn't being handled.

I believe that folks want to see this plugin become feature comparable with the Gerrit Trigger plugin for Gerrit changes. Not handling close / merge changes mean you aren't comparable.

tykeal avatar Nov 18 '17 21:11 tykeal

@tykeal understood!

What kind of actions would you run? And what parameters are needed and differ from GitHub Plugin?

From my point of view there is no difference between closing a pr and triggering a new build from the commit in master.

bjoernhaeuser avatar Nov 18 '17 21:11 bjoernhaeuser

My use-case involves creating temporary environments for each pull request. Ideally I'd have a build triggered to clean these up. Waiting for merge on master doesn't give me as much information as this plugin and in turn does not help me identify which environment I'd need to destroy.

I can think of this plugin offering a second trigger (in addition to "Github Pull Request builder") which could be named "Github Pull Request closed". This way, no need to if our way around our use case and we can have two different jobs.

Floby avatar Nov 27 '17 13:11 Floby

I have the same use case as @Floby (creating temporary environments for each pull request). Triggering closed PRs would solve our problems too.

franciscocpg avatar Jan 02 '18 20:01 franciscocpg

@Floby @bjoernhaeuser having a second trigger isn't really as good an option IMO, part of our desire is to have this plugin be as 100% comparable to the Gerrit Trigger plugin as possible. We exercise nearly every single option in the Gerrit trigger with the projects that we host that are Gerrit based and because we heavily leverage Jenkins Job Builder for our jobs we're managing in excess of 7000 jobs across our current environments.

In many some cases we have verify / merge jobs that are literally the same job except artifacts are pushed to the artifact storage if it's a merge job. So having the trigger just be able to support Merge directly without having to have a completely different trigger plugin / trigger defined would be optimal.

Ideally, the merge trigger would also support comment triggering just like the open / updated PR triggering currently does as well. This is also a feature that we strongly use to trigger particular types of events in our build environment.

If you're curious as to what all we do, our global-jjb templates are what power a good portion of the jobs in our environment and they're completely open and available on our GitHub mirror here: https://github.com/lfit/releng-global-jjb or direct from the source here: https://gerrit.linuxfoundation.org/infra/#/admin/projects/releng/global-jjb

tykeal avatar Jan 02 '18 21:01 tykeal

+1

eranreshef avatar Jan 14 '19 16:01 eranreshef

Any solution in these past 5 years? Alternative solutions are also fine.. Thanks

iMoses avatar Sep 13 '20 01:09 iMoses

Yeah we have this same problem related to temporary environments that are created that we use to verify PRs before merging - we deploy as part of the pipeline - run tests - and then we would like that environment to stay up whilst the PR is open so that additional changes can be pushed to it, and it can be used as a demonstration environment before the PR is closed.

abbottdev avatar Jan 11 '21 12:01 abbottdev

+1

RyanW8 avatar Oct 24 '22 14:10 RyanW8