feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Pipeline in PR Close

Open jmendiara opened this issue 6 years ago • 9 comments

Use Case:

  1. Devs create the Pull Request with number 512
  2. CI launches a Pull Request pipeline[1]
  3. A new deployment is created, for example (https://pr512.dev.example.com)
  4. Some automated e2e testing is done
  5. Devs connect to the environment and make manual testing (very common when developing UI)
  6. Devs pushes more commits. Goto 2.
  7. Changeset is accepted and the PR is merged
  8. https://pr512.dev.example.com is undeployed

To make this happen you need to listen to github webhooks by your own and trigger pipelines via api.

It would be nice to have buildkite native support for this.

[1] Pull Request pipeline understood as something only runs in PR, configured this way captura de pantalla 2018-07-21 a las 8 33 56

jmendiara avatar Jul 21 '18 07:07 jmendiara

I'm not sure I've parsed this correctly, but I think you're asking for the ability to run a pipeline, or steps, when a PR is merged. I'd definitely find that useful - I'd use it to

  • clean up remote branches
  • reap now-unnecessary cloud resources to save costs

at the least.

petemounce avatar Jul 23 '18 08:07 petemounce

Yep, not only on PR merge, but PR close (that is, when merged or discarded)

jmendiara avatar Jul 23 '18 08:07 jmendiara

We'd use this too. Currently we make this happen by having another microservice receive Github webhooks, watch out for PR merges, and then manually call a Buildkite pipeline to discard old review environments. I'd rather it be part of Buildkite directly, obviously.

jdotjdot avatar Aug 24 '18 04:08 jdotjdot

This is something that would be useful for us as well. We are planning to implement this with a cloud function that listens for pull request events and triggers the pipeline API for close events, but it'd be nicer to have this built directly into Buildkite.

miles- avatar Aug 15 '19 18:08 miles-

I'd like this feature for deleting branch preview environments. IS this still a live issue?

williamcodes avatar Apr 28 '21 14:04 williamcodes

+1

zeele avatar Jun 01 '21 21:06 zeele

Any update on this ? I am forced to use github actions to call the BK api to trigger an undeploy pipeline.

bluemalkin avatar Aug 05 '22 15:08 bluemalkin

Yes please. Don't force me into the arms of GHA. :D

s33dunda avatar Sep 27 '22 20:09 s33dunda

Just wondering how this is not a feature already?

As a workaround, we are using GitHub Actions to trigger a BuildKite pipeline to clean up our cloud infrastructure that is deployed using BuildKite? Seems a bit of a backwards approach to cleaning up on a closed event. Is there anything on the roadmap for this?

andrewdrob10 avatar Oct 04 '22 03:10 andrewdrob10