Skip to content

Make release plan mandatory for SDK generation#15618

Draft
praveenkuttappan wants to merge 2 commits into
Azure:mainfrom
praveenkuttappan:make_release_plan_required
Draft

Make release plan mandatory for SDK generation#15618
praveenkuttappan wants to merge 2 commits into
Azure:mainfrom
praveenkuttappan:make_release_plan_required

Conversation

@praveenkuttappan
Copy link
Copy Markdown
Member

Make release plan as required for SDK generation

Copilot AI review requested due to automatic review settings May 13, 2026 22:16
@praveenkuttappan praveenkuttappan requested a review from a team as a code owner May 13, 2026 22:16
@github-actions github-actions Bot added the azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli label May 13, 2026
@praveenkuttappan praveenkuttappan marked this pull request as draft May 13, 2026 22:17
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

Makes the release plan work item ID a required input for the SDK generation flow in the azsdk-cli SpecWorkflowTool, both at the CLI option level and at the RunGenerateSdkAsync API/MCP tool level, and adds an explicit early-failure response when no work item ID is supplied.

Changes:

  • Marks the --workitem-id CLI option as Required = true and updates the MCP tool description.
  • Reorders RunGenerateSdkAsync parameters so workItemId is positioned before the optional pullRequestNumber and is no longer defaulted.
  • Adds an early validation that returns a Failed response with guidance when workItemId == 0.
Comments suppressed due to low confidence (2)

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/SpecWorkFlowTool.cs:198

  • With workItemId now required and validated to be non-zero at the top of the method (returning early when it is 0), the later if (workItemId > 0) check around the call to IsSdkDetailsPresentInReleasePlanAsync (around line 237) is now always true. That conditional should be simplified to an unconditional call to keep the control flow clear and avoid misleading dead-branch logic.
                if (workItemId == 0)
                {
                    response.ResponseErrors.Add("Release plan work item ID is required to run SDK generation.");
                    response.Status = "Failed";
                    response.NextSteps = ["Create a release plan work item if you don't have one or get existing release plan work item and re-run SDK generation."];
                    return response;
                }

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/SpecWorkFlowTool.cs:198

  • Existing tests GenerateSdk_Without_pr_and_workitem, GenerateSdk_With_pr_and_no_workitem, and GenerateSdk_With_Invalid_TypeSpec_Path (in SpecWorkFlowToolTests.cs) call RunGenerateSdkAsync without providing workItemId, and they assert success ("Azure DevOps pipeline ... has been initiated"). After this change, those calls will short-circuit with the new "Release plan work item ID is required" error and the assertions will fail. The tests need to be updated (either to supply a non-zero workItemId or to assert the new required-validation behavior), and a new test should cover the workItemId == 0 failure path.
                if (workItemId == 0)
                {
                    response.ResponseErrors.Add("Release plan work item ID is required to run SDK generation.");
                    response.Status = "Failed";
                    response.NextSteps = ["Create a release plan work item if you don't have one or get existing release plan work item and re-run SDK generation."];
                    return response;
                }

[McpServerTool(Name = RunGenerateSdkToolName), Description("Generate SDK from a TypeSpec project using pipeline.")]
public async Task<ReleaseWorkflowResponse> RunGenerateSdkAsync(string typespecProjectRoot, string sdkReleaseType, string language, int pullRequestNumber = 0, int workItemId = 0, string apiVersion = "", CancellationToken ct = default)
[McpServerTool(Name = RunGenerateSdkToolName), Description("Generate SDK from a TypeSpec project using pipeline. Release plan work item ID is required to run SDK generation.")]
public async Task<ReleaseWorkflowResponse> RunGenerateSdkAsync(string typespecProjectRoot, string sdkReleaseType, string language, int workItemId, int pullRequestNumber = 0, string apiVersion = "", CancellationToken ct = default)
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