Expose GitHub Webhook Events, and Status Message API
under review
G
Gregory Westneat
Currently, CircleCI has the ability to build an app on the creation of a PR from a GitHub, and, as part of the build, can be directed to execute scripting that deploy builds to some platform service, like AWS.
However, there doesn’t seem to be a way to execute scripts when a PR is merged/closed. It would be incredibly useful if CircleCI could expose that (and perhaps other) webhook(s), and allow for, scripting to run after a PR branch has been closed/merged, for example to clean up a temporary deploy to a platform, such as AWS.
By way of example of the feature set I’m describing, here’s a link to Heroku’s Review Apps feature. Certainly it’s true that Heroku has a different business domain, where they are a fully fledged platform, however the feature hinges on GitHub API, for which there could be many pipeline related use cases, making it more relevant to CircleCI.
To better illustrate the virtues of the use case I am eager to solve, temporary PR deploys are valuable in order to manually confirm PR change-sets, especially where QA of frontend applications is concerned: “Does this style change work responsively?” “How does it affect “x” feature, under “y” circumstances?”
One peripheral aspect of this would be messaging a status back to the PR, with a link to the deploy. I can appreciate that the latitudes for this are something that would represent another feature enhancement to the CircleCI API, of a similar magnitude.
Realted feature requests, both about exposing GitHub webhooks / custom status messages generally, and about merge actions specifically are pretty numerouse accross the CircleCI Discuss forum. I think there’s also an argument to be made to enrich integrations with services (klike AWS and GitHub) that represent a dominant market share in their respective domains. This all amounts to a compelling argument that there is demand for this feature-set, and that it relates to a multitude of use cases. Hope you’ll consider it!
Many thanks for your continued committment to the community, and for the really awesome product!
CCI-I-177
B
Benedetta Dal Canton
Going to put directly on here a proposal for how we'd like to solve this kind of problem.
I'd love to get some feedback on whether this would work for everyone who +1'd this.
In the images below, you have a mockup of a page where you'd be able to configure your Github trigger for a pipeline.
The UI gives you options to subscribe to different types of Github events (push, pull request, issue comment), and you have some presets (the buttons) that let you select common scenarios. You can use the presets only, or opt to edit the code in the editors to express more complex conditions if you like.
In the example in the first image, the pipeline will run:
- on every push on the default branch
- whenever a PR is closed
In the second example, the pipeline will run
- if a tag is pushed
- if a non-draft PR is opened or updated, OR if the label "critical" is added to a PR
- If someone adds the comment "/circleci" to a PR
You would also be able to use the same variables you see here (for example “event.action.type”, "event.issue.pull_request.labels", ...) to express conditionals inside your config file, using the same conditional syntax available today in config.
I’d love to know from you all:
- Do you feel this addresses your use cases?
- Does the UX (using raw logical expressions + some presets) feel natural or confusing?
B
Benedetta Dal Canton
under review
B
Benedetta Dal Canton
Hi all, PM at CircleCI here.
We are currently working on a solution (for our Github App integration, specifically) that will allow for much more flexibility in deciding which Github events should trigger which workflows, including PR closed events.
I'd love some feedback on how we're thinking of approaching this. If you want to make sure your voice is heard, send me an email at benedetta@circleci.com.
Merged in a post:
Trigger workflow when PR is closed
N
Nkennedy
We deploy to our k8s cluster, in a new namespace, every time we get a new PR. It is pretty cool, but there is no simple way of doing something when a PR is closed. Right now we clean them up manually, but are planning a service that does this with a github webhook.
CCI-I-413
H
Hadas Go
+100
T
Timothy Clarke
The looks to be related to https://ideas.circleci.com/ideas/CCI-I-177
F
Francis Francis
This would be a huge improvement for our workflow.With all the CircleCI improvements around AWS/Cloud Provider support for cleaning up CI manages stacks is exceedingly necessary.
L
Lauren Biggers
It would be nice to turn off expensive tests on GitHub Draft Pull Requests.
D
Daniel Whitston
We're planning to move to per-branch builds, and the ability to tear down those builds when the branch gets deleted is vital. We may implement this with a separate GitHub hook to an AWS lambda as a workaround, but it's an indicator that maybe CircleCI isn't something we should be using for deployment.
A
Andrej Novikov
This is a necessity and a current blocker for me in using circle.
Load More
→