Skip to content

ci(update-docs): serialize concurrent runs that publish to MeshInspector.github.io#5989

Merged
Fedr merged 1 commit intomasterfrom
cicd/serialize-doc-publish
Apr 25, 2026
Merged

ci(update-docs): serialize concurrent runs that publish to MeshInspector.github.io#5989
Fedr merged 1 commit intomasterfrom
cicd/serialize-doc-publish

Conversation

@Fedr
Copy link
Copy Markdown
Contributor

@Fedr Fedr commented Apr 25, 2026

Summary

Add a job-level concurrency: block to the update-documentation job in .github/workflows/update-docs.yml. GitHub will now serialize all runs that publish to the MeshInspector.github.io repo through a shared group, eliminating the git push race that produces:

! [rejected]          master -> master (fetch first)
error: failed to push some refs to 'https://github.com/MeshInspector/MeshInspector.github.io'

Why

When two CI runs (e.g. two PRs merged within minutes of each other, or a push and a schedule overlapping) finish near-simultaneously, the update-docs.yml job in each:

  1. Checks out MeshInspector.github.io@master at slightly different points in time.
  2. Regenerates docs locally.
  3. Commits "Auto update docs".
  4. Tries git push.

The first push wins; the second sees the ref has moved and is rejected, failing the entire update-dev-documentation job. Observed today in run 24936234953 (job update-documentation, scheduled run on master).

Change

 jobs:
   update-documentation:
+    concurrency:
+      group: meshinspector-github-io-publish
+      cancel-in-progress: false
     runs-on: ubuntu-latest

group: meshinspector-github-io-publish — any string; same string = same concurrency group = serialized.

cancel-in-progress: false — queue, don't cancel. Every commit's docs eventually publish; the second run waits for the first one's git push to land, then runs against the already-updated remote master and pushes its own commit on top. Trade-off vs. cancel-in-progress: true:

Setting Behavior on overlapping runs Throughput
false (this PR) run B waits for run A, then publishes its own docs every commit's docs make it eventually
true run B cancels run A in flight; only B's docs publish wastes A's Doxygen + artifact-download work

For a docs-publishing pipeline where each commit's docs are individually meaningful, false is the right default. We can flip to true later if we decide we only ever care about the latest doc snapshot.

Coverage

The concurrency block lives in the called workflow (update-docs.yml), so it protects both callers:

  • build-test-distribute.ymlupdate-dev-documentation job → calls update-docs.yml (the one that hit the race today)
  • update-docs-manual.yml → calls update-docs.yml (manual workflow_dispatch)

A scheduled run, a push-to-master run, and a manual run all serialize through the same group.

What this does not fix

Concurrency serializes CI-driven publishes only. If a human directly pushes to MeshInspector.github.io@master while a CI publish is in flight, the CI publish can still race against the human push. If that ever becomes a concern, a follow-up PR can wrap the push step in a pull --rebase + retry loop.

🤖 Generated with Claude Code

When two CI runs finish near-simultaneously, both call update-docs.yml,
both check out MeshInspector.github.io@master, both regenerate docs and
commit, then both try to git push. The first push wins; the second hits
"[rejected] master -> master (fetch first)" and the workflow fails.

Add a job-level concurrency block keyed on a fixed string so GitHub
serializes the publish step. cancel-in-progress: false queues runs
behind a predecessor so every commit's docs eventually publish (we
might later switch to true if we decide we only care about the latest).

The block lives in the called workflow (update-docs.yml) so it covers
both callers: scheduled / push-to-master via build-test-distribute.yml
and manual via update-docs-manual.yml.

Observed in run https://github.com/MeshInspector/MeshLib/actions/runs/24936234953
@Fedr Fedr requested a review from Grantim April 25, 2026 19:43
@Fedr Fedr merged commit 3f06a69 into master Apr 25, 2026
35 checks passed
@Fedr Fedr deleted the cicd/serialize-doc-publish branch April 25, 2026 21:24
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.

2 participants