Make release plan mandatory for SDK generation#15618
Draft
praveenkuttappan wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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-idCLI option asRequired = trueand updates the MCP tool description. - Reorders
RunGenerateSdkAsyncparameters soworkItemIdis positioned before the optionalpullRequestNumberand is no longer defaulted. - Adds an early validation that returns a
Failedresponse with guidance whenworkItemId == 0.
Comments suppressed due to low confidence (2)
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/SpecWorkFlowTool.cs:198
- With
workItemIdnow required and validated to be non-zero at the top of the method (returning early when it is 0), the laterif (workItemId > 0)check around the call toIsSdkDetailsPresentInReleasePlanAsync(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, andGenerateSdk_With_Invalid_TypeSpec_Path(in SpecWorkFlowToolTests.cs) callRunGenerateSdkAsyncwithout providingworkItemId, 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) |
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.
Make release plan as required for SDK generation