Skip to content

feat: Use commit string from runtime/debug if built without goreleaser. - #135

Merged
FUSAKLA merged 2 commits into
masterfrom
rudo-include-commit-string
Jun 3, 2026
Merged

feat: Use commit string from runtime/debug if built without goreleaser.#135
FUSAKLA merged 2 commits into
masterfrom
rudo-include-commit-string

Conversation

@rudo-thomas

Copy link
Copy Markdown
Collaborator

Via prometheus/common/version to keep the change trivial.

Via prometheus/common/version to keep the change trivial.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the CLI version command to display a commit SHA derived from Go build metadata when the binary wasn’t built with commit ldflags (e.g., local go build), using github.com/prometheus/common/version as the implementation source.

Changes:

  • Import github.com/prometheus/common/version and use it to populate commit when not injected at build time.
  • Change the default commit value from "none" to "" to enable an “unset” sentinel.
  • Add runtime fallback logic in the version subcommand execution path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread main.go Outdated
Comment thread main.go
As suggested by copilot.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

@FUSAKLA FUSAKLA left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ok, should not harm anyone

@FUSAKLA
FUSAKLA merged commit a1b808b into master Jun 3, 2026
5 checks passed
@rudo-thomas
rudo-thomas deleted the rudo-include-commit-string branch June 3, 2026 13:44
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.

3 participants