Skip to content

Embed release version#327

Open
RiSKeD wants to merge 3 commits into
mainfrom
feat/embed-release-version
Open

Embed release version#327
RiSKeD wants to merge 3 commits into
mainfrom
feat/embed-release-version

Conversation

@RiSKeD
Copy link
Copy Markdown
Contributor

@RiSKeD RiSKeD commented May 8, 2026

Summary

Bind dutagent/dutctl binaries to the release version managed by release-please.

feat - const Version in internal/buildinfo/version.go, annotated for release-please. Replaces debug.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-files wired so releases bump version.go and contrib/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.

@RiSKeD RiSKeD force-pushed the feat/embed-release-version branch from 5809a5b to 05d6d7b Compare May 8, 2026 10:56
RiSKeD added 3 commits May 8, 2026 12:57
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>
@RiSKeD RiSKeD force-pushed the feat/embed-release-version branch from 05d6d7b to 44614f5 Compare May 8, 2026 10:58
Copy link
Copy Markdown
Member

@jenstopp jenstopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a kind of hint for release-please to update the respective part of that line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed version information

2 participants