Repository navigation
fix: Report unreleased builds as pseudo-versions - #362
Merged
Merged
Conversation
4 tasks done
Builds from main reported v0.0.0+<sha> (plain go build, or nix without a VERSION file) or <last-tag>+<sha> (task build). The first hides the release the build came from. The second compares equal to that release, because semver ignores build metadata, so neither the update checker nor a reader can tell it apart from the real thing. The Go toolchain already stamps a pseudo-version into every build, such as v0.23.4-0.20261106200105-557cf6782621. It names the commit, and sorts after the last release and before the next one. datumctl now uses that version everywhere it reads its own: the update checker, auto-update, plugin compatibility, and `datumctl version`. component-base can't hold it, since SetDynamicVersion only accepts 0.0.0 versions, so `datumctl version` no longer delegates to kubectl's Run. Doing so also drops kubectl's client/server skew check. datumctl's version and the Datum Cloud API server's are unrelated, and the check failed outright on non-semver server versions. The JSON and YAML output now fills gitCommit, gitTreeState, buildDate (the commit time, as reproducible builds use) and major/minor from the build's VCS info when ldflags left them at their placeholders. Nix and task builds produce the same string: - task build drops its gitVersion ldflag and lets Go stamp it - task nix-build writes `git describe --tags --long --dirty` to VERSION, and the flake builds the pseudo-version from it. Staging VERSION made nix see every tree as dirty, so the flake takes dirtiness from the describe output instead. - A dirty tree appends +dev. Fixes #264 Co-Authored-By: Claude <claude@anthropic.com>
drewr
force-pushed
the
fix/pseudo-version
branch
from
November 9, 2026 23:14
3ab15a4 to
187997d
Compare
drewr
marked this pull request as ready for review
November 9, 2026 23:17
drewr
enabled auto-merge
November 9, 2026 23:19
ecv
approved these changes
Nov 9, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve. goreleaser's ldflags still take precedence, so release builds report the exact tag. A main build's pseudo-version sorts after the last release and before the next one, so the update checker never offers it a downgrade. The removed skew check had no other caller.
Follow-ups:
- Nothing tests
runVersion, which is the path that crashed against Milo. Neither the pseudo-version logic inflake.nixnor the Taskfile one has a test or a CI check. - A plugin whose
minDatumctlVersionnames the next, unreleased version will not run on main builds, as before. Document it for plugin authors.
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.
Summary
Builds from main reported their version as v0.0.0 plus a commit, or as the last release plus a commit, which semver treats as equal to that release.
Every build path now reports the pseudo-version Go already stamps into the binary. It names the commit and sorts after the last release and before the next one, so the update checker and plugin checks see it correctly.
The version command also stops running kubectl's client/server skew check, which compared unrelated versions and crashed on non-semver server versions.
Test plan
Fixes #264
Supersedes #279