Open devanubis opened 5 days ago
OK I think I've reproduced this fairly simply.
I didn't get out auto-merge workflow working, but it doesn't matter.
When I manually approved the first dependabot PR (devanubis/dependabot-race-condition#1) and merged it (@ dependabot squash and merge
) dependabot almost instantly created the next PR devanubis/dependabot-race-condition#2 from the main
branch at HEAD^ as if PR 1 had not yet merged.
The timestamps on the commits show that it did happen in the expected order:
Wed Nov 20 16:36:42 2024 +0000
Wed Nov 20 16:36:56 2024 +0000
So it's not like the 2nd PR's branch is being pre-created ahead of the 1st PR even merging (although it may have pre checked-out the main branch ?) and it's not like 14 seconds isn't enough time for that commit to actually hit the github main
branch...
So I'm fairly sure now that nothing in our private repo workflows/actions is causing this behaviour and that using dependabot is hitting some sort of race condition with itself when open-pull-requests-limit: 1
.
Is there an existing issue for this?
Package ecosystem
pip
Package manager version
poetry
Language version
python 3.11
Manifest location and content before the Dependabot update
No response
dependabot.yml content
Updated dependency
No response
What you expected to see, versus what you actually saw
Similar to #4031 and #5234.
We have a github action which marks dependabot PRs to auto-merge, if they pass our CI workflow.
When the first dependabot PR of the day successfully auto-merges, dependabot appears to create the second PR almost instantly, and that second PR gets based on HEAD^ missing the commit from the first dependabot PR, which just auto-merged.
That means we have to go around our multiple repos and
@ dependabot rebase
each of them to get them moving again,This all pretty much defeats the point of auto-merging our dependabot PRs in the first place, and also doubles up on CI workflow runs. (I've actually just added a job to fail and halt our CI if not up to date with the base branch, just to save us wasting the github actions minutes.
It also means that typically we only get 2 dependabot PRs per repository each day. We might be able to avoid that by changing our
schedule.time
and reacting quickly, but that also defeats the point of having dependabot do anything for us, we might as well have a daily task for someone to runpoetry lock
every morning and just test all our updates in one PR...We deliberately set
open-pull-requests-limit: 1
to avoid having to have multiple PRs which we needed to repeatedly rebase and run our CI workflow. (Yes that could possibly also be avoided by not requiring PRs be up to date with the base branch, but we can't disable that requirement just for dependabot nor really do I want to, we do occasionally run into dependency clashes particularly with type-checking).Native package manager behavior
No response
Images of the diff or a link to the PR, issue, or logs
No response
Smallest manifest that reproduces the issue
I'll see if I can set up a bare public repo with some generic dependencies and make dependabot reproduce this behaviour.