fix(ci): fetch tags so a dispatched docs deploy renders a real version - #11
Merged
Merged
Conversation
The navbar version badge comes from getProjectVersion() in
@vantagecompute/docusaurus-theme, which shells out to `git describe --tags
--always`. This workflow checked out at the default depth of 1.
That is fine for the tag trigger, which is every deploy this repo has run so
far: checkout resolves refs/tags/vX.Y.Z, so the tag describe needs is the very
ref checked out, and the live site's badge correctly reads v0.1.6 today.
It is not fine for workflow_dispatch. That runs against a branch, and checkout
fetches branches with --no-tags, so the clone carries no tags at all and
describe falls through to its `--always` case. Replicating what checkout
actually runs:
git init && git remote add origin <this repo>
git fetch --no-tags --depth=1 origin df7388b # main
git describe --tags --always
-> df7388b
So the first dispatched deploy would have quietly replaced the version in the
published header with a commit hash. The build succeeds and the site renders,
so nothing would have caught it but someone reading the header.
Every other Vantage docs spoke already sets fetch-depth: 0. This one was the
exception.
Co-Authored-By: Claude Opus 5 (1M context) <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.
One line of config. Most of this description is the evidence, because the first version of this claim was wrong and worth stating precisely.
What is broken
The navbar version badge comes from
getProjectVersion()in@vantagecompute/docusaurus-theme, which shells out togit describe --tags --always. This workflow checks out at the default depth of 1.The tag trigger is fine, which is every deploy this repo has ever run.
actions/checkoutresolvesrefs/tags/vX.Y.Z, so the tagdescribeneeds is the very ref checked out. The live site's badge readsv0.1.6today, correctly.workflow_dispatchis not fine. It runs against a branch, and checkout fetches branches with--no-tags, so the clone carries no tags at all anddescribefalls through to its--alwayscase.Evidence
Replicating what
actions/checkoutactually runs, rather than reasoning about it:And the tag-ref case, for contrast:
Note that a plain
git clone --depth 1 --branch maindoes not reproduce this: it pulls tags pointing at the fetched commit, andmainhere is exactlyv0.1.6. That is what makes this easy to test wrong.Impact
Latent, not live. The first dispatched deploy would have quietly replaced the version in the published header with a commit hash. The build succeeds and the site renders, so nothing catches it but someone reading the header.
Every other Vantage docs spoke (v8x, v8xgo, sdkpy, sdkgo, provider, slurm-mcp, tunnel-client, mcp-infra, lxd-autoscaler, vdeployer) already sets
fetch-depth: 0. This repo was the only exception.🤖 Generated with Claude Code