Repository navigation
ci: enforce the versioning invariants the manifests only documented - #1973
Conversation
The workspace version is the one fact `cargo release` moves, and `0.1.1` claimed a release that does not exist: no `v0.1.1` tag, no GitHub Release, nothing on crates.io. `0.0.0` says "not released" in the manifest itself. The first `cargo release minor --execute` makes it `0.1.0`. The internal `[workspace.dependencies]` aliases and Cargo.lock move with it. RELEASING.md states the rule, and the tag-vs-manifest check in release.yml now counts the eleven crates the workspace actually has. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS
Three repo-shape invariants were documented and enforced by nobody: - The Rust version is written in rust-toolchain.toml, Cargo.toml's rust-version and twelve dtolnay/rust-toolchain@ refs, each read by a different tool. Dependabot bumps only the action refs, so one merged bump leaves CI compiling on a different compiler from every developer. check_toolchain_pin.py refuses the sites to differ; rust-version becomes the three-part `1.95.0` so the strings compare byte-for-byte. - A member that restates `version` ships its own number, and one without `[lints] workspace = true` runs under default lint levels; neither warns. check_workspace_manifests.py refuses both, plus an internal alias whose version disagrees with the workspace's, an alias nothing depends on, and a crates/ directory missing from `members`. - Cargo enforces acyclicity only. check_crate_edges.py holds the dependency flow from CLAUDE.md as a table and keeps decdn-cli's closure free of iroh-blobs and the AWS SDK (#578). CLAUDE.md's flow paragraph was stale (bao-range and config-types edges) and is corrected from the real graph. Each is a stdlib-Python guard with a pytest suite, a `repo: local` hook and a named step in the `packaging` job. CONTRIBUTING.md's hook list is refreshed and the stale `msrv` job reference removed. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS
Release notes open with a `### Breaking` block: every commit marked with `!` or a `BREAKING CHANGE:` footer, with the footer text nested beneath the subject. A breaking commit is listed there and nowhere else, so the grouped sections carry only the non-breaking ones. `protect_breaking_commits` keeps a breaking commit whose subject fails conventional parsing — pre-launch, wire- and config-breaking changes are the ones an operator reads first, and a typo in the prefix must not hide one. The `[git]` block says why each setting is what it is. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 89.75% (2575/2869 lines) |
There was a problem hiding this comment.
🟡 Changes recommended
The toolchain pin enforcement currently ignores .yaml workflows (only matches *.yml), which undermines the stated invariant by allowing drift to bypass the guard.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR tightens release/versioning discipline in the deCDN Rust workspace by resetting the workspace to an explicit “unreleased” version (0.0.0) and adding CI + pre-commit guards (with pytest coverage) that enforce toolchain pinning, workspace manifest invariants, and the crate dependency-flow design.
Changes:
- Reset workspace + internal crate alias versions to
0.0.0until the first real release is cut, and align docs/workflows to “eleven crates”. - Add three stdlib-Python guard scripts (toolchain pin, workspace manifests, crate edges), with wrappers, pytest suites, and enforcement in the
packagingCI job and pre-commit. - Update
git-clifftemplating to surface breaking changes first and ensure breaking commits are not silently dropped.
File summaries
| File | Description |
|---|---|
RELEASING.md |
Documents the 0.0.0 pre-first-release policy and corrects crate count. |
CONTRIBUTING.md |
Refreshes hook list and documents the new repo-shape guard pattern + toolchain pin enforcement. |
cliff.toml |
Adds a dedicated “Breaking” section and refactors note rendering via a macro. |
CLAUDE.md |
Updates the documented crate dependency flow and states it is enforced by the new guard. |
Cargo.toml |
Sets workspace version to 0.0.0, makes rust-version an exact X.Y.Z, and aligns internal workspace dependency alias versions. |
Cargo.lock |
Propagates workspace version change to member packages in the lockfile. |
.pre-commit-config.yaml |
Adds local hooks for toolchain pin, workspace manifests, and crate edges. |
.github/workflows/release.yml |
Updates release-time version mismatch messaging (“eleven”) and related comments. |
.github/workflows/ci.yml |
Adds guard steps to the packaging job (toolchain pin, workspace manifests, crate edges) and updates MSRV commentary. |
.github/scripts/tests/test_check_workspace_manifests.py |
Introduces regression tests for workspace manifest invariants. |
.github/scripts/tests/test_check_toolchain_pin.py |
Introduces regression tests for toolchain pin consistency checks. |
.github/scripts/tests/test_check_crate_edges.py |
Introduces regression tests for dependency-flow enforcement and CLI closure constraints. |
.github/scripts/check-workspace-manifests.sh |
Adds a thin shell wrapper to run the workspace manifest checker. |
.github/scripts/check-toolchain-pin.sh |
Adds a thin shell wrapper to run the toolchain pin checker. |
.github/scripts/check-crate-edges.sh |
Adds a thin shell wrapper to run the crate edges checker. |
.github/scripts/check_workspace_manifests.py |
Adds the workspace manifest guard enforcing inheritance + alias invariants. |
.github/scripts/check_toolchain_pin.py |
Adds the toolchain pin guard enforcing exact X.Y.Z agreement across all sites. |
.github/scripts/check_crate_edges.py |
Adds the crate dependency-flow guard and decdn-cli closure “must-not-link” enforcement. |
.github/dependabot.yml |
Updates guidance to reflect that CI will keep action-ref bumps red until TOML pins are updated too. |
Review details
- Files reviewed: 18/19 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 82.63% (was 82.63%, ▲ +0.01%) — 76025/92001 lines No Rust files changed in this PR. History
|
GitHub Actions reads both spellings, so a workflow added under the other extension carried a site the guard never read and the hook never ran on. The scan globs both, the hook's `files:` regex accepts both, and a test holds it. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS
Toolchain pin: a `with: toolchain:` input overrides the `@ref` and is now
the step's value (an expression there is refused, not skipped); quoted
`uses:` values and composite actions under .github/actions/ are sites;
YAML comments are stripped first, so a commented-out step is neither a site
nor enough to satisfy the zero-refs floor.
Workspace manifests: a member reaching a sibling with its own `path` +
`version` bypassed the alias and packaged a version that was never
released; every internal dependency must be `{ workspace = true }`, a
crate's dev-dependency on itself excepted. An alias whose path is not a
member, and a missing workspace version, are named.
Crate edges: metadata is read with `--all-features`, so an optional
dependency cannot hide behind a feature; an empty resolve graph is a
failure, not a clean closure; a table row listing an edge the graph lacks
is rot too; build-dependencies are edges; the forbidden set covers the
whole SDK by prefix (`aws-sdk-*`, `aws-smithy-*`) without catching
`aws-lc-rs`. cargo's stderr passes through so a stale lock says so.
cliff.toml's comment on `protect_breaking_commits` described a rescue the
setting does not perform; it now says what the flag does, and the two
`chore(deps)`/`chore(release)` skip parsers move above `^chore` so they are
reachable. Docs: the guards' "nothing checks this" prose is written as
"without this check", deployment-manifest-mirror is named as bash, the
pytest suites are noted as non-gating, the pre-commit hooks re-run when
their own script changes, and CHANGELOG.md carries the PR's entry.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS
Summary
A comparison against a sibling Rust workspace showed both use the same versioning skeleton (resolver 3,
[workspace.package] versioninherited by every member, cargo-releaseshared-version+ onev{{version}}tag, git-cliff). The difference was enforcement: nothing here checked the invariants the manifests and CLAUDE.md describe. This PR adds the guards and fixes what they found.Three commits:
chore(release): read0.0.0until the first release is cut. The workspace sat at0.1.1from achore(release): v0.1.1commit that was never tagged, never released, never published.0.0.0says "not released" in the manifest; the firstcargo release minor --executemakes it0.1.0. Cargo.lock and the nine internal aliases move with it. Also fixes "twelve crates" → eleven in RELEASING.md and release.yml.ci: three stdlib-Python guards under.github/scripts/, each with a pytest suite, arepo: localpre-commit hook and a named step in the unconditionalpackagingjob:check_toolchain_pin.py—rust-toolchain.toml,Cargo.tomlrust-versionand everyuses: dtolnay/rust-toolchain@Xref must carry one identicalX.Y.Z.rust-versionbecomes1.95.0. A Dependabot action-ref bump now stays red until the two TOML sites move in the same PR (dependabot.yml comment updated to say so).check_workspace_manifests.py— every member inheritsversion/edition/license/rust-versionand[lints] workspace = true; publishable members inherit the registry metadata and carry their owndescription/readme; internal[workspace.dependencies]aliases match the workspace version and exist iff something depends on the member; everycrates/*/Cargo.tomlis inmembers.check_crate_edges.py— holds CLAUDE.md's dependency flow as a table overcargo metadata(normal deps only) and keepsdecdn-cli's closure free ofiroh-blobs/aws-sdk-s3/aws-config(CLI binary-split regression: publisher links cache crate (iroh-blobs/AWS SDK) #578). CLAUDE.md's flow paragraph was stale (missingbao-rangeonnode,bao-range+config-typesoncli) and is corrected from the real graph.CONTRIBUTING.md's hook list is refreshed (it omitted eight existing hooks) and the reference to a non-existent
msrvjob removed.chore(cliff): a### Breakingsection at the top of release notes, withBREAKING CHANGE:footer text nested under the subject;protect_breaking_commits = trueso a breaking commit with a malformed prefix is not silently dropped. The[git]block gains comments.Verification
pytest .github/scripts/tests— 101 passed.1.96.0;crates/reputationrestatingversion;decdn-cligaining adecdn-cacheedge — reported both as a forbidden edge and asaws-config ← decdn-cache ← decdn-cli).cargo check --workspace --all-targets --lockedandcargo package --workspace --no-verify --lockedpass at0.0.0.git cliff --unreleasedrenders the Breaking block; no commit appears in two sections.pre-commit run --all-filesfor the affected hooks passes;pre-commit validate-configpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01JAP9seDwFLb8kAb3TA1sPS