Repository navigation
Conversation
release-server.yml builds with only `-X main.Version`, so `--version` and the startup banner printed "built unknown" for every released asset even though the repository's documented build command sets `main.BuildDate`. Pass `-X main.BuildDate=<utc timestamp>` in the release build and fall back to the embedded `vcs.time` in init(), so builds that do not pass the flag (installer, local builds, other CI) report a real date as well.
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
betterdesk-server --versionand the startup banner printbuilt unknownfor every released server asset. Cause:.github/workflows/release-server.ymlbuilds with-ldflags="-s -w -X main.Version=${VERSION}"only, soBuildDateinbetterdesk-server/main.gokeeps its compile-time default"unknown". The repository's own documented build command (.github/go-server-context.md→ "Build Commands") does pass-X main.BuildDate, andinit()already resolvesVersionat runtime viaproductversion.Product()when the flag is missing — this PR does the same for the build date.Changes:
.github/workflows/release-server.yml: pass-X main.BuildDate=<UTC timestamp>in the release build.betterdesk-server/main.go: ifBuildDateis empty or"unknown", fall back to thevcs.timesetting Go stamps into binaries built from a Git checkout (buildvcs, on by default). Installer, Docker and local builds therefore report a real date too.Before:
betterdesk-server 3.5.221 (built unknown)After:
betterdesk-server 3.5.221 (built 2026-11-09T08:58:12Z)The change only affects the printed string; no code path, flag or protocol behaviour changes.
Target branch
dev, unless it is an explicitly approveddev→mainrelease.Security and provenance
-ldflagsvalue is added to an existing build step; no new workflow, no new secret, nopull_request_target.)runtime/debug.)Deployment and compatibility
vcs.timefallback. Nothing to migrate.).envchanges append missing keys without overwriting operator secrets. (No.envchanges.)Tests
Run locally against
dev(94757a1) with Go 1.26.10, matchinggo.mod'stoolchain go1.26.10.Results:
-X main.BuildDate):betterdesk-server 3.5.221 (built 2026-11-09T07:53:00Z)— thevcs.timefallback replacesunknown.release-server.yml):betterdesk-server 3.5.221 (built 2026-11-09T07:56:53Z)— matches the injectedBUILD_DATE.go vet ./...→ clean, no findings.go test -count=1 .→ok github.com/unitronix/betterdesk-server 2.702s.Note: only the main package was tested locally; the full
go test -race ./...sweep is left to CI.Console translations
--versionoutput and the server log banner only; nothing underweb-nodejs/lang/.)web-nodejs/lang/*.jsonlocale with proper translations.Attribution