-
Notifications
You must be signed in to change notification settings - Fork 10
chore: automate version management #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughVersion identifier changed from "2.3.1" to "dev"; two unexported variables ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the version information handling in the main entry point to clarify build sources and change the default development version. The changes improve documentation around how version information is populated across different build scenarios (releases, development builds, and direct runs).
- Updated version default from "2.3.1" to "dev" to better indicate non-release builds
- Enhanced comments to explain version information is set via ldflags from multiple sources (GoReleaser, Taskfile, or defaults)
- Clarified that unused commit and date variables are set by ldflags in general, not just GoReleaser
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/wtp/main.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: E2E Tests (macos-latest)
🔇 Additional comments (1)
cmd/wtp/main.go (1)
9-14: LGTM! Clear documentation and appropriate default.The updated comments effectively document the version management strategy across different build scenarios, and the "dev" default is appropriate for direct
go runinvocations without ldflags injection.
4491242 to
8e27cb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cmd/wtp/main.go (1)
17-18: Consider removing unused variables or suppressing linter warnings.The past critical issue with blank identifiers has been successfully resolved. However, the linter correctly reports that
commitanddateare currently unused. While the comments indicate they're reserved for future verbose output, you have two options:
Remove them until needed (cleaner approach):
var ( version = "dev" - commit = "none" - date = "unknown" )Then add them back when implementing verbose version output.
Suppress the linter warnings if implementing verbose output is planned soon:
var ( version = "dev" - commit = "none" - date = "unknown" + commit = "none" //nolint:unused // Reserved for future verbose version output + date = "unknown" //nolint:unused // Reserved for future verbose version output )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/wtp/main.go(1 hunks)
🧰 Additional context used
🪛 GitHub Check: Lint
cmd/wtp/main.go
[failure] 18-18:
var date is unused (unused)
[failure] 17-17:
var commit is unused (unused)
🔇 Additional comments (2)
cmd/wtp/main.go (2)
9-14: LGTM: Clear documentation of version management approach.The comment block effectively documents the three versioning scenarios (release, dev, and default builds) and clarifies that commit and date are available for future use.
16-16: LGTM: Version default aligns with PR objectives.Setting the default to "dev" is the correct approach for builds without ldflags injection.
- Version is automatically set via ldflags in both dev and release builds - GoReleaser sets version from git tags in releases - Taskfile sets version from git describe in dev builds - Eliminates manual version updates in source code
8e27cb7 to
9a4a567
Compare
Summary
Eliminates the need to manually update version numbers in source code by leveraging existing ldflags injection.
Changes
"dev"incmd/wtp/main.goHow It Works
-X main.version={{.Version}}git describevia ldflagsgo run: Falls back to"dev"Benefits
Testing
Summary by CodeRabbit