Repository navigation
feat(cli): inject version from build instead of hardcoding - #494
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds build-time version generation from git metadata, generates a header exposing the version string, wires build dependencies for the generated header, and updates the CLI, LSP server info, and integration test to use and verify the generated version. ChangesDynamic Version Generation
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db59437286
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replaces the hardcoded "0.1.0" version strings with a build-time injected version, so
clice --versionand the LSP ServerInfo always match the release tag.How it works
generated/version.hon every build fromgit describe --tags --always --dirty; the write is elided when the content is unchanged, so nothing rebuilds spuriously.vprefix stripped: av1.0.0-beta.1tag builds a binary that reports1.0.0-beta.1.0.1.0-alpha.4-109-g41b8c3f, plus-dirtyfor local modifications). A checkout with no reachable tag reports the base version plus commit hash; a non-git build (source tarball) falls back to the CMake project version, now declared asproject(... VERSION 0.1.0 ...). Bumping the base for a release is that one line.--versionCLI and the initialize response's ServerInfo — read the sameclice::versionconstant.Notes
0.1.0+g<hash>; the tag-triggered release workflow checks out the tag ref and gets the exact version. This only affects what dev builds print.clice --versionreport the same string, which stays true regardless of tag state and locks the two paths together.Verification
./clice --version(prints the current describe output).tests/integration/features/test_server.pygreen including the new cross-check, smoke tests 3/3.Summary by CodeRabbit
New Features
--versionoutput and the server’s reported version are kept consistent across runtime and LSP.Bug Fixes
Tests
--versionoutput instead of using a fixed value.