Skip to content

fix(ci): pass the crates.io token to FerrFlow in reusable-ferrflow-release - #356

Merged
BryanFRD merged 1 commit into
mainfrom
fix/crates-io-token
Sep 20, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
fix/crates-io-token

Conversation

@BryanFRD

Copy link
Copy Markdown
Contributor

Closes #355

Two lines. reusable-ferrflow-release.yml exported only the Kellnr credential, so any repo declaring a publisher on the default registry ran cargo publish with 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. publish covers deferred publishers, release covers repos on deferPublish: false that publish inline.

Why the names do not match

CARGO_REGISTRY_TOKEN and CARGO_FERRLABS_REGISTRY_TOKEN both exist as org secrets with visibility=all, and the one that actually publishes to crates.io is the second. FerrLabs/LFSX is the proof: its own publish.yml maps exactly this pair, and lfsx sits on crates.io at 1.17.0. LFSX works today because it calls cargo publish itself 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_TOKEN instead 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 use secrets: 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: or fix: touching one of them is the first live run. Kellnr publishes are unaffected either way, since that line is untouched.

@BryanFRD
BryanFRD enabled auto-merge (squash) September 20, 2026 14:25

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 }}

@BryanFRD
BryanFRD merged commit 9ae8b52 into main Sep 20, 2026
11 checks passed
@BryanFRD
BryanFRD deleted the fix/crates-io-token branch September 20, 2026 14:27
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.

fix(ci): reusable-ferrflow-release cannot publish to crates.io, the token never reaches cargo

1 participant