ci: rust-cache was caching nothing, it needs workspaces - #7
Merged
Conversation
Swatinem/rust-cache@v2 was used with no workspaces input. The action looks for one Cargo workspace at the checkout root, and nothing is checked out there: every checkout in these jobs uses path:. The action logged "could not find Cargo.toml" and carried on WITHOUT failing, so the job rebuilt everything from scratch on every run while the log said the cache step succeeded. Every workspace the job actually builds is now named. Where the job also builds the sibling busbar checkout, that is listed too: it is by far the larger of the two builds and the one worth caching most.
`gh release create ... || gh release view ...` cannot tell the two reasons `create` fails apart. The intended one is the benign race: two runs of this job fire for the same tag, the loser gets "a release already exists", and reusing it is right. But EVERY other failure -- a `--verify-tag` rejection after a tag was force-moved, an auth error, a `--generate-notes` error -- also falls through to `view`, and if a stale draft Release from a prior aborted run happens to be sitting there, `view` SUCCEEDS. The step goes green and the matrix then signs, attests and uploads artefacts onto that stale Release. Now only "already exists" is swallowed; anything else re-raises the original exit status. Verified in all three states with a stubbed `gh`: create succeeds -> exit 0 create says "already exists" -> reuses via view, exit 0 create fails otherwise -> exit 1 (previously: exit 0, onto the stale release) Six of the ten sibling plugin repos already do exactly this -- canonical form in auth-oidc's release.yml -- and it is what fixed hashicorp-vault. This repo was one of the three stragglers, which is the same "fixed here, missed there" drift that produced the aarch64 pubkey defect.
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.
rust-cache was caching nothing here
Swatinem/rust-cache@v2was used with noworkspaces:input. The action looks for one Cargo workspace at$GITHUB_WORKSPACE, and nothing is checked out there: everyactions/checkoutin these jobs usespath:. The action logged "could not find Cargo.toml" and CARRIED ON WITHOUT FAILING, so the job rebuilt everything from scratch on every run while the log said the cache step succeeded. That is the worst shape a cache misconfiguration can take: it costs full build time on every run and reports success.Every Cargo workspace the job actually builds is now named. Where the job also builds the sibling busbar checkout, that is listed too, and it matters more than the plugin's own:
busbar-plugin-packplus a full release build of busbar is by far the larger of the two.Deliberately left alone
Checked every workflow in this repo that uses
Swatinem/rust-cache, not just the ones changed. A job whose Cargo workspace genuinely is at the checkout root needs nothing and got nothing, rather than aworkspaces: .that would be pure noise.headroom-hook/.github/workflows/docker.ymlis one such case (its checkout has nopath:), andheadroom-hook/.github/workflows/docker-bundle.ymlalready carried a correctworkspaces: busbarAI.Part of a fleet sweep
Same fix applied across the first-party plugin repos, and to the reusable
plugin-ci.ymlin core (GetBusbar/busbar#58), which had the same defect and reaches every plugin repo at once.