Repository navigation
ci(bench): never let an older measurement overwrite a newer site report - #2010
Merged
Merged
Conversation
Since #2005 the nightly owns its own workflow-level concurrency slot, so a nightly and a push run can overlap. Unioning history.jsonl by (ts, sha) keeps both rows, but the rest of the site tree (index.html, benchmark.svg, latest.json) describes exactly ONE run -- and the run that finishes LAST is not necessarily the run that measured LAST. The nightly starts at 09:17Z and takes ~2.5 h, so a merge landing mid-run publishes its (newer) push measurement first, and the nightly then copies an older report over it: the site then contradicts its own history until the next measurement lands. Gate the measurement overlay on metadata.generated_at (the harness stamp date -u +'%Y-%m-%dT%H:%M:%SZ'): a report that is not newer than the published one is skipped with a log line, while * its history row is still unioned (the measurement is never lost), and * site/mirror/** is still published -- it is checkout content, always current, so it must never be gated on report recency. Unknown or unparseable stamps on either side fall back to publishing, so an older-schema branch cannot wedge the pipeline. Reproduced on real git repos: publishing a 13:40Z report on top of a published 13:48:03Z one left index.html as the older run's page (RED); with the gate the live report and latest.json survive and the branch gains the extra row (165). The inverse case (newer stamp) still replaces the site, so the gate is not an always-skip. Tests 9/9 in ci.test_publish_bench_site, CI drift suite 486 OK. Closes #2009
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ci/publish_bench_site.pynow recency-gates the measurement overlay onmetadata.generated_at, so a report that is not newer than the one already onbenchmark-statscan never replace it. Its history row is still unioned, andsite/mirror/**is still published.Closes #2009.
Why
#2005 gave the nightly its own concurrency slot (so overlap is now possible
instead of starving the nightly), #2006/#2007 made the overlap safe on the
branch (re-read +
--force-with-lease+(ts, sha)union), and #2008serialised the Pages deployment. The remaining gap was the content of
the deployed tree:
index.html,benchmark.svgandlatest.jsondescribeexactly one run, and the publisher copied the whole measurements directory over
the published tree unconditionally.
The run that finishes last is then not necessarily the run that measured
last. The nightly starts at 09:17Z and takes ~2.5 h, so a merge landing at
10:00Z publishes its (newer) push measurement first, and the nightly can then
republish a report for an older sha: the site's
latest.jsonthen points ata sha older than one already published, while
history.jsonlcorrectly holdsboth rows — the site contradicting its own history until the next measurement
lands.
Evidence (real git, no mocks)
Bare mirror seeded from the live branch (
28d634d0, 164 rows, newest rowb7d1bdf0@2026-11-12T13:48:03Z), publisher run for a report stamped13:40:00Z:Before the fix the same scenario left
index.html= the older run's page(new test RED:
'<html>runNEW00</html>' != '<html>runOLD00</html>').The inverse case still publishes: bumping the stamp to
20:00:00Zreplaced thesite (
index-> the new page,latest_sha-> the new sha) and the row countstayed 165, so the union stays idempotent and the gate is not an always-skip.
Tests
ci/test_publish_bench_site.py, driving real git repos:older-publishes-later keeps the newer report while keeping both rows;
an undated published report never blocks a publish (old-schema branch cannot
wedge the pipeline); a stale run still publishes the mirror (mirror is
checkout content, never gated).
ci.test_publish_bench_site: 9 tests OK.(
ruff==0.12.12 format/checkclean;ci/check_python_complexity.pyclean).