log build version on startup - #1163
Conversation
Signed-off-by: Roland Kuhn <rk@rkuhn.info>
WalkthroughThe startup path now logs package, Git, dirty-state, OS, and architecture metadata after tracing setup. The new event is defined in observability schemas and trace documentation. Tests verify the structured INFO output. ChangesBuild-version observability
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
🧹 Nitpick comments (1)
crates/amaru/src/version.rs (1)
152-153: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the emitted dirty-state field.
The test does not verify
git_dirty. A wrong dirty-state value can pass while build identity becomes inaccurate.Proposed test update
assert!(output.contains(target_os()), "expected os {} in output:\n{output}", target_os()); assert!(output.contains(target_arch()), "expected arch {} in output:\n{output}", target_arch()); + let expected_dirty = git_dirty().unwrap_or(false); + assert!( + output.contains(&format!("git_dirty={expected_dirty}")), + "expected git dirty state {expected_dirty} in output:\n{output}" + ); let expected_commit = git_commit_hash().unwrap_or("unknown");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/amaru/src/version.rs` around lines 152 - 153, Update the version-output test assertions near target_os() and target_arch() to also parse or inspect the emitted git_dirty field and assert it matches the expected dirty-state value, ensuring incorrect build identity cannot pass the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/amaru/src/version.rs`:
- Around line 152-153: Update the version-output test assertions near
target_os() and target_arch() to also parse or inspect the emitted git_dirty
field and assert it matches the expected dirty-state value, ensuring incorrect
build identity cannot pass the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 003bc5c7-640d-449a-ac49-6320437afb37
📒 Files selected for processing (6)
CHANGELOG.mdcrates/amaru-observability/src/schemas.rscrates/amaru/src/bin/amaru/main.rscrates/amaru/src/version.rsdocs/TRACES.mddocs/traces-schema.json
fixes #1161
Summary by CodeRabbit
New Features
Documentation
Tests