Skip to content

ci(bench): serialise the Pages deployment so overlapping publishers cannot lose the deploy - #2008

Merged
zackees merged 1 commit into
mainfrom
agent/pages-deploy-concurrency
Nov 12, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/pages-deploy-concurrency

Conversation

@zackees

@zackees zackees commented Nov 12, 2026

Copy link
Copy Markdown
Member

Why

benchmark-build-comparison.yml deliberately lets two runs publish at once:
#2005 gave the nightly its own concurrency: group so a merge could no longer
evict it, which means a nightly and a push run now reach the deploy-pages
job concurrently
. #2007 made overlapping publishers safe on the
benchmark-stats branch (re-read per attempt + --force-with-lease + history
union), but the deployment itself has no such protection:

GitHub's own Pages template serialises with
concurrency: {group: github-pages, cancel-in-progress: false}. This PR applies
that to the deployment job and makes it structural instead of tribal knowledge.

What

  1. .github/workflows/benchmark-build-comparison.yml — job-level
    concurrency: {group: github-pages, cancel-in-progress: false} on
    deploy-pages. Job-level (not workflow-level) on purpose: publish keeps
    running and keeps pushing history, only the deployment queues. A
    workflow-level group would also have to be shared with the measurement job,
    which is exactly what ci(bench): give the nightly its own concurrency slot, union history at publish #2005 fixed.
  2. ci/check_workflow_concurrency.py — new check_pages_rules: any job that
    runs actions/deploy-pages must declare a job-level concurrency: whose
    group: is a constant (a group containing github.run_id/run_number/sha/
    ref/head_ref serialises nothing) and must not set
    cancel-in-progress: true. A job that only uploads the artifact
    (actions/upload-pages-artifact) is not a deployment and is ignored.
  3. Comment on publish corrected to describe the lease + the deploy
    serialisation.

Proof

TDD, red first — the rule did not exist:

FAILED ci/test_workflow_concurrency.py::PagesDeployConcurrencyTests::test_deploy_job_without_concurrency_is_rejected
FAILED ci/test_workflow_concurrency.py::PagesDeployConcurrencyTests::test_per_run_pages_group_is_rejected
FAILED ci/test_workflow_concurrency.py::PagesDeployConcurrencyTests::test_cancelling_a_pages_deploy_is_rejected
3 failed, 13 passed

Then, with the rule in place and the workflow unpatched, the real repo failed
the gate — this is the defect, caught on the shipped workflow:

Workflow concurrency check failed:
  - benchmark-build-comparison.yml: job 'deploy-pages' runs actions/deploy-pages but has no
    job-level `concurrency:` block -- two overlapping runs reach it and the loser fails with
    'Deployment failed, try again later'. Add `concurrency: {group: github-pages, cancel-in-progress: false}`
exit=1

After patching the workflow:

$ uv run --no-project python ci/check_workflow_concurrency.py
OK: every pull_request-triggered workflow auto-cancels superseded runs
gate_exit=0

Full local gates (the exact commands ci-workflow-drift.yml runs):

  • python -m unittest ci.test_workflow_concurrency — 16 tests OK
    (13 pre-existing + 5 new cases: no block / shared group accepted / per-run
    group rejected / cancel-true rejected / upload-only job ignored, minus the
    repo-wide test that now covers the real file).
  • drift suite (31 modules, same order as the workflow) — 483 tests OK in 14.1 s.
  • ruff==0.12.12 format --check + ruff check on both files: clean.
  • ci/check_python_complexity.py: All checks passed!

Parsed back from the workflow itself:

workflow group: benchmark-build-comparison-${{ github.event_name == 'schedule' && 'nightly' || github.ref }}
deploy job concurrency: {'group': 'github-pages', 'cancel-in-progress': False}
publish job concurrency: None

Not done on purpose

…roup

#2005 gave the nightly its own concurrency group, so a nightly and a push run
can publish at the same time. #2007 made that safe on the benchmark-stats
branch, but the deploy-pages job still has no serialisation: Pages allows one
deployment in progress per environment, so the loser fails with "Deployment
failed, try again later" (actions/deploy-pages#406, #418) and main goes red for
a reason unrelated to the measurement.

Add a job-level concurrency group (github-pages, cancel-in-progress: false),
matching GitHub's own Pages template -- job level so `publish` keeps pushing
history while only the deployment queues -- and enforce it: a new
check_pages_rules in ci/check_workflow_concurrency.py rejects a deploy-pages job
without a shared group, with a per-run group, or with cancel-in-progress: true.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit f2ac91c Nov 12, 2026
29 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant