MEDIUM: Cancel merge group checks when queue is interrupted #66918
Replies: 5 comments 1 reply
-
GitHub doesn't automatically cancel merge group checks on queue interruption, it requires manual intervention or a custom script to cancel checks through the API using POST /repos/:owner/:repo/check-runs/:check_run_id/cancel. No direct solution exists for your specific issue |
Beta Was this translation helpful? Give feedback.
-
This is a great feature to have. Pulling a PR out of the merge queue should kill all the running checks. |
Beta Was this translation helpful? Give feedback.
-
Hi @ryanmio : To implement cancelling the run_id, how we determine the event change from merge_group back to pull_request? And how can we pass the run id context when the state changes? Appreciate ideas on this. |
Beta Was this translation helpful? Give feedback.
-
To detect a state change, you can use GitHub Webhooks listening for pull_request or check_run events. For passing the run_id, either store it in a database or use a shared cache that gets updated when the state changes. Then use this run_id to cancel the check. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Of what I can tell, when a queue is interrupted (for example, with a jumped PR, or when a PR is removed), the corresponding
merge_group
checks are not cancelled. This adds a huge amount of CI burden often at a time where it cannot be afforded. For Terraform repos, this additionally makes the problem of lock-waits exponentially worse.Beta Was this translation helpful? Give feedback.
All reactions