Repository navigation
Align telemetry CI detection with dotnet CLI - #20150
Conversation
Match dotnet boolean markers and read the process environment without changing shared configuration parsing or terminal interactivity. Co-authored-by: Copilot App <[email protected]> Copilot-Session: f306e0db-8ad7-4dae-b747-cfc304897424
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20150Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20150" |
Tests selector2 / 99 PR test projects · 4 PR jobs, from 3 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 |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the referenced .NET CLI behavior and has focused regression coverage.
Pull request overview
Aligns Aspire CLI telemetry CI detection with the .NET CLI while preserving vendor-marker behavior.
Changes:
- Uses
IEnvironmentinstead of configuration. - Accepts only
1,true,yes, andon. - Expands CI detection regression coverage.
File summaries
| File | Description |
|---|---|
src/Aspire.Cli/Telemetry/CIEnvironmentDetector.cs |
Implements .NET-compatible detection. |
tests/Aspire.Cli.Tests/Telemetry/CIEnvironmentDetectorTests.cs |
Covers values, markers, lookup, and configuration isolation. |
tests/Aspire.Cli.Tests/Telemetry/InternalMicrosoftDetectorTests.cs |
Verifies CI-dependent token probing. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals: none ( Why
All 3 changed files ( (summary truncated) |
|
The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests. Suspected flaky test(s):
Suggested actions:
You can re-run the failed jobs from the workflow run page. |
Description
Aspire and dotnet can classify the same process environment differently for telemetry: Aspire rejects
yesandon, but accepts nonzero integers and whitespace-padded values that dotnet rejects. Align Aspire's telemetry CI detector with dotnet without changing the shared configuration bool helpers or terminal-interactivity detection.The detector now uses a private predicate accepting only
1,true,yes, andon(case-insensitive). It reads through the existingIEnvironmentabstraction instead ofIConfiguration, so CLI settings cannot override process CI markers and environment-variable name lookup retains platform semantics. Vendor markers and presence rules are unchanged.Regression coverage includes boolean values, paired/presence-only markers, configuration isolation, case-sensitive lookup, and the internal Microsoft telemetry detector's CI-dependent probing behavior. Targeted validation passed: 293 tests passed, with one macOS-only test skipped on Windows, covering CI detection, internal Microsoft detection, CLI telemetry, and terminal capabilities.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?