Embed release version#327
Open
RiSKeD wants to merge 3 commits into
Open
Conversation
5809a5b to
05d6d7b
Compare
Add a Version constant to the buildinfo package that release-please will bump on every release via the `x-release-please-version` annotation. The previous behavior relied solely on `debug.ReadBuildInfo().Main.Version`, which is "(devel)" for builds produced via `go build` (including the release workflow), so the version printed by `dutagent -v` / `dutctl version` was never the actual release version. The runtime build info is still consulted for VCS revision, build time, and Go compiler version. Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Change `config.Version` from `int` to `string` so it can carry a semver value compatible with the embedded build version (`buildinfo.Version`). This unblocks future config/binary compatibility validation. The field is currently parsed but unused; behavior is unchanged. Test fixtures and the example config are updated accordingly. Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
Add `extra-files` to release-please config so it rewrites the version in `internal/buildinfo/version.go` and `contrib/dutagent-cfg-example.yaml` on every release. The example config now carries the current release version with an inline `x-release-please-version` annotation, keeping the documented schema version in lockstep with the binary. Signed-off-by: Fabian Wienand <fabian.wienand@blindspot.software>
05d6d7b to
44614f5
Compare
jenstopp
reviewed
May 13, 2026
Member
jenstopp
left a comment
There was a problem hiding this comment.
Looks good.
Kinda sad, that it does not work with Go's SDT lib capabilities. Also take the dutserver binary into account, pls
Comment on lines
+51
to
+52
| "internal/buildinfo/version.go", | ||
| "contrib/dutagent-cfg-example.yaml" |
Member
There was a problem hiding this comment.
I guess we would need that for all example configs in the modules? Is that possible without maintaining the list here, so does this list support wildcards?
| @@ -1,5 +1,5 @@ | |||
| --- | |||
| version: 0 | |||
| version: 1.0.0-alpha.1 # x-release-please-version | |||
Member
There was a problem hiding this comment.
is this a kind of hint for release-please to update the respective part of that line?
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
Bind dutagent/dutctl binaries to the release version managed by release-please.
feat -
const Versionininternal/buildinfo/version.go, annotated for release-please. Replacesdebug.ReadBuildInfo().Main.Version(always (devel) for go build). VCS revision, build time, Go version still come from runtime build info.refactor -
config.Version int→ string so it can hold semver. Parsed but unused.ci -
extra-fileswired so releases bumpversion.goandcontrib/dutagent-cfg-example.yaml.Not part of this PR
Config compatibility validation is deferred. Policy still TBD (exact match? major-only? schema version decoupled?). config.Version is read but never compared to buildinfo.Version.
It partially resolves #78.