Repository navigation
Detect existing Copilot MCP setup in project configurations - #22234
Ella Hathaway (ellahathaway) wants to merge 1 commit into
Conversation
Refresh telemetry hooks when an existing project MCP registration is in a repair-only Copilot configuration file. 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 -- 22234Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22234" |
Tests selector2 / 101 PR test projects · 4 PR jobs, from 2 changed files. Selected PR test projects (2 / 101)
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
No active review issues remain for the Copilot MCP registration detection update.
No open issues 🎉
What changed in this PR
Updates aspire agent init to recognize existing Copilot MCP registrations in project configurations and refresh telemetry hooks without modifying those files.
Changes:
- Detects Aspire registrations in
.vscode/mcp.jsonand.github/copilot/mcp.json. - Checks each configuration independently so an unreadable file does not hide a valid registration.
- Adds regression tests for hook selection, malformed or missing registrations, and configuration preservation.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Commands/AgentInitClientSelectionTests.cs |
Tests project configuration detection and verifies files remain unchanged. |
src/Aspire.Cli/Commands/AgentInitCommand.cs |
Includes repair-only configurations in detection and handles read failures per file. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Description
Refresh the telemetry hook when a project already configures Aspire MCP only in
.vscode/mcp.jsonor.github/copilot/mcp.json. Previously,aspire agent initignored these repair-only files when deciding whether Aspire was already configured.Check each configuration independently so an unreadable file does not hide a valid registration, without modifying repair-only files. This addresses the finding in #22231; the fix can be backported to
release/17.0separately.User-facing usage
With Aspire MCP already configured in either project file, running
aspire agent init --agents copilot --scope project --skills none --mcp=falserefreshes the Copilot telemetry hook.Validation
./restore.cmd: passed (13 existing package vulnerability warnings).dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.AgentInitClientSelectionTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true': passed (197 tests;MSBUILDTERMINALLOGGER=false).Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?