Repository navigation
fix(deploy): compare the live commit by content, so a rewritten release candidate is not sent to the manual gate - #218
Merged
Conversation
…se candidate is not sent to the manual gate
release-plz force-updates the release candidate's branch, so the commit that is live is usually not in the next candidate's history. The classifier failed closed on that ("not an ancestor", or "not a commit in this checkout"), and sent two real staging deploys (runs 43796746005 and 43803593395) to the manual gate with no Durable Object change in either.
- classify-deploy.sh compares the two commits by what they hold, the migration files and the `[[migrations]]` tables, whichever way their histories run. It still defers a deploy of OLDER code than what is live (a strict ancestor of it), which was one case of "not an ancestor" and is a person's decision, and now also a checkout too shallow to say which is older. The reason says when the two were compared by content alone.
- deploy-worker.sh asks origin for the live commit by its sha when no branch of the checkout holds it, with no secret. GitHub serves a commit no branch holds to an anonymous fetch; when it cannot be had the classifier says so and the deploy goes to the gate as before.
- The classifier's test now takes every ordered pair of a history with side lines (older deploys, diverged commits, sibling release commits, a shallow clone), the expected answer worked out from a hand-written parent table and state labels, not from git. The deploy script's test fetches a commit that only an origin's object store holds, and has its `git` report the secrets it can see, as the fakes do. That shim found a git call of this change that ran with every secret in its environment.
- deploy.md, cicd.md, ADR-0110 and G-36 say what is tested and that it has not yet run on staging.
Refs: #49
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 16, 2026
…se tag pattern, and check both ends (#222) release-pr has failed on main since #211: `cannot find package "thrust-edge" in workspace`. Every crate finds its previous version from the one tag v<version>; release-plz 0.4.3 then rebuilds that tag's workspace and looks the crate up in it (next_ver.rs, process_git_only_package), and thrust-edge is not in v0.2.0. A crate is treated as a first release only when no tag matches its pattern. - release-plz.toml: thrust-edge gets git_tag_name = "thrust-edge-v{{ version }}", which matches no tag. The header says why, and that the pattern goes once a release contains the crate. - check-release-plz.py: a git_tag_name may only be the entry's own first-release pattern, and never on the tagger. New --first-release, against the highest v<major>.<minor>.<patch> tag, comparing package names (a moved crate is not new): - `required`: every crate the tag lacks has its pattern. Run by ci.yml's deps job, whose checkout now fetches the tags. - `exact`: and no crate the tag has keeps one. Run by release-plz.yml's release-pr job before release-plz. It is not run in deps, where from the tag of a release to the pattern's removal it would fail every pull request, and main's run of the release commit. - cicd.md: "A new crate", and how it was verified. Verified with release-plz 0.4.3 on clones of main: - at #218: release-plz update exits 1 with the CI error on main's config; with this one it exits 0 and proposes 0.2.1 with #211's feature in the changelog. The candidate's Cargo.lock passes cargo metadata --locked. A first release's own commits do not set the bump (a feature alone proposed the patch). - at #221 (every crate moved, ADR-0009): the same error on main's config. With this one, exit 0 and nothing to propose: release-plz counts a crate's commits by its current directory, so #211's feature (made under crates/thrust-edge) no longer counts and the move is a chore. #211's feature reaches a changelog only through a release made by hand. - then a fix(edge) commit proposes 0.2.1. With v0.2.1 tagged and a second fix: with the pattern kept, 0.2.2's section lists the first fix (and the move) again, and --first-release exact refuses it; with it removed, only the second fix, and exact passes. - on this repository: --first-release required refuses main's release-plz.toml (thrust-edge only: the moved crates are found in v0.2.0 by name) and passes with this one; exact passes. - test_check_release_plz.py: 151 passed, over generated git histories for every crate. Nine hand mutants of the checker (name-order or pre-release tags as the last release, exact never or always refusing, any pattern value accepted, the tagger's pattern allowed, no tag passing, crates compared by directory, a patterned crate still required) each fail it. - lint-all-workflows.sh, actionlint, test-lint-all-workflows.sh, test-lint-workflow.sh, test-required-contexts.sh and test_plan_ci.py (5013) pass. Not verified: actions/checkout with fetch-tags at depth 1 on the runner. Its source at the pinned commit adds +refs/tags/*:refs/tags/* to the fetch; this pull request's deps job is the check. Refs: #195 Co-authored-by: Claude Opus 5.5 <[email protected]>
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 this does
The two real staging runs that stopped at the manual gate with no Durable Object change in them (43796746005, "not an ancestor", and 43803593395, "not a commit in this checkout") were stopped by the classifier, not by anything a person had to decide. release-plz force-updates the release candidate's branch, so the commit that is live is usually in no branch's history any more. This was written up in #210 and left unfixed. This fixes it.
"Compared" is what it was: the files under the migrations directory (a difference runs the expand step) and the
[[migrations]]tables of the deploy template (a difference is a Durable Object lifecycle change and goes to the gate). A difference in either direction means the same, so neither commit has to descend from the other. What the ancestry check never protected is the schema:migrate's ledger (#195) already refuses a diverged or out-of-order build and applies nothing for an older one.Checked
634f649…, the tiprc/2026-11-16T02-58-22Zhad until release-plz force-updated it a few minutes earlier, by its full sha into an empty repository, anonymously: it came (ls-remotelisted no ref naming it). The control, a sha that exists nowhere, was refused withnot our ref. The repository is public; if it were not, the fetch would fail and the deploy would go to the gate as before.test-classify-deploy.sh: 196 ordered pairs over a 14-commit history (a main line, a side line off c2, two siblings off c4); the expected answer is worked out from state labels and a hand-written parent table, not from git (older deploys are both-true; every other pair is "the labels differ"). Plus: sibling release commits (the case of the two runs) arefalse/false, a short sha of the same commit is not "older", and a shallow clone that a full checkout calls "no change" goes to the gate. 419 checks, under bash and dash.test-deploy-worker.sh: a diverged live commit that differs in nothing is deployed, not deferred; a live commit that only an origin's object store holds is fetched and then deployed; one nobody can fetch is deferred, and the log says it tried; a deploy of older code is deferred. 160 checks, under bash and dash.main) fails the new classifier test (18 bad). 9 more hand mutants ofclassify-deploy.sh(no older-code gate, ancestry reversed, same commit not exempt, short sha not resolved, no shallow check, diverged sent to the gate again, lifecycle never changes, migrations never change, reason not saying "by content") each fail it. 4 mutants ofdeploy-worker.sh(live commit never fetched, the fetch run with every secret, the presence check run with every secret, a failed fetch not reported) each fail its test (the last one first survived: the test's log check matched the classifier's own words, so it now matches the deploy script's line). The driver is not committed, as for the earlier mutants (G-36).gitshim intest-deploy-worker.shreports the secrets each process can see, as the fakes do. It showed the first version'sgit cat-filecheck running with every deploy secret in its environment (read-only and local, but against this script's rule that each child gets only what it needs). It runs throughplainnow.mdbook buildhas noERRORline, and the new anchor exists in the built page.Not shown
git merge-base --is-ancestor(a status other than 0 and 1) as "cannot tell" needs a corrupt repository to reach; it is not tested. It fails closed.Changed
.github/scripts/classify-deploy.sh,scripts/deploy-worker.sh, the two tests, and the docs that described the gap:deploy.md(a new section, "What the deploy compares with what is live"),cicd.md, ADR-0110 (a new update; the round-30 text and the previous update are left as they were), and G-36. No workflow changed.Refs #49 (closed). Separate from #213, which only fixes a line of
cicd.md.🤖 Generated with Claude Code