Skip to content

ci(docs): serialize update-docs runs and replay generated files on push races - #4401

Merged
mfazekas merged 1 commit into
mainfrom
ci/update-docs-concurrency
Oct 26, 2026
Merged

mfazekas merged 1 commit into
mainfrom
ci/update-docs-concurrency

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

Description

Fixes the failing "Update docs to maps-docs repo" run https://github.com/rnmapbox/maps/actions/runs/40208044376. Three merges landed within ~2 minutes, so their runs raced on maps-docs. The losing run's git pull --rebase -X ours hit CONFLICT (rename/rename) on the hashed Expo bundle static/example-app/_expo/static/js/web/index-<hash>.js. The rebase was never aborted, so every retry then failed with "Pulling is not possible because you have unmerged files".

  1. A workflow-level concurrency group with cancel-in-progress: true. Each run regenerates all docs from its own maps commit, so the newest main run supersedes older ones.
  2. On a rejected push, the step no longer rebases. It resets to the fetched maps-docs main, replays the paths its commit changed, and replaces static/example-app with its own export as a whole. Hand edits to other maps-docs files are kept, and old hashed bundles don't build up. This still covers pushes to maps-docs from outside the group, such as manual PRs. Even without a conflict, the old -X ours rebase kept the upstream side, so the newer run's docs were silently dropped.

expo export already empties its output dir, so a normal run doesn't leave stale bundles. maps-docs currently has a single index-*.js.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
  • I added/updated a sample - if a new feature was implemented (/example)

Component to reproduce the issue you're fixing

I tested the push step locally by extracting it from the workflow and running it against a local bare maps-docs repo. Two clones each export a differently hashed, near-identical bundle, so git detects renames. runA pushes first, then a hand edit lands on src/pages, then runB runs.

Before (current workflow): runB fails exactly like CI.

CONFLICT (rename/rename) ... index-0000.js renamed to index-aaaa.js in HEAD and to index-bbbb.js in ...
Attempt 1 failed ... error: Pulling is not possible because you have unmerged files.
All push attempts failed        runB exit: 1

After: runB retries once and publishes. The result has only runB's bundle, index.html and docs, and the hand edit is kept.

Attempt 1 failed, retrying in 10s...      runB exit: 0
docs/components/A.md: a-runB
src/pages/x.md: page1
static/example-app/_expo/static/js/web/index-bbbb.js: runB bundle
static/example-app/index.html: src=index-bbbb.js

@mfazekas
mfazekas merged commit a5ddf7a into main Oct 26, 2026
19 of 20 checks passed
@mfazekas
mfazekas deleted the ci/update-docs-concurrency branch October 26, 2026 06:20

This branch was previously deployed

1 inactive deployment
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