underhill_core: print branch in addition to crate#2880
underhill_core: print branch in addition to crate#2880mattkur wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
There was a problem hiding this comment.
Pull request overview
This PR updates Underhill (OpenHCL) startup logging to include additional build metadata so production logs can better identify what build is running.
Changes:
- Add a
BuildInfo::openhcl_version()accessor inopenhcl/build_info. - Log
openhcl_versionalongsidecrate_nameandscm_revisionduring Underhill startup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openhcl/underhill_core/src/lib.rs | Extends the “VMM process” startup log fields to include openhcl_version. |
| openhcl/build_info/src/lib.rs | Exposes the already-stored openhcl_version field via a new getter. |
| let crate_name = build_info::get().crate_name(); | ||
| let crate_revision = build_info::get().scm_revision(); | ||
| tracing::info!(CVM_ALLOWED, ?crate_name, ?crate_revision, "VMM process"); | ||
| let openhcl_version = build_info::get().openhcl_version(); | ||
| tracing::info!( | ||
| CVM_ALLOWED, | ||
| ?crate_name, | ||
| ?crate_revision, | ||
| ?openhcl_version, | ||
| "VMM process" |
There was a problem hiding this comment.
The PR description/title mention printing the SCM branch, but this log adds openhcl_version and still does not emit scm_branch (available as build_info::get().scm_branch()). If the goal is to identify which git branch produced the build, log scm_branch here (optionally alongside openhcl_version if that’s also useful).
Our production logs only print a commit hash. Knowing which branch it came from is helpful in certain cases, as well.