Skip to content

ci(vet): pin cargo-vet to 0.10.2, the version that parses publisher trust - #2357

Merged
robcohen merged 2 commits into
mainfrom
chore/vet-trusted-publisher-2355
Sep 20, 2026
Merged

robcohen merged 2 commits into
mainfrom
chore/vet-trusted-publisher-2355

Conversation

@robcohen

Copy link
Copy Markdown
Member

Closes #2355.

The failure

Update Exemptions has failed on every Cargo.lock PR since #2323:

ERROR × Failed to parse toml file
  ╰─▶ missing field `user-id` for key `trusted.mach2`

My first diagnosis was wrong, both halves

I filed #2355 saying no released cargo-vet understands the trusted-publisher
key those entries use, and that they should be rewritten as user-id entries.
Testing locally showed otherwise:

  • cargo-vet 0.10.2 parses the store and vets it — "Vetting Succeeded (320
    fully audited, 3 partially audited, 228 exempted)"
    — and suggests
    cargo vet trust <crate> github:owner/repo on its own.

  • user-id is the wrong form here. Every version we depend on was published
    through trusted publishing, with no publishing user:

    crate our version published by earlier versions
    mach2 0.6.0 trusted publishing JohnTitor (51017)
    pin-project-lite 0.2.17 trusted publishing taiki-e (33035)
    portable-atomic 1.15.0 trusted publishing taiki-e (33035)

    A user-id entry would match nothing and silently grant none of the trust it
    appears to — the failure mode chore(deps): Rust 1.98.1, flake refresh, and all dependency updates #2321 exists to prevent. Rewriting them, which I
    had started, would have quietly turned three trusted crates into exemptions.

#2355 now carries that correction at the top.

The actual defect: the version CI installs

taiki-e/install-action with an unversioned tool: cargo-vet takes the newest
GitHub release, v0.10.0 (2024-10-03), which predates the feature. Its
manifest offers no 0.10.2 (it lists 0.10 and 0.10.0), and there is no 0.10.2
GitHub release for its binstall fallback either — so the pin goes through
crates.io:

cargo install cargo-vet --version 0.10.2 --locked

Pinned in supply-chain.yml too: that job resolved its own version from
crates.io, so the two could disagree about whether this store parses.

Verified with the exact commands CI runs

command result
cargo install cargo-vet --version 0.10.2 --locked installs cargo-vet 0.10.2, exit 0
cargo vet regenerate exemptions (the failing job) exit 0
cargo vet --locked (Cargo Vet job) Vetting Succeeded
cargo vet check (bare, what a contributor runs) Vetting Succeeded — was failing on main

This PR cannot prove the fix through its own CI: the job is path-gated on
Cargo.lock, which this PR does not touch, and pull_request_target workflows
run from the base branch. The evidence is the local runs above; after this
merges, re-running the job on #2354 exercises it for real.

Two things found while verifying

  • cargo vet check fails on main for a missing audit-as-crates-io entry
    on rustledger-budget, rustledger-ops and rustledger-returns — three
    first-party crates absent from a list of fourteen. CI's --locked invocation
    never reaches that check, which is why it went unnoticed. Added.
  • One stale exemption pruned (rustls-webpki 0.103.15) — the fixed
    automation's own output, shipped here rather than waiting for the next
    dependency PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr

…rust

`Update Exemptions` has failed on every Cargo.lock PR since #2323:

    ERROR × Failed to parse toml file
      ╰─▶ missing field `user-id` for key `trusted.mach2`

My first diagnosis was that no released cargo-vet understands the
`trusted-publisher` key those entries use, and that they should be rewritten as
`user-id` entries. Both halves were wrong, and testing locally is what showed
it.

cargo-vet 0.10.2 parses the store and vets it: "Vetting Succeeded (320 fully
audited, 3 partially audited, 228 exempted)". It also suggests `cargo vet trust
<crate> github:owner/repo` on its own. So the entries are valid.

They are also the only form that works here. Every version we depend on --
mach2 0.6.0, pin-project-lite 0.2.17, portable-atomic 1.15.0 -- was published
through trusted publishing, with NO publishing user; earlier versions of all
three came from a user. A `user-id` entry would therefore match nothing and
silently grant none of the trust it appears to, which is the failure #2321 was
about. Rewriting them, as I had started to do, would have quietly turned three
trusted crates into exemptions.

The defect is the version CI installs. `taiki-e/install-action` with an
unversioned `tool: cargo-vet` takes the newest GitHub RELEASE -- v0.10.0, from
2024-10-03 -- which predates the feature. Its manifest offers no 0.10.2 (checked:
it lists 0.10 and 0.10.0), and there is no 0.10.2 GitHub release for its
binstall fallback either, so the pin has to go through crates.io:

    cargo install cargo-vet --version 0.10.2 --locked

Pinned in supply-chain.yml as well. That job was resolving its own version from
crates.io, so the two could disagree about whether this store parses; now they
cannot.

Verified locally, with the exact commands CI runs: the install succeeds and
yields 0.10.2, `cargo vet regenerate exemptions` exits 0, and `cargo vet
--locked` succeeds.

Two things found while verifying:

`cargo vet check` -- what a contributor runs, without `--locked` -- fails on
main for a missing `audit-as-crates-io` entry on rustledger-budget,
rustledger-ops and rustledger-returns, three first-party crates absent from a
list of fourteen. CI's invocation does not reach that check, which is why it
went unnoticed. Added, and `check` now succeeds.

`regenerate exemptions` prunes one stale exemption (rustls-webpki 0.103.15).
That is the fixed automation's own output, so it ships here rather than waiting
for the next dependency PR.

The job is path-gated on Cargo.lock, so it will not run on this PR; the
evidence is the local runs above, and re-running it on #2354 after this merges.

Closes #2355
@robcohen
robcohen requested a review from a team as a code owner September 20, 2026 11:15
@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 99% (raw 93%, 169 masked)
Full AST Match 100%
Total Files 813
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
    The headline is the EFFECTIVE rate, after pairs where beanquery
    itself is wrong are masked. raw is the same run with nothing
    masked. A widening gap means the registry grew, not that rledger
    changed.
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

…s.lock

My own change broke the `Cargo Vet` job on this PR:

    Vetting Failed!
      rustls-webpki:0.103.15 missing ["safe-to-deploy"]

I had kept half of one output. `cargo vet regenerate exemptions` pruned that
exemption AND updated imports.lock, which is what made it prunable: the audit
covering the crate came from a freshly fetched import. I reverted imports.lock
to keep this PR focused on the version pin and kept the pruning, so the store
claimed an exemption was unnecessary while the audit that replaced it was no
longer there.

It passed locally because my tree still held the fetched imports at that moment.
CI runs `cargo vet --locked`, which forbids fetching them, so the crate came out
unvetted. Verified the fix with `--locked` this time, the flag CI actually uses,
rather than the bare command.

The exemption is back, so this PR now touches only the version pin and the three
missing `audit-as-crates-io` entries; exemptions are byte-identical to main. The
automation can prune it on the next dependency PR, when it updates imports.lock
in the same commit -- which is the point of that job, and it works again once
this merges.
@robcohen
robcohen merged commit d56521b into main Sep 20, 2026
46 checks passed
@robcohen
robcohen deleted the chore/vet-trusted-publisher-2355 branch September 20, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Exemptions fails on every Cargo.lock PR: trusted-publisher is not a key any released cargo-vet understands

1 participant