Log CLI version and build ID at startup#14926
Merged
JamesNK merged 1 commit intorelease/13.2from Mar 4, 2026
Merged
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14926Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14926" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CLI version/build information to startup logs to improve diagnostics, and centralizes the reflection logic used to read that metadata.
Changes:
- Refactored CLI version/build ID extraction into
AspireCliTelemetryinternal static helpers. - Logged CLI version and build ID at the start of
Program.Main.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Aspire.Cli/Telemetry/AspireCliTelemetry.cs | Replaces inline assembly-attribute reflection with internal helper methods for CLI version/build ID. |
| src/Aspire.Cli/Program.cs | Emits version/build ID via cliLogger during CLI startup for troubleshooting in log files. |
davidfowl
approved these changes
Mar 4, 2026
Extract GetCliVersion() and GetCliBuildId() helper methods on AspireCliTelemetry and use them in both telemetry initialization and Program.cs startup logging.
9830fb1 to
4e64fe5
Compare
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22652386052 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Log CLI version and build ID at startup for diagnostics.
GetCliVersion()andGetCliBuildId()asinternal statichelper methods onAspireCliTelemetry, replacing inline reflection inInitializeAsync.cliLoggerinProgram.Mainusing the new helpers.This makes the version info available in log files for troubleshooting, and reduces duplication of the reflection logic.
Checklist