Add CLI installation source to main telemetry - #20590
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20590Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20590" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is bounded, fault-tolerant, correctly scoped, and comprehensively tested.
Review effort: Balanced
Findings: None
What changed in this PR
Adds bounded CLI installation-source telemetry to the main CLI activity.
Changes:
- Detects sidecar, WinGet, npm, mise, and .NET-tool provenance.
- Adds focused telemetry and detection tests.
- Documents precedence, supported values, and scope.
| File | Description |
|---|---|
src/Aspire.Cli/Acquisition/InstallSourceDetector.cs |
Implements source detection. |
src/Aspire.Cli/Program.cs |
Adds the tag to main telemetry. |
src/Aspire.Cli/Telemetry/TelemetryConstants.cs |
Defines the telemetry tag. |
src/Aspire.Cli/Utils/NpmInstallDetection.cs |
Exposes npm marker validation. |
tests/Aspire.Cli.Tests/Acquisition/InstallSourceDetectorTests.cs |
Covers detection and precedence. |
tests/Aspire.Cli.Tests/ProgramTests.cs |
Verifies event wiring and scope. |
tests/Aspire.Cli.Tests/TestServices/TestWindowsRegistryReader.cs |
Adds configurable registry probing. |
docs/specs/install-routes.md |
Documents telemetry behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests selector2 / 99 PR test projects · 4 PR jobs, from 7 changed files. Selected PR test projects (2 / 99)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Pull request created: #1807
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1807 targeting Triggered signals: Note This draft PR needs human review before merging. |
Description
CLI usage telemetry currently identifies the effective release channel but cannot distinguish how the CLI was installed. Add
aspire.cli.install.sourceto theaspire/cli/mainevent so usage can be broken down by installation mechanism, independently ofaspire.cli.identity.channel.The property reports
script,winget,npm,dotnet-tool,brew,mise,nix,pr,localhive, orunknown. Bash and PowerShell installers both reportscript./privatealiases.Validation
Ran the focused
Aspire.Cli.Testsclasses for installation-source detection, main-event wiring, npm/.NET-tool detection, CLI telemetry, CLI bootstrap, and path helpers: 296 passed, with one Linux-only bootstrap test skipped on Windows. Platform-gated macOS regression cases were added for custom mise roots but could not be exercised on this Windows host.git diff --checkpassed.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?