Skip to content

Package Source Mapping VS Settings now has command to invoke GitHub Copilot - #7613

Merged
donnie-msft merged 22 commits into
devfrom
dev-donnie-msft-usxPackageSourceMapper
Aug 6, 2026
Merged

donnie-msft merged 22 commits into
devfrom
dev-donnie-msft-usxPackageSourceMapper

Conversation

@donnie-msft

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#15021

Description

Introduce a Button (Command) to the Package Source Mapping VS Settings which attempts to prompt GitHub Copilot with "Review this repository's package source mappings.", invoking the NuGet MCP tool to review supply chain security.

The new button appears below the package source mapping array, highlighted here by a red rectangle:

image
  • Shown when a Solution is open in Visual Studio, hidden otherwise.

MCP Behavior

  • If Package Source Mappings exist in a machine-level NuGet.Config, the MCP Tool will suggest and help to move those into repo-level NuGet.Config.
  • It can also help simplify any existing mappings.

Implementation details

  • Adds PackageSourceMappingService, modeled after FixVulnerabilitiesService, to launch GitHub Copilot with the current solution context and Package Source Mapping MCP tool.

  • Refactors FixVulnerabilitiesService to use the shared CopilotToolInvocationService.HandleSessionError method for error messaging and telemetry.

  • Adds Package Source Mapping navigation telemetry and test coverage.

  • Adds PackageSourceMapperCommand and Unified Settings registration for the button.

    • The command is hidden when no solution is open, which hides the button in the settings page.
  • A PackageSourceMappingService is added, closely mimicking the FixVulnerablitiesService.

  • Refactored FixVulnerablitiesService:

    • Extract HandleSessionError on CopilotToolInvocationService as a shared static method for error messaging + telemetry, used by both PSM and FixVulnerabilities services
  • Introduces CopilotToolSessionError as the shared session error model.

    • Fix Vulnerabilities now maps these errors to its existing telemetry-specific FixVulnerabilitiesWithCopilotErrorType.
  • Add a NavigatedTelemetryEvent event with matching test coverage

PR Checklist

@donnie-msft
donnie-msft requested a review from a team as a code owner August 4, 2026 14:46

@jebriede jebriede left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just one concern about overlapping command ids.

@donnie-msft
donnie-msft requested a review from jebriede August 6, 2026 04:24
@donnie-msft
donnie-msft merged commit 73bc1f9 into dev Aug 6, 2026
17 of 18 checks passed
@donnie-msft
donnie-msft deleted the dev-donnie-msft-usxPackageSourceMapper branch August 6, 2026 22:17
@donnie-msft donnie-msft changed the title Package Source Mapping VS Settings now has command to invoke GitHub Copilot- #7482 Package Source Mapping VS Settings now has command to invoke GitHub Copilot Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review your Package Source Mapping & Supply Chain Security with GitHub Copilot

3 participants