Skip to content

ci(pages): publish the site when the benchmark fails (#1825) - #1854

Merged
zackees merged 1 commit into
mainfrom
agent/mirror-deploy-decouple
Nov 2, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/mirror-deploy-decouple

Conversation

@zackees

@zackees zackees commented Nov 2, 2026

Copy link
Copy Markdown
Member

Fixes item 1 of #1825 (follow-up from the #1815 review).

Problem

site/mirror/** reaches GitHub Pages only through benchmark-build-comparison.yml,
and the publish job was gated on needs.benchmark.result == 'success'. A
broken/slow ESP32-S3 benchmark therefore froze every mirror update — even though
the mirror has nothing to do with the measurement.

Why not "a second, independent publisher"

Pages deploys replace the entire site, so two publishers would clobber each
other (mirror-only deploy would drop the benchmark report, and vice versa). The
site stays assembled by exactly one job; the fix makes that job tolerant of a
missing measurement instead of dependent on one.

Change

publish now runs whenever the benchmark job is finished, not when it
succeeded (if: ${{ !cancelled() && github.ref == 'refs/heads/main' }}), and:

  • seeds the site from the last published benchmark-stats branch
    (ls-remote → fetch --depth=1 → reset --hard FETCH_HEAD), so index.html
    / latest.json survive a failed benchmark;
  • overlays the benchmark artifact only when
    needs.benchmark.result == 'success' (the download step is now conditional);
  • always overlays the checked-out repo/site/mirror/, so the workflow copy wins
    over the mirror snapshot inside the benchmark artifact;
  • skips the branch push when the assembled tree is unchanged
    (git diff --cached --quiet), so a no-op run never rewrites history.

deploy-pages keeps needs: publish and now says so explicitly
(if: needs.publish.result == 'success'). Trigger paths, ci.toml contract,
concurrency, and the benchmark job itself are untouched.

Tests

New ci/test_benchmark_publish.py (7 tests) asserts the wiring: no
result == 'success' on the publish gate, artifact download conditional, last-good
seeding ordered before the mirror copy, single assembler, deploy-pages needs
only publish, and no-op publish cannot push. Registered in
.github/workflows/ci-workflow-drift.yml and ci/local_gate.py (a guard nothing
runs is decorative).

$ uv run --with pyyaml --no-project python -m unittest ci.test_benchmark_publish
Ran 7 tests in 0.062s
OK
$ uv run --with pyyaml --no-project python -m unittest <8 drift modules>
Ran 80 tests in 1.432s
OK
$ uv run --no-project ruff check ci/test_benchmark_publish.py
All checks passed!
$ uv run --no-project python ci/check_python_complexity.py
All checks passed!
$ uv run --with pyyaml --no-project python ci/render_workflows.py --check   # rc 0
$ uv run --with pyyaml --no-project python ci/check_workflow_concurrency.py
OK: every pull_request-triggered workflow auto-cancels superseded runs

E2E of the exact run: block against a local bare repo (scratch/mirror-deploy-e2e/run_e2e.py,
no network), 3 scenarios:

  1. first publish with measurements → branch = index.html, latest.json,
    mirror/manifest.json; the workflow's mirror copy wins over the artifact's.
  2. benchmark FAILED (no artifact) → previous report kept, mirror updated,
    branch advanced (d7c1fa5..280a60d) — this is the case that used to freeze the site.
  3. unchanged tree → No site changes to publish., branch sha unchanged (2 commits total).

No Rust changed, so bash test was not run.

Shadow-mode note: this only removes the cross-failure coupling; nothing about the
benchmark itself, board coverage, or trust of the measurements changes.

@coderabbitai

coderabbitai Bot commented Nov 2, 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 2, 2026
Merged via the queue into main with commit ec6ba56 Nov 2, 2026
29 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 3, 2026
@zackees
zackees deleted the agent/mirror-deploy-decouple branch November 5, 2026 05:51
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.

2 participants