Repository navigation
app/: empty CI builds from reruns of failed jobs show the earlier build's result (sc-9044) - #161
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #419 · 392 unchanged · no changes This PR vs base: 16 changed, 31 added since #274, across 4 builds docspring/visualci · journeys · build #415 · 30 unchanged · no changes This PR vs base: 16 changed, 2 added since #273, across 4 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
ndbroadbent
force-pushed
the
app-empty-rerun-builds
branch
from
December 4, 2026 04:29
5a9c0b5 to
c96b23a
Compare
ndbroadbent
force-pushed
the
app-empty-rerun-builds
branch
from
December 4, 2026 05:20
c96b23a to
f0d7b6b
Compare
…s that build, so reruns of failed jobs pass (sc-9044)
ndbroadbent
force-pushed
the
app-empty-rerun-builds
branch
from
December 4, 2026 05:50
f0d7b6b to
abbc73c
Compare
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.
Fixes sc-9044.
The bug
A CI that keys each suite's build on the workflow (
--nonce "$CIRCLE_WORKFLOW_ID-pdf", or$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT) gets a new build for every suite when a workflow is rerun from failed. Only the failed jobs run in the new workflow, so a suite whose jobs passed the first time gets a build that is sent nothing. It failed with "No snapshots were sent", and its check ("VisualCI: pdf") turned red on a PR whose CI passed (DocSpring PR #1466, build #12).The fix
A CI build that was sent no snapshots, on a commit an earlier build of its suite already compared, follows that build (new column
builds.covered_by_build_id, moduleapp/src/domain/reruns.rs):reruns::follow, called at the top ofprocessing::process) finds the earlier build. That's the newest earlier CI build with the same project,name, environment, commit and branch, finalized (processing or completed), not itself an empty failure (error = EMPTY_BUILD), and not following another build. So reruns always point at the original build, never at each other.superseded_by_build_id. A failed earlier build makes it fail, with "Build #N failed: …". It gets the warning "No snapshots were sent in this run; build #N already covers this commit (a rerun of failed jobs?), so this build shows its result." It writes no snapshot rows, so nothing counts as removed.BuildChangedlistener (update_the_builds_that_follow_it) copies the earlier build's result onto its followers whenever it changes: when it's reviewed, superseded, closed or reopened. Each changed follower gets its ownBuildChanged, so its check, live streams and CLI--waitupdate too. Followers never have followers of their own, so this can't loop.forge/checks.rs):check_foron a follower builds the earlier build's check (state, title, summary, link) under the follower's name and commit. The title ends "(build #N)", and the summary starts by explaining the rerun. GitHub treats the newest check run of a name on a commit as the check, so the suite's check shows the original result, not "No snapshots were sent".check_stateitself is unchanged.reviews::reviewrefuses and says to review build #N). The PR comment's "newest build per suite" skips followers.reopen_branchreopens the earlier build rather than a follower, and the listener then reopens the follower.Decisions
processing(withcovered_by_build_idset and the warning) and concludes when the earlier one does, through the listener. Its check mirrors the earlier one's "Processing" meanwhile. If the earlier build never finishes, the sweep's existing 6-hour give-up fails both. A build that is still receiving (never finalized) doesn't count. It would most likely be abandoned, and the empty build then fails as it does today.--allow-empty: doesn't matter for a build that something covers. An earlier build's real result for the same commit is a better answer than an empty comparison or a carry-forward from an ancestor, and a customer who always passes--allow-emptygets the same behaviour on reruns. With no earlier build,--allow-emptybehaves as before, and so does an empty build without it: it still fails with "No snapshots were sent".Docs
The CircleCI page gets a new "Rerunning failed jobs" section, and the GitHub Actions page a "Re-running failed jobs" section. The Other CI providers page (Parallel jobs) and the CLI reference's
build finalizetext explain the exception to "No snapshots were sent".skills/is regenerated, and the plugin is bumped to 0.1.54.Tests
New
app/tests/reruns.rs, through the CI API against Postgres and the blob store:an_empty_rerun_shows_the_result_of_the_build_that_covers_its_commit: VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1 pdf on c1 passes. QA: VisualCI's sticky PR comment (do not merge) #2, an empty pdf build on c1 with another nonce, concludes with VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1's conclusion and review state, passes, carries the warning, writes no snapshot rows, and its check passes with "(build VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1)". A second rerun follows VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1 too, and so does one finalized with--allow-empty.an_empty_rerun_waits_for_the_review_of_the_build_that_covers_it: VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1 on a feature branch waits for review, so QA: VisualCI's sticky PR comment (do not merge) #2 is pending too and its check is in progress. Reviewing QA: VisualCI's sticky PR comment (do not merge) #2 directly is refused. Approving VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1 approves QA: VisualCI's sticky PR comment (do not merge) #2, and QA: VisualCI's sticky PR comment (do not merge) #2's check passes.an_empty_rerun_of_a_build_still_processing_concludes_when_it_does: QA: VisualCI's sticky PR comment (do not merge) #2 waits in processing until VisualCI tests itself: screenshots, component and JSON snapshots from a visual CI job (sc-8336) #1 is processed, then concludes with its result.an_empty_build_with_no_earlier_build_of_its_suite_and_commit_still_fails: another suite, another commit or another branch fails with "No snapshots were sent" (failure check), and an empty build doesn't cover a later one.Gates (on the build pool, own Postgres 17 container):
cargo fmt --all --check,cargo clippy --locked --workspace --all-targets -- -D warningsandcargo test --locked --no-fail-fast -p visualci-appall pass, the 4 new tests included. In frontend/:node scripts/skills.mjs --check,pnpm buildandpnpm test(52 tests) pass.Not merged: Nathan merges under the main-merge lock, after the VisualCI build review.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.