Skip to content

fix(ci): handle concurrent update-docs runs#4235

Merged
mfazekas merged 1 commit into
mainfrom
fix/update-docs-concurrent-push
Jun 28, 2026
Merged

fix(ci): handle concurrent update-docs runs#4235
mfazekas merged 1 commit into
mainfrom
fix/update-docs-concurrent-push

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

When two pushes to main trigger update-docs concurrently, the second run's git stash pop fails: the first run already pushed the same binary files (PNGs) to maps-docs, so git can't restore untracked files from the stash on top of them. || true hid the error but left the repo in a broken state, causing the commit to find nothing to commit → exit 1.

Fix: drop the stash entirely. Instead, commit the generated files first, then git pull --rebase -X ours origin main (which replays our commit on top of the latest remote, taking our freshly generated version for any binary conflicts), then push. A 3-attempt retry loop handles the residual race where another run pushes between our pull and push.

Reproducer

Two pushes to main in quick succession (e.g. a merge + version bump) each spend ~3min generating docs, then race to push to maps-docs. Example failing run: https://github.com/rnmapbox/maps/actions/runs/28312708283/job/83880193652

When two pushes to main trigger update-docs simultaneously, the second
run's `git stash pop` fails because the first run already pushed the
same binary files (PNGs). Replace stash/pull/pop with commit-first
then `git pull --rebase -X ours` so binary conflicts resolve in favor
of the freshly generated files, plus a retry loop for the residual race.
@mfazekas
mfazekas merged commit 88d5d18 into main Jun 28, 2026
7 checks passed
@mfazekas
mfazekas deleted the fix/update-docs-concurrent-push branch June 28, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant