Skip to content

feat(release): publish checkpoint-template as the crates.io canary - #508

Merged
d-oit merged 3 commits into
mainfrom
feat/publish-crates-io-canary
Nov 13, 2026
Merged

d-oit merged 3 commits into
mainfrom
feat/publish-crates-io-canary

Conversation

@d-oit

@d-oit d-oit commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Summary

Publishes checkpoint-template 0.1.0 to crates.io and makes it the single allowlisted package, so the trusted-publishing lifecycle is exercised in production instead of remaining an empty, never-executed path.

Dogfooding the first real publish surfaced four defects that an empty allowlist had hidden:

  • No crate shipped a LICENSE file, though every Cargo.toml listed one in include. Every package silently dropped its license. Fixed by adding crates/*/LICENSE.
  • Workspace metadata was still placeholders — Your Name, your-org/your-repo, and a docs.rs/your-crate link — which would have been baked permanently into the crates.io listing. template_init rewrites authors/repository/homepage from the adopter's answers, so real baseline values preserve portability. The unreferenced documentation key is dropped rather than pointed at a crate that does not exist.
  • The release contract test was vacuous. It demanded exit 0 from release-publish with no token, which only passed because the allowlist was empty. With a real package the command correctly fails closed. The test now asserts the invocation parses — exit 2 and unrecognized arguments are the failure modes it exists to catch — and keeps the zero-exit requirement for config-only commands.
  • mcp-server-template is already taken on crates.io by another owner, so it is deliberately left publish = false.

Production evidence

  • Published: checkpoint-template 0.1.0 (cargo publish, from a committed tree — the dirty-tree guard is correct and was respected).
  • Live: crates.io API reports max_version 0.1.0, license MIT, repository https://github.com/d-oit/rust-2026-template, publisher d-oit.
  • Trusted publisher registered and verified: id=33687 d-oit/rust-2026-template workflow=release.yml environment=release.
  • docs.rs/checkpoint-template/0.1.0 builds and renders (HTTP 200).
  • README renders on crates.io, and the packaged .crate now contains LICENSE.
  • Consumed from the registry by an external crate: the README quick-start compiles and round-trips state (Loaded: Some(AppState { counter: 42, name: "demo" })).
  • release-publish is idempotent in production: re-running skips the live version and exits 0.

Verification

  • ./scripts/quality-gates.sh — all 20 checks pass.
  • tests/trusted_publishing_contract_test.sh and tests/trustpub_cli_test.sh pass; non-vacuity confirmed by reverting the workflow to the broken --root ordering, which exits 2.

Follow-up (cannot be done from CI)

The release environment does not exist yet and creating it needs repository admin, so the OIDC publish_crates job is still gated on that manual step before the first tagged release. Documented in docs/src/releasing/crates-io-trusted-publishing.md.

Publish checkpoint-template 0.1.0 to crates.io and make it the single
allowlisted package, so the trusted-publishing lifecycle is exercised in
production instead of remaining an empty, never-executed path.

The first publication dogfood exposed four defects that an empty allowlist
had hidden:

- No crate shipped a LICENSE file even though every Cargo.toml listed one in
  `include`, so every package silently dropped its license.
- The workspace metadata still carried the `Your Name` / `your-org/your-repo`
  / docs.rs placeholder values, which would have been baked permanently into
  the crates.io listing. `template_init` rewrites authors, repository, and
  homepage from the adopter's answers, so real baseline values do not break
  portability. The unreferenced `documentation` key is dropped rather than
  pointed at a crate that does not exist.
- The release contract test demanded exit 0 from `release-publish` with no
  token. That only passed because the allowlist was empty; with a real package
  the command correctly fails closed, so the test now asserts the invocation
  parses (exit 2 and `unrecognized arguments` are the failure modes it exists
  to catch) and keeps the zero-exit requirement for config-only commands.

Publishing also refuses a dirty tree, which is the correct guard: the artifact
must correspond to a commit. The change is therefore committed before upload.
@github-actions github-actions Bot added rust Pull requests that update rust code agents docs config labels Nov 13, 2026
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@d-oit
d-oit merged commit 7dbf454 into main Nov 13, 2026
28 checks passed
@d-oit
d-oit deleted the feat/publish-crates-io-canary branch November 13, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents config docs rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant