Skip to content

Skipped builds don't pass behind the branch's unapproved build (sc-9763) - #280

Merged
ndbroadbent merged 6 commits into
mainfrom
inherit-review
Dec 5, 2026
Merged

ndbroadbent merged 6 commits into
mainfrom
inherit-review

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Fixes the gate hole from DocSpring's review (sc-9763). DocSpring's CI skips a suite's jobs when their inputs match a run that already passed, and finalizes that suite's subset build empty on purpose (--allow-empty / empty_reason: "inputs unchanged"). That build carried the approved baseline forward and concluded unchanged / auto_approved, so its check went green, even when the branch's previous build of the suite was still waiting for review or had been rejected.

Whole suite skipped (reruns::behind)

A CI build that is subset, allow_empty (empty_reason implies it), was sent no snapshots and matched no groups now follows the newest earlier processing, completed or failed build with the same project, suite name, environment and branch, whatever its commit. If that build itself follows another, it follows the root. It reuses #273's machinery: follow sets covered_by_build_id, mirror copies the result, update_followers passes a later review on, and the check shows that build's result. A new behind_warning names the build.

  • Still processing, or review_state pending: the skipped build waits. Its check is in_progress, and it turns green when that build is approved.
  • Rejected: it is rejected.
  • Failed (state or conclusion): it fails with Build #N failed: …, the same way mirror treats any failed build it follows.
  • Superseded (reruns::superseder): the build stands for the build whose review superseded it, following the superseded_by_build_id chain and that build's root.
    • A superseding approval keeps the baseline carry.
    • A superseding rejection is followed, so the skipped build is rejected.
    • A superseding build that is pending again is followed, so the skipped build waits.
  • Approved, auto-approved, unchanged or closed (the pull request was closed): no change, and the baseline is carried forward as before.
  • The default branch counts too. A pending main build followed by a skipped main build was the same hole, and staging deploys from main.
  • Priority: same-commit covering and adopt come first, exactly as before. behind runs only when neither applies. An accidental empty build (no allow_empty) still fails with EMPTY_BUILD. A build that sent snapshots is unaffected. Builds on another branch, environment or suite never count.
  • A matched group is excluded. Its contents equal the baseline (the hash check proved it), so carrying the baseline is correct there.
  • Superseded after the skipped build started following (mirror): mirror resolves a superseded earlier build through superseder, points covered_by_build_id at the superseding build, and copies that build's result. A follower can no longer show a neutral "Superseded by #S" check, which would pass the gate. Only a superseding approval passes.

The branch's previous build was never finalized (branch_previous, adoptable, adopt_on_branch)

The branch's previous build counts even when it was sent snapshots but never finalized: still receiving, or failed unfinished (ABANDONED or run_ended). This uses #273's unfinished test without the same-commit match. A build that was never finalized and has no snapshots has nothing to review, and is skipped.

  • Still receiving with recent activity: the skipped build waits. A whole-suite skip follows the receiving build. A partial subset build waits, with the same 30-minute limit as for a processing build.
  • Quiet for ADOPT_AFTER_MINUTES, or failed unfinished: the skipped build finalizes it (reopening a failed one) exactly as Reruns: an empty rerun finalizes and follows its suite's unfinished build (DocSpring PR #1482) #273's adopt does, with adopted_on_branch_warning, and stands on its review. Its snapshots are an earlier commit's, but the skip means the suite's inputs haven't changed since.
  • When the adoption happens:
    • On finalizing (adopt, after the same-commit checks, which keep priority).
    • Before each later processing run of a build that waited, outside the build's lock (processing::run).
    • A follower of a build that gets given up on unfinished is run again (update_followers) instead of failing with "Nothing arrived".
  • Where the adopted build is queued: the API and MCP finalize handlers now call adopt themselves and queue the adopted build before their own. finalize_shard no longer adopts.
    • With the synchronous test queue, the adopted build's processing (an image diff) ran nested inside the finalize chain and overflowed the 2 MB test stack. Queued from the handler, it runs at the same depth as the handler's own build.
    • ready and started set a short cache flag, so the adopted build's conclusion doesn't run the adopting build from inside itself. That flag is the only thing wake_waiting skips. A build whose processing lock is held is still queued, because exclusive leaves a "run again" note when it's busy, so no wake is lost.

Partial subset (reruns::unreviewed_carry, keep_rejections, waits_for_previous, wake_waiting)

  • For each key a CI subset build skipped (not counting keys carried because their group matched), look up that key's row in the branch's previous completed build of the suite (or its root). If that row was changed, added or removed and not approved, the build carries it instead of the baseline. A removed row is removed here too, rather than carrying the baseline as unchanged. A previous build superseded by an approval carries the baseline. The carried row is compared with the baseline, so it is reviewed in this build. A rejected row keeps its rejection, and conclude makes the build rejected. Approved or unchanged rows keep the baseline carry. Groups holding such keys are never sourced from a baseline holder. The build gets a warning.
  • When the previous build is still processing (or receiving, or failed unfinished, until it is adopted), the subset build waits (process returns Ok(false) right after follow, before comparing anything). The previous build's BuildChanged wakes it through the existing update_the_builds_that_follow_it listener, which now also calls reruns::wake_waiting, and the sweep restarts it every few minutes.
  • After WAIT_FOR_PREVIOUS_MINUTES (30, counted from finalize), it carries what is known (the newest completed build's rows), adds unfinished_previous_warning, and concludes with hold: the conclusion is changes and the review state is pending. It is never auto_approved and never unchanged, so the check isn't a success.

Overlap with #279 (merged-pr-carry, being reworked)

Both PRs change the same parts of app/src/domain/processing.rs. Whichever merges second must keep the following from each:

  1. carry_forward: both change it to the same signature, (build, settings, store, source: &Snapshot, base: Option<&Snapshot>), with the same body (copy source's fields, compare(…, base)). The hunks are identical. Keep either.
  2. process, the carry loop (for key in keys { … carry_forward(…) }):
  3. process, building carried and the sourcing candidates:
  4. run and process, the waits:
  5. process, warnings: Merged pull requests' unreviewed changes wait for review on the base branch #279 pushes its merged-PR warnings and merge.warnings. This PR pushes unreviewed_carry_warning and unfinished_previous_warning right after settings.config_warnings(). Keep both.
  6. conclude: both add a trailing hold: bool parameter.
  7. app/src/listeners/mod.rs: this PR adds one line (wake_waiting) to update_the_builds_that_follow_it. Merged pull requests' unreviewed changes wait for review on the base branch #279 changes a different listener (record_merge's arguments). No overlap.
  8. domain/builds.rs (finalize_shard), http/api/builds.rs and mcp/mod.rs (the finalize handlers) are changed only here.

Nothing else overlaps. reruns.rs, checks.rs and the tests in app/tests/reruns.rs are only touched here, and #279's baselines.rs and groups.rs changes are only touched there.

Known inconsistency (left as is)

Take a branch whose previous build of the suite was finalized and then failed (for example, a render error), and skip the suite on the next push:

  • A whole-suite skip (behind) follows that failed build and fails too.
  • A partial subset build (unreviewed_carry) only reads rows from the newest completed build. It skips the failed one, so its skipped keys carry whatever that older build left, which may be the baseline.

So the two paths disagree after a finalized-then-failed build: the partial one can pass where the whole skip fails. This is noted for later and not changed here.

Other changes

  • The check summary for a follower on another commit explains the branch rule. not_reviewable now covers both cases.
  • Docs updated: CircleCI (the skill source), GitHub Actions, Other CI, and the API finalize section. Skills regenerated, plugin version 0.1.72, and a changelog line added.

Tests (app/tests/reruns.rs)

  • a_skipped_build_waits_for_the_review_of_the_branchs_pending_build: the skip is pending with an in_progress check and can't be reviewed; approving the earlier build turns it and a second follower green; the next skip passes on the new baseline.
  • a_skipped_build_behind_a_rejected_or_failed_build_doesnt_pass: rejected stays rejected; failed fails with Build #4 failed: boom.
  • a_skipped_build_behind_a_settled_build_carries_the_baseline: behind auto-approved, unchanged and approved builds, today's behaviour holds.
  • a_skipped_build_on_the_default_branch_waits_too_and_only_its_own_suite_counts: covers main, and checks that another branch, suite or environment doesn't count.
  • the_branch_rule_leaves_accidental_empty_builds_sent_builds_and_same_commit_reruns_alone: an accidental empty build gets EMPTY_BUILD, a sent build is compared normally, a same-commit skip goes through covering, and an unfinished same-commit build is adopted.
  • a_partial_subset_build_carries_the_branchs_unreviewed_changes: skipped changed and added snapshots are carried pending next to a sent group; rejected stays rejected; approved carries the baseline.
  • a_skipped_build_behind_a_superseded_build_follows_what_superseded_it: superseded by a rejection means rejected; superseded by a build pending again means it waits, then turns green on that build's approval; after a superseding approval, the next skip passes.
  • a_partial_subset_build_waits_for_the_branchs_previous_build: the build waits while the previous build is processing, and that build's conclusion wakes it to carry the change pending. Past the timeout it concludes changes/pending with the warning and an in_progress check.
  • a_skipped_build_finalizes_and_follows_the_branchs_unfinished_build:
    • A quiet previous build is adopted and followed.
    • An active one makes the skip wait; once it goes quiet, the skip's next run adopts it and follows it.
    • One given up on at the hour is reopened and followed, with no "Nothing arrived" error.
    • A partial subset build behind an unfinished build adopts it and carries its unreviewed change.
  • a_follower_of_a_build_superseded_later_follows_the_superseding_build: the coordinator's order (QA: VisualCI's sticky PR comment (do not merge) #2 pending, Flaky hint (sc-8709) #3 skips and follows QA: VisualCI's sticky PR comment (do not merge) #2, then PR build Screenshots: the docs home only; the gallery shows the app only #4 is rejected and supersedes QA: VisualCI's sticky PR comment (do not merge) #2) leaves Flaky hint (sc-8709) #3 rejected, following Screenshots: the docs home only; the gallery shows the app only #4, with a failure check. The same order with an approval leaves it green.
  • a_partial_subset_build_keeps_the_branchs_unreviewed_removal: a pending removal in a skipped group stays removed and pending; a rejected one makes the build rejected.
  • a_concluded_build_wakes_the_builds_waiting_for_it_but_not_the_one_adopting_it: while a build is adopting (ready, before started), the adopted build's conclusion doesn't run it. Afterwards wake_waiting queues it, and it gets processed.

The separate commit 6127b64 (the same change as PR #285, so whichever merges second gets an empty diff for it) fixes bundle_uploads::more_entries_than_declared_fail_the_build, which failed on eda9f19's CI. It passed 15 out of 15 runs locally. The bundle may unpack to no more than its declared total, and that cap is checked before each entry. The test duplicated files[0], so whenever that PNG came out a byte larger than files[1] (CI's cap was 399 bytes, an odd total), the size cap tripped before the "twice" check. It now duplicates the smaller file.

Every regression test was checked to fail with its part of the fix disabled, then the fix was restored. Checked separately: behind and unreviewed_carry off; failed-root handling off; keep_rejections off; superseder off; the wait off; hold off; unfinished previous builds ignored; the run pre-step off; mirror's superseder off; removals not carried; the wake_waiting adopting-flag guard off. After rebasing onto main (#273 merged as f6de347), the full --test app run passed: 431 tests. cargo clippy --all-targets -- -D warnings and cargo fmt --check are clean.

ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…ges; late approvals reach main

- A held merge-commit build (it stopped waiting for the head build) concludes "changes", pending (a rejected carried
  change taking precedence, as in #280), so its check waits for review instead of passing.
- A pull request build approved after the merge webhook copies its approvals to the base branch at the merge commit
  (baselines::reach_merges, the same copy as record_merge), so the merge commit's build and main's later builds
  compare with them.
- from_merges no longer skips approved rows: one record_merge copied equals main's base and drops out; one main never
  got is carried and approved at the merge commit under the pull request's review (approve_merged), the build
  concluding approved.
- finished() logs a failure to wake waiting merge-commit builds instead of skipping the head build's check and
  billing.
- Tests: the held build's check, a late approval, and an approved version main never got.
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…build never overrides the head's

copy_merged_approvals takes, per snapshot, the approval of the newest build that approved it (build id, then
approval id), and none when a newer build up to the head changed it again: approving superseded builds late copies
neither a stale version over the head's approval nor over a newer change still waiting for review. The rejected arm
in conclude is unreachable here and kept identical to #280's; a comment says why.

Tests: the reviewer's probe (f2 approved and merged, f1 approved late, main's next build of f2's version unchanged),
and the head's change unreviewed (main's next build of f1's version still changed).
@visualci-com

visualci-com Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #1302 · 4 changed, 569 unchanged · approved by visualci coordinator agent (MCP) for Nathan Broadbent

#280's own changelog entry: the changelog page gains one line.

This PR vs base: nothing since #1225, across 3 builds

Snapshot What changed Close-up: before → after
screenshots/changelog/1440-dark (changed)
before · after

Content below here moved
screenshots/changelog/1440-light (changed)
before · after

Content below here moved
screenshots/changelog/390-dark (changed)
before · after

Content below here moved
screenshots/changelog/390-light (changed)
before · after

Content below here moved

docspring/visualci · journeys · build #1298 · 53 unchanged · no changes

This PR vs base: 18 changed, 6 added, 3 removed since #1154, across 5 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

ndbroadbent added a commit that referenced this pull request Dec 5, 2026
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…ges; late approvals reach main

- A held merge-commit build (it stopped waiting for the head build) concludes "changes", pending (a rejected carried
  change taking precedence, as in #280), so its check waits for review instead of passing.
- A pull request build approved after the merge webhook copies its approvals to the base branch at the merge commit
  (baselines::reach_merges, the same copy as record_merge), so the merge commit's build and main's later builds
  compare with them.
- from_merges no longer skips approved rows: one record_merge copied equals main's base and drops out; one main never
  got is carried and approved at the merge commit under the pull request's review (approve_merged), the build
  concluding approved.
- finished() logs a failure to wake waiting merge-commit builds instead of skipping the head build's check and
  billing.
- Tests: the held build's check, a late approval, and an approved version main never got.
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…build never overrides the head's

copy_merged_approvals takes, per snapshot, the approval of the newest build that approved it (build id, then
approval id), and none when a newer build up to the head changed it again: approving superseded builds late copies
neither a stale version over the head's approval nor over a newer change still waiting for review. The rejected arm
in conclude is unreachable here and kept identical to #280's; a comment says why.

Tests: the reviewer's probe (f2 approved and merged, f1 approved late, main's next build of f2's version unchanged),
and the head's change unreviewed (main's next build of f1's version still changed).
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…63); plugin 0.1.72

A CI subset build finished empty on purpose (allow_empty or empty_reason, no snapshots sent, no matched groups)
follows the branch's newest earlier finalized build of its suite and environment, whatever its commit (default
branch included), when that build isn't settled-good: processing or pending waits and turns green on approval,
rejected stays rejected, failed fails (as reruns::mirror does). Approved, auto-approved, unchanged, superseded and
closed keep today's baseline carry. Same-commit covering/adopt keep priority; accidental empty builds still fail.

A partial subset build carries, per skipped key, the branch's previous build's unapproved changed/added row instead
of the baseline (reruns::unreviewed_carry), compared with the baseline and reviewed here; a rejected row keeps its
rejection. carry_forward takes a source and an optional base (same shape as PR #279).
…bsets wait for the branch's processing build (sc-9763)

A superseded earlier build stands for the build whose review superseded it: only a superseding approval keeps the
baseline carry; a rejection is followed (rejected), a superseding build still pending is followed (waits).

A CI subset build whose branch's previous build of the suite is still processing waits, processing, until it
concludes (woken by BuildChanged, restarted by the sweep), for WAIT_FOR_PREVIOUS_MINUTES (30). After that it
carries what's known from the newest completed build and concludes pending with a warning, never auto_approved.
…llowers follow what superseded; unreviewed removals carry (sc-9763)

- The branch's previous build may be one sent snapshots but never finalized (receiving, or failed unfinished):
  a CI subset build finalizes it like reruns::adopt (quiet for ADOPT_AFTER_MINUTES, or given up on) and stands on
  its review; while it's still receiving, it waits. Adopted on finalizing (the API and MCP handlers queue it first,
  so a synchronous queue processes it no deeper than the build itself), or before a later run of a build that waited.
  A follower of a build given up on unfinished runs again rather than failing with it.
- mirror resolves a superseded earlier build to the build that superseded it and re-points covered_by_build_id at
  it: only a superseding approval passes.
- unreviewed_carry carries a pending or rejected removal as removed, and applies superseder (superseded by an
  approval: the baseline stands).
…ves a note to run it again); only the adopting build is skipped (sc-9763)
@ndbroadbent
ndbroadbent merged commit e486a2f into main Dec 5, 2026
17 checks passed
@ndbroadbent
ndbroadbent deleted the inherit-review branch December 5, 2026 10:53
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
… the branch's unreviewed one; behind() stands aside at a merge commit; an auto-approved previous build carries nothing unreviewed
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…overed stands over the branch's unreviewed version and its rejection; behind() still shows a failed build at a merge commit
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
… the branch's unreviewed one; behind() stands aside at a merge commit; an auto-approved previous build carries nothing unreviewed
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…overed stands over the branch's unreviewed version and its rejection; behind() still shows a failed build at a merge commit
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…provals both decide the review; the changelog line is an entry file; no plugin version
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…branch (#279)

* Merge commits: a CI build that skipped the pull request's jobs takes their snapshots from the pull request's newest build, so changes merged without a review wait for one on the base branch (DocSpring PR #1326)

* Merge commits with #280: a merged pull request's version comes before the branch's unreviewed one; behind() stands aside at a merge commit; an auto-approved previous build carries nothing unreviewed

* Merge commits with #280, review: what a merged pull request's build covered stands over the branch's unreviewed version and its rejection; behind() still shows a failed build at a merge commit

* Merge commits: the changelog line becomes an entry file (#290)
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…provals both decide the review; the changelog line is an entry file; no plugin version
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…provals both decide the review; the changelog line is an entry file; no plugin version
ndbroadbent added a commit that referenced this pull request Dec 5, 2026
…ontent twice; approved_elsewhere finds the branch's own (DocSpring PR #1487) (#289)

* Carried approvals: a rebased branch's CI build carries its earlier approval of identical content; approved_elsewhere finds the branch's own (DocSpring PR #1487)

Added snapshots never found an earlier approval on their own branch: approved_elsewhere
excluded the build's own branch (bl.branch <> b.branch), and after a rebase the anchor is
main's newer build, so the branch's older approval rows no longer count as baselines.
Changed pages passed only through compare's exact-image check, which needs a base.

- approved_elsewhere: any other build of the suite, this branch included; an approval a
  later build of its branch rejected for the same content is no longer shown.
- domain::carried_approvals: in the conclusion's transaction, a CI build carries an earlier
  approval on the same branch, suite and environment for added snapshots with the same
  fingerprint, and changed ones with the same head and base fingerprints. Rows have
  approval 'carried' with the original approver and review id. Rejections, withdrawn
  approvals and approvals superseded by a later rejection don't carry.
- conclude: a build whose every change carried concludes approved.
- Docs (agents.md, design.md), changelog, skill regenerated, plugin 0.1.73.

* Carried approvals after #280 and #290: kept rejections and carried approvals both decide the review; the changelog line is an entry file; no plugin version

* Carried approvals: conclude's comment names them

* Carried approvals after #279: one 'approved' rule for merged and carried approvals; the test helpers keep main's jest and missing-file builds beside start/finish
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.

1 participant