New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GitHub Merge Queue (merge_group
events)
#11704
Comments
There's support for PR webhook events via config repo plugins to respond to PR events, by say, dynamically generating new pipelines with materials pointing to the PR's ref. I believe it only is used/supported by https://github.com/gocd-contrib/gocd-groovy-dsl-config-plugin#support-for-branches-and-prs Lines 81 to 101 in 0f58107
Right now, GoCD has no integrated holistic support for both reacting to events and then reporting back checks - these typically happen via different plugins. I'm not super familiar with the Merge Queue, but if it just expects notifications against the commit SHA for the special branches it creates then it should work as well (or as badly) as the current support via the community https://github.com/gocd-contrib/gocd-build-status-notifier How would GoCD be anticipated to "support" merge group events from your perspective? Do you use the Groovy DSL Config Repo plugin? Basically the same as Since this seems to fundamentally relate to auto-magic PR support (dynamic pipelines corresponding to PRs), I imagine it's something that'd need to sit alongside and work with the PR event handling inside config repos. |
I'm still learning, but from what I've understood when a Merge Queue arrives at (preparing) your PR in the queue, it notifies your CI tool and wants it to perform its checks for the changes. Here's more:
|
So my problem (so far) hasn't been that I'm not getting "check status updates" back from GoCD. Rather that GoCD receives a webhook but doesn't trigger any PR pipeline job for it. Ideas welcome. |
How is your current GoCD setup configured to respond to regular PRs? Which plugins are you using? |
Ok, that plugin independently tracks PRs (probably polls the GH API for new PRs every minute or something?). It sounds to me like you want/need that plugin to handle merge group builds, rather than GoCD itself. I'm not familiar with how that plugin does its magic, but im not sure GoCD responding to webhook events will change any of the way it behaves. My understanding is that current it basically updates the material it uses on a single pipeline every time a PR is created or changes (to point to a new ref/branch). To handle merge groups I imagine that plugin would also need to use similar magic to reuse the same pipeline to build off the special merge group branch (and thus report status checks). What I'm trying to say is that the model GoCD itself uses to allow PR support via webhooks and config repo plugins is very different than the approach that this custom git material plugin takes, so anything done within GoCD itself likely won't help you, if depending on that particular plugin. |
Thanks for your thoughts I delving into this. I've opened a downstream issue for the plugin, hoping the investigation can continue there. 🤞 |
Issue Type
Summary
GitHub has somewhat recently released a feature called a "Merge Queue".
It auto-merges all queued PRs (after having made sure PRs are up-to-date/rebased with green CI checks).
However it seems it sends a custom webhook (
merge_group
instead ofpush
/pull_request
).How might this be added support for in GoCD?
See:
Steps to Reproduce
Merge/Rebase/Squash
when Merge Queue now is enabled)Expected Results
Step 5: GoCD should re-run the checks (as requested by GitHub)
Step 6. GitHub will auto-merge the PR
Actual Results
Step 5: Doesn't happen
Step 6: Doesn't happen
Possible Fix
Only
push
event seems supported:gocd/api/api-webhook-v1/src/main/java/com/thoughtworks/go/apiv1/webhook/controller/PushWebhookControllerV1.java
Lines 95 to 104 in 1e1d710
...although there seems to be some support for
pull_request
too...?gocd/api/api-webhook-v1/src/main/java/com/thoughtworks/go/apiv1/webhook/controller/validation/GitHub.java
Lines 31 to 33 in 1e1d710
The text was updated successfully, but these errors were encountered: