New config option: requireTestsForAutomerge to prevent race condition automerges #39581
Replies: 4 comments 4 replies
-
|
Are you using |
Beta Was this translation helpful? Give feedback.
-
|
We're facing a similar issue, but with Platform Branch Protection enabled, which gets "canceled out" by the stability days check (see #39923). I see one downside in your suggested solution: Renovate would only set automerge next time it runs. This could be improved by letting renovate initialize the status check if it's missing. I imagine something like this: {
"requiredStatusChecks": [
{
"name": "ci-build",
"createIfMissing": true
}
]
}Then, when renovate creates the MR, it could create the status check What do you think @adelaon @jamietanna ? |
Beta Was this translation helpful? Give feedback.
-
|
Might also be related: #27111 |
Beta Was this translation helpful? Give feedback.
-
|
Hi, it has been some time and I would like to get some attention here again. Let me try to explain the problem/purposed solution more clearly. In the beginning, I was talking about multiple platforms, but this actually applies only to GitLab AND it applies only when Problem: My purposed solution: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Tell us more.
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
GitHub, GitLab, 41.9.0
Problem
Currently, Renovate may automerge PRs before CI tests have started running, creating a race condition:
This defeats the purpose of having CI configured on the repository. While the repository has automated testing set up, the race condition allows merges to bypass it entirely.
Why Not Use Platform Branch Protection?
Setting up a "Require a successful pipeline for merge" (GitLab) or "Require status checks to pass" (GitHub) does not solve this issue, because:
This new config option would allow Renovate-specific control: automated PRs wait for CI, while manual merges remain flexible.
Proposed Solution
Add a new configuration option
requireTestsForAutomerge(boolean, defaultfalse) that blocks automerge until at least one CI test-related status check is present on the branch.Configuration Example
{ "automerge": true, "requireTestsForAutomerge": true }Behavior
When enabled:
ignoreTestssetting (check is skipped ifignoreTests: true)I can open a PR if you agree on this approach.
Beta Was this translation helpful? Give feedback.
All reactions