fix: --version now reports git tag instead of hardcoded 0.1.0#220
Merged
joaoantoniocardoso merged 3 commits intoJun 18, 2026
Merged
Conversation
joaoantoniocardoso
approved these changes
Jun 18, 2026
Member
There was a problem hiding this comment.
Hi, welcome!
The changes are good; Before merging, I'll ask you to change the commits to follow the repository pattern.
Your single commit touches 3 different parts of the code, so make it three commits. Here's an example:
ci: Fetch git tags in checkout action
<short reasoning why this is needed>
Then, the other two would be something like build: <short description> and src: lib: cli: <short description>. Feel free to add more context in the commit bodies, similar to what you did in the PR body.
Thanks for the contribution!
Without fetch-tags: true, git checkout only fetches commits, not tags. vergen relies on git describe to produce the version string, which needs tags reachable from HEAD.
b61db92 to
a1dd9d7
Compare
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.
Closes #208
Root cause
--versionwas readingCARGO_PKG_VERSION, which is hardcoded to0.1.0inCargo.tomland never updated on releases.Fix
Switch to
VERGEN_GIT_DESCRIBE, which is already generated byvergen-gixduring the build and reflects the actual git tag.Two additional issues had to be addressed to make this work:
GixBuilder::all_git()calls.describe(false, false, None)internally, where the first argument means "annotated tags only". This repo uses lightweight tags, so git describe found nothing and emitted an empty string. Fixed by calling.all().describe(true, false, None)to include all tags.actions/checkout@v4defaults to a shallow clone with no tags. Addedfetch-tags: trueto both checkout steps so tags are visible during CI builds.Result
On a tagged commit:
mavlink-server 0.8.0Between releases:
mavlink-server 0.8.0-16-gbfc96df