fix(ci): pass the crates.io token to FerrFlow in reusable-ferrflow-release - #356
Conversation
There was a problem hiding this comment.
Change is correct and additive: both jobs run FerrFlow, both can reach cargo publish (inline for deferPublish: false, in the publish job otherwise), so both need the token.
Checked the callers, since the change relies on secrets: inherit reaching an undeclared secret. Five of the six inherit. FerrLabs/FerrVault passes secrets explicitly (FERRLABS_DISPATCH_TOKEN only), so neither cargo token reaches it, but its .ferrflow declares only docker and helm publishers and it is pinned to an older SHA, so nothing breaks there. Worth knowing if a non-inheriting caller ever gains a cargo publisher: the token arrives empty and the failure will look like an auth error, not a wiring error.
One nit inline. Not blocking.
| # Lets cargo-based postBump hooks read the private Kellnr index. | ||
| # Empty (and unused) for repos that don't consume Kellnr. | ||
| CARGO_REGISTRIES_KELLNR_TOKEN: ${{ secrets.CARGO_REGISTRIES_KELLNR_TOKEN }} | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_FERRLABS_REGISTRY_TOKEN }} |
There was a problem hiding this comment.
Nit: the name mismatch is explained in the PR description but not in the file. Someone reading just the YAML sees CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_FERRLABS_REGISTRY_TOKEN }}, assumes a typo, "fixes" it to secrets.CARGO_REGISTRY_TOKEN, and publishing silently breaks again. The Kellnr line above carries a comment; this one should too.
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_FERRLABS_REGISTRY_TOKEN }} | |
| # crates.io credential. The names deliberately differ: the org secret | |
| # that actually publishes to crates.io is CARGO_FERRLABS_REGISTRY_TOKEN, | |
| # not the identically-named CARGO_REGISTRY_TOKEN. See #355. | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_FERRLABS_REGISTRY_TOKEN }} |
Closes #355
Two lines.
reusable-ferrflow-release.ymlexported only the Kellnr credential, so any repo declaring a publisher on the default registry rancargo publishwith no token and failed on "no token found". Every repo releasing through this workflow could publish to Kellnr and nowhere else.env: CARGO_REGISTRIES_KELLNR_TOKEN: ${{ secrets.CARGO_REGISTRIES_KELLNR_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_FERRLABS_REGISTRY_TOKEN }}Applied to both jobs.
publishcovers deferred publishers,releasecovers repos ondeferPublish: falsethat publish inline.Why the names do not match
CARGO_REGISTRY_TOKENandCARGO_FERRLABS_REGISTRY_TOKENboth exist as org secrets withvisibility=all, and the one that actually publishes to crates.io is the second.FerrLabs/LFSXis the proof: its ownpublish.ymlmaps exactly this pair, andlfsxsits on crates.io at 1.17.0. LFSX works today because it callscargo publishitself instead of going through this workflow.The left side of the mapping is the env var cargo reads, the right side is where the value lives. Wiring the obvious
secrets.CARGO_REGISTRY_TOKENinstead would look correct and publish nothing, which is the trap this removes.The secret is not declared in the
secrets:block, matching the Kellnr line directly above it. Callers usesecrets: inherit, which already grants access, and the existing Kellnr publishes prove that path works.Not verified end to end
The only real proof is a crates.io publish, and that needs a release to fire. FerrLabs/Kit#295 moved four crates onto the default registry, so the next
feat:orfix:touching one of them is the first live run. Kellnr publishes are unaffected either way, since that line is untouched.