feat(420): skip re-validating an already-green identical merge tree #455

Merged
timothy merged 3 commits from feat/398-420-ci-build-once into main 2026-07-18 21:14:28 +02:00
Owner

Closes #420. (Build-once #398 was measured and rejected — see #398; this PR ships only the independent, zero-cost cross-run skip.)

What

On a merge-to-main push, if the merged tree is byte-identical to a PR head that already passed CI (green combined status), test/migrations/functional-e2e skip their heavy work — while build still runs and ships the image from that identical, already-validated tree. Implemented by mirroring the #416 docs-only pattern: a per-job revalidate detect (scripts/ci-detect-already-validated.sh) whose output ANDs into the existing docs-only step gates. No compile job, no artifacts, no branch-protection change.

Safety

build is ungated and always runs on main → no image ships unvalidated source. The script fail-safes to skip=false on any uncertainty (not a main push, no HEAD^2, differing tree, non-success/missing status, missing auth). Adversarial review: MERGEABLE, verified live against the Gitea API (skipped contexts don't drag the combined .state; a real non-identical-tree merge correctly declined to skip).

Honest hit-rate

Fires only on clean, up-to-date, un-rebased merges — this repo's routine rebase-before-merge (decisions.md treadmill) and parallel merges defeat it most of the time. A genuine but occasional win that never fires unsafely. Documented in docs/ci-cd.md.

🤖 Generated with Claude Code

Closes #420. (Build-once #398 was measured and **rejected** — see #398; this PR ships only the independent, zero-cost cross-run skip.) ## What On a merge-to-`main` push, if the merged tree is byte-identical to a PR head that already passed CI (green combined status), `test`/`migrations`/`functional-e2e` skip their heavy work — while `build` still runs and ships the image from that identical, already-validated tree. Implemented by mirroring the #416 docs-only pattern: a per-job `revalidate` detect (`scripts/ci-detect-already-validated.sh`) whose output ANDs into the existing docs-only step gates. No `compile` job, no artifacts, no branch-protection change. ## Safety `build` is ungated and always runs on `main` → no image ships unvalidated source. The script fail-safes to `skip=false` on any uncertainty (not a main push, no `HEAD^2`, differing tree, non-`success`/missing status, missing auth). Adversarial review: **MERGEABLE**, verified live against the Gitea API (skipped contexts don't drag the combined `.state`; a real non-identical-tree merge correctly declined to skip). ## Honest hit-rate Fires only on clean, up-to-date, **un-rebased** merges — this repo's routine rebase-before-merge (decisions.md treadmill) and parallel merges defeat it most of the time. A genuine but occasional win that never fires unsafely. Documented in `docs/ci-cd.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy force-pushed feat/398-420-ci-build-once from 548de1367a to 1381f9cca8 2026-07-18 17:55:53 +02:00 Compare
timothy force-pushed feat/398-420-ci-build-once from 1381f9cca8 to f7477ff9f9 2026-07-18 18:47:56 +02:00 Compare
timothy changed title from feat(398,420): CI build-once + skip re-validating identical merge trees to feat(420): skip re-validating an already-green identical merge tree 2026-07-18 18:48:37 +02:00
Author
Owner

Review-verdict: MERGEABLE @ f7477ff9f971a8f4037ccdb0fc06885c69d0ddd4

Scoped adversarial review of the #420-only diff returned MERGEABLE (no path ships an unvalidated image; fail-safe defaults verified; combined-status aggregation verified live against the Gitea API). The tip commit f7477ff9 adds only doc-nit prose (hit-rate wording + a live-verification citation) on top of the reviewed code — no logic change.

Review-verdict: MERGEABLE @ f7477ff9f971a8f4037ccdb0fc06885c69d0ddd4 Scoped adversarial review of the #420-only diff returned MERGEABLE (no path ships an unvalidated image; fail-safe defaults verified; combined-status aggregation verified live against the Gitea API). The tip commit `f7477ff9` adds only doc-nit prose (hit-rate wording + a live-verification citation) on top of the reviewed code — no logic change.
Author
Owner

Review-verdict: MERGEABLE @ dd55f00ed4

Rebased onto origin/main (resolved the append-only docs/decisions.md conflict by keeping both #457's and this PR's entries — 21 insertions / 0 deletions vs main). The workflow + script logic is byte-identical to the MERGEABLE-reviewed diff; only the decisions.md append and the doc-nit prose moved. No logic change.

Review-verdict: MERGEABLE @ dd55f00ed4823ea051a11efb89cd6d7d105dc58e Rebased onto origin/main (resolved the append-only docs/decisions.md conflict by keeping both #457's and this PR's entries — 21 insertions / 0 deletions vs main). The workflow + script logic is byte-identical to the MERGEABLE-reviewed diff; only the decisions.md append and the doc-nit prose moved. No logic change.
timothy force-pushed feat/398-420-ci-build-once from f7477ff9f9 to dd55f00ed4 2026-07-18 20:54:43 +02:00 Compare
timothy scheduled this pull request to auto merge when all checks succeed 2026-07-18 20:55:34 +02:00
timothy merged commit 2fff5fc05d into main 2026-07-18 21:14:28 +02:00
timothy deleted branch feat/398-420-ci-build-once 2026-07-18 21:14:28 +02:00
Sign in to join this conversation.