fix(sovereign-ci): bin-only crates could never pass test or coverage - #44
Open
noahgift wants to merge 1 commit into
Open
fix(sovereign-ci): bin-only crates could never pass test or coverage#44noahgift wants to merge 1 commit into
noahgift wants to merge 1 commit into
Conversation
Every branch of the test and coverage fallback chains passes `--lib`:
TEST_SCOPE: ${{ inputs.test_workspace && '--workspace --lib' || '--lib' }}
and `cargo test --lib` does not merely FAIL on a crate without a [lib] target —
it ERRORS: "no library targets found in package <name>" (exit 101). So a bin-only
repo had no reachable configuration: `test_workspace` only toggles `--workspace`,
and both of its values keep `--lib`.
Found in cohete, whose `ci / coverage` job is red for this and nothing else:
error: process didn't exit successfully: `cargo test ... --lib` (exit 101)
error: process didn't exit successfully: `cargo test ... --lib -p cohete` (exit 101)
::error::Coverage failed — check workspace path dependencies
The same `--lib` assumption independently made cohete's local pre-push hook
unpassable, so every push there used --no-verify and 84 rustfmt diffs plus 2
clippy errors accumulated behind the bypass. A gate that cannot pass is worse
than no gate.
Fix: append one more link to each chain, without `--lib`. That covers bins,
integration tests and doctests, and works with or without a [lib].
PURELY ADDITIVE — a crate that HAS a lib target satisfies an earlier branch and
never reaches the new line, so behaviour is unchanged for every repo that works
today. Verified the `|| \`-with-comment chains still short-circuit correctly in
both directions: fallback skipped when the prior command succeeds, run when it
fails.
⚠️ Blast radius: this workflow is called by ~30 fleet repos. Not self-merging.
Refs PMAT-203
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
Every branch of the test and coverage fallback chains passes
--lib:And
cargo test --libdoes not merely fail on a crate without a[lib]target — it errors:So a bin-only repo had no reachable configuration.
test_workspaceonly toggles--workspace; both of its values keep--lib.Where it showed up
cohete'sci / coveragejob, red for this and nothing else:Its CI last passed 2026-04-03, before this chain took its current shape.
The same
--libassumption independently made cohete's local pre-push hook unpassable — so every push there used--no-verify, and 84 rustfmt diffs plus 2 clippy errors accumulated behind the bypass (paiml/cohete#4). A gate that cannot pass is worse than no gate: it trains everyone to bypass it, and then real findings ride in behind the bypass.The fix
One more link on each chain, without
--lib. Covers bins, integration tests and doctests; works with or without a[lib].Purely additive. A crate that has a lib target satisfies an earlier branch and never reaches the new line, so behaviour is unchanged for every repo that works today.
I verified the
|| \-with-comment chains still short-circuit correctly in both directions — fallback skipped when the prior command succeeds, run when it fails — rather than assuming either way.This workflow is called by roughly 30 fleet repos. I am not self-merging it.
Refs PMAT-203.
🤖 Generated with Claude Code