ci: fail release PR integrity on a lagging Cargo.lock - #2312
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 017bcc1b56
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if locked.get(package["name"]) != version: | ||
| stale.append(f"{package['name']}: Cargo.toml {version}, Cargo.lock {locked.get(package['name'], 'missing')}") |
There was a problem hiding this comment.
Validate lock consistency instead of only package versions
When the allow-listed root Cargo.toml changes a dependency constraint, patch, or resolver setting such that the existing resolution is stale, this loop still succeeds as long as each local package retains the same version. The release integrity check can therefore approve a lockfile that Cargo must update, recreating the broken locked-build outcome it is intended to prevent; validate the checked-out manifests and lock through Cargo's resolver rather than a name/version source-shape scan.
AGENTS.md reference: AGENTS.md:L172-L177
Useful? React with 👍 / 👎.
| # The master break after the 1.0.0-beta.56 release merge: the workspace | ||
| # version moved but the lock still recorded the inheriting members at beta.55. |
There was a problem hiding this comment.
Describe the invariant instead of the historical incident
This comment anchors a durable regression test to a specific master incident and beta release, so it becomes stale release-history narration rather than explaining why the fixture matters. Rephrase it around the invariant that workspace-inherited versions must agree with their lock entries, leaving the incident provenance in commit history.
AGENTS.md reference: AGENTS.md:L195-L197
Useful? React with 👍 / 👎.
Release PR #2288 (1.0.0-beta.56) merged with a
Cargo.lockstill at 1.0.0-beta.55, breaking every--lockedbuild on master (fixed by #2311).Why the lockfile step was skipped: release-please regenerates the release branch as a single fresh commit on every master push, which drops the previous
chore(release): update root lockfilecommit. The refresh step does run on updates (prs_createdis true for updated PRs too in release-please-action v5), but only once the Release Please run gets a runner. The PR stays ready for review after its first refresh, so every regeneration opens a window with a lagging lock. #2288's only commit was a regeneration pushed 83 seconds before the merge, with the runner starved.Change:
scripts/check-release-pr-integrity.sh, which theRelease PR integrityworkflow loads from the trusted base, now compares each local package's manifest version (resolvingversion.workspace = true) with its source-lessCargo.lockentry and fails on any mismatch. It reads TOML withpython3tomllib and needs no cargo or vendored sources. The same script is the local check before a manual release merge (scripts/check-release-pr-integrity.sh origin/master HEADwith the PR head checked out). CI's existingcheck-release-pr-integrity.sh HEAD HEADstep also runs it on every PR, which catches a lagging lock on master.Evidence (local):
tests/release_pr_integrity_test.shadds the literal beta.55/beta.56 workspace case. It passes with this guard and fails against origin/master's guard:a lock lagging the workspace version must fail: expected failure, but the command succeeded.actionlinton release-pr-integrity, release-please, and ci workflows: exit 0.Still open: master has no branch protection or required checks, so a failing
Release PR integrityflags a release PR but does not block its merge. Making the check required is a repository-settings decision.