feat: implement vergen crate for git-based versioning#21
Conversation
- Add vergen build dependency with git and gitcl features - Create build.rs to emit VERGEN_GIT_SHA and VERGEN_GIT_COMMIT_DATE - Update version output to use short SHA and date (e.g., bbl_parser 14be1ee (2025-12-04)) - Use CARGO_PKG_NAME macro for package name consistency - Remove hardcoded semantic version references from documentation - Update .gitignore to whitelist build.rs - Version now reflects actual git commit info at build time
📝 WalkthroughWalkthroughThe pull request introduces a build-time Git metadata system using the vergen crate. Changes include adding a build script (build.rs) to emit Git SHA and commit date during compilation, updating Cargo.toml with build dependencies, and modifying src/main.rs to incorporate this metadata into the CLI version display. Documentation is updated to remove version-specific references. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
🧰 Additional context used📓 Path-based instructions (5)README.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
{src/**/*.rs,Cargo.*,README.md,OVERVIEW.md,.gitignore,.github/**}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
OVERVIEW.md📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/main.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (12)📓 Common learnings📚 Learning: 2025-08-29T19:55:43.912ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
📚 Learning: 2025-10-08T18:00:17.944ZApplied to files:
🧬 Code graph analysis (1)build.rs (1)
⏰ 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). (2)
🔇 Additional comments (7)
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 |
Overview
Implement dynamic versioning using the
vergencrate to embed git commit information at build time.Changes
Versioning: Replace hardcoded semantic version (0.9.0) with dynamic git-based version
bbl_parser <short-sha> (<date>)bbl_parser 14be1ee (2025-12-04)Build Integration: Add
vergencrate as build dependencyVERGEN_GIT_SHA(short form) andVERGEN_GIT_COMMIT_DATEgitclbackend for minimal external dependenciesCLI Output: Update both help and version displays
-Vflag shows: version string with short SHA and dateCARGO_PKG_NAMEmacroDocumentation: Remove hardcoded version references
README.md: Remove work-in-progress markerOVERVIEW.md: Remove version 0.9.0 referencesGit Configuration: Add
build.rsto gitignore whitelistBenefits
Testing
✅ All 38 tests pass
✅ Formatting complies (cargo fmt)
✅ Clippy checks pass (no warnings)
✅ Release build successful
Files Changed
build.rs(new) - Vergen build script configurationCargo.toml- Added vergen dependenciessrc/main.rs- Updated version string generation.gitignore- Whitelisted build.rsREADME.md,OVERVIEW.md- Removed version referencesSummary by CodeRabbit
Documentation
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.