chore: wire CLI version via ldflags at build time#199
Conversation
Summary of ChangesHello @kriscoleman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the build process by integrating dynamic versioning information into the CLI binary. By leveraging Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a solid improvement by embedding version information into the CLI binary at build time using ldflags. The changes in both .goreleaser.yaml and the Makefile correctly implement this for both release and local builds. My review includes a couple of minor suggestions to improve consistency between the two build methods and to make the local build process more robust against custom variable values.
|
|
|
|
Added ldflags configuration to GoReleaser and Makefile to inject the actual CLI version, commit hash, and build date at compile time. This ensures: - GoReleaser builds embed the release version from git tags - Local builds via `make build` use git describe for versioning - The version command displays accurate version info instead of "dev" Closes open-feature#192 Signed-off-by: Kris Coleman <kriscodeman@gmail.com>
Properly quotes the arguments passed to the `-X` ldflag to ensure correct interpretation of version information during the build process. The embedded version information was not being interpreted correctly due to missing quotes.
88f3841 to
f85b081
Compare


This PR
Added ldflags configuration to GoReleaser and Makefile to inject the actual CLI version, commit hash, and build date at compile time.
This ensures:
make builduse git describe for versioningRelated Issues
Closes #192
How to test
To see the behavior when you built locally prior to this change, pull

mainand runmake installthen runopenfeatureand notice:To see the behavior after this change, pull this branch, run

make installand then runopenfeatureand notice more meaninful meta: