[Draft] SDK breaking change detect mcp tool#15588
Draft
chunyu3 wants to merge 14 commits into
Draft
Conversation
…yuc/breaking-detect-tool
Contributor
There was a problem hiding this comment.
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
SdkBreakingChangeDetectToolwith 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 defaultDetectSdkBreakingChangeAsyncstub. - 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")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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