Skip to content

[Draft] SDK breaking change detect mcp tool#15588

Draft
chunyu3 wants to merge 14 commits into
mainfrom
yuc/breaking-detect-tool
Draft

[Draft] SDK breaking change detect mcp tool#15588
chunyu3 wants to merge 14 commits into
mainfrom
yuc/breaking-detect-tool

Conversation

@chunyu3
Copy link
Copy Markdown
Member

@chunyu3 chunyu3 commented May 11, 2026

implement a SDK-breaking-change-detector mcp tool which will detect and classify breaking changes according to the SDK breaking changes policy for each language, and identify which breaking change is resolvable.

command:

azsdk package detect-breaking-change --package-path <sdk-package-path> --language <language> --tsp-config-path <path-to-tsp-config-file> --generate-sdk <Ture/False>

Options:

  • --package-path <value>: (Required) The SDK package path
  • --language <value>: (optional) The SDK language
  • --tsp-config-path: (Optional) Path to the 'tspconfig.yaml' configuration file, it can be a local path or remote HTTPS URL
  • --generate-sdk: (Optional) indicate whether need to generate sdk. default is False

Copilot AI review requested due to automatic review settings May 11, 2026 07:15
@chunyu3 chunyu3 requested a review from a team as a code owner May 11, 2026 07:15
@github-actions github-actions Bot added the azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli label May 11, 2026
@chunyu3 chunyu3 changed the title SDK breaking change detect mcp tool [Draft] SDK breaking change detect mcp tool May 11, 2026
@chunyu3 chunyu3 marked this pull request as draft May 11, 2026 07:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new azsdk package detect-breaking-change MCP/CLI tool intended to detect and classify SDK breaking changes (with management-plane support via a configured “get SDK changes” script, plus AI-based classification using a language-specific breaking-change guide).

Changes:

  • Introduces SdkBreakingChangeDetectTool with a new MCP tool (azsdk_package_detect_breaking_change) and CLI command (detect-breaking-change).
  • Adds language-service plumbing for breaking-change pattern retrieval (SDKBreakingPatternFilePath + GetSDKBreakingPattern) and a default DetectSdkBreakingChangeAsync stub.
  • Extends spec-gen SDK config support to allow a configured getSDKChangesScript (command or script path).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/Package/SdkBreakingChangeDetectTool.cs New MCP/CLI entrypoint to fetch SDK change data (mgmt-plane) and classify breaking changes via an agent.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/PythonLanguageService.VersionUpdate.cs Sets the Python repo path to the breaking-change guide used for classification.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/LanguageService.cs Adds breaking-change pattern retrieval support and a default breaking-change detection method.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/Languages/GoLanguageService.Checks.cs Sets the Go repo path to the breaking-change guide used for classification.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Prompts/Templates/SdkBreakingChangeClassificationTemplate.cs New prompt template driving the breaking-change classification agent output format.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Models/Responses/Package/SdkBreakingChangeDetectResponse.cs New response type for reporting breaking-change detection results.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/SpecGenSdkConfigHelper.cs Adds config lookup support for getSDKChangesScript (command/path) and a new config enum value.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Commands/SharedOptions.cs Registers the new tool so it’s discoverable/hosted in MCP mode.

{
return new SdkBreakingChangeDetectResponse
{
ResponseError = $"The directory for the local sdk does not provide or exist at the specified path: {packagePath}. Prompt user to clone the matched SDK repository users want to generate SDK against."
Comment on lines +105 to +106
logger.LogInformation("SDK code generation is enabled. Executing SDK generation before breaking change detection...");
// TODO: Implement SDK generation logic here
Comment on lines +201 to +204
logger.LogError("Failed to deserialize the SDK change script output. Falling back to default logic to detect SDK breaking changes.");
return new SdkBreakingChangeDetectResponse
{
ResponseError = "Failed to deserialize the SDK change script output. Falling back to default logic to detect SDK breaking changes.",
Comment on lines +171 to +175
using var fileStream = File.OpenRead(sdkChangeFilePath);
var sdkchanges = await JsonSerializer.DeserializeAsync<SdkChange>(fileStream, cancellationToken: ct);

// clean up the SDK change file after reading
fileStream.Close();
Comment on lines +280 to +282
catch (JsonException ex)
{
logger.LogError(ex, "JSON parsing error while parsing agent response");
Comment on lines +6 to +10
public class SdkBreakingChangeDetectResponse: PackageResponseBase
{
public SdkBreakingChange[] BreakingChanges { get; set; }
public bool HasBreakingChanges;

Comment on lines +2 to +10
using Azure.Sdk.Tools.Cli.Tools.Package;

namespace Azure.Sdk.Tools.Cli.Models.Responses.Package
{
public class SdkBreakingChangeDetectResponse: PackageResponseBase
{
public SdkBreakingChange[] BreakingChanges { get; set; }
public bool HasBreakingChanges;

Comment on lines +1 to +3
using System.Text;
using Azure.Sdk.Tools.Cli.Tools.Package;

[JsonPropertyName("changelog_md")]
[Required]
public string ChangelogMD { get; set; }
[JsonPropertyName("hasBreakingChange")]

public class SdkBreakingChange
{
[JsonPropertyName("breakingchange")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants