Skip to content

Optional api version#14860

Open
jeo02 wants to merge 8 commits intoAzure:mainfrom
jeo02:Optional-api-version
Open

Optional api version#14860
jeo02 wants to merge 8 commits intoAzure:mainfrom
jeo02:Optional-api-version

Conversation

@jeo02
Copy link
Copy Markdown
Member

@jeo02 jeo02 commented Apr 1, 2026

Makes the API version as an optional field. Also removes the api version from create release plan and update release plan.
Generated SDK without api version: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6094156&view=results
From #14816

@jeo02 jeo02 requested a review from a team as a code owner April 1, 2026 17:21
@github-actions github-actions bot added the azsdk-cli Issues related to Azure/azure-sdk-tools::tools/azsdk-cli label Apr 1, 2026
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

This PR implements issue #14816 by making the SDK-generation API version optional and removing API version handling from release plan create/update flows in the azsdk-cli ReleasePlan tools.

Changes:

  • Make --api-version optional for the spec-workflow “generate SDK” command/tool and pass it to the pipeline only when provided.
  • Remove API version as an input to CreateReleasePlan/UpdateReleasePlan flows (and stop updating API version on the API spec child work item).
  • Simplify “existing release plans for product” lookup by removing the API-version filter from GetReleasePlansForProductAsync.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/SpecWorkFlowTool.cs Makes --api-version optional for SDK generation and updates parameter passing accordingly.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs Removes API version from create/update release plan method signatures and related validation/updates.
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/DevOpsService.cs Updates DevOps service interface/query signature and conditionally includes ApiVersion pipeline template parameter.
Comments suppressed due to low confidence (2)

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs:353

  • Update-release-plan no longer reads/passes --api-version, but the update command still includes updateApiVersionOpt and it is Required = true (see option definition earlier in this file). This will force users to provide an API version that is ignored, and it also increases the chance of null/invalid values being passed for the now-required sdkReleaseType parameter. Remove/relax the --api-version option and align option required-ness with the updated method signature.
                case updateReleasePlanCommandName:
                    return await UpdateReleasePlan(
                        typeSpecProjectPath: commandParser.GetValue(updateTypeSpecProjectPathOpt),
                        workItemId: commandParser.GetValue(workItemIdOpt),
                        sdkReleaseType: commandParser.GetValue(updateSdkReleaseTypeOpt),
                        specPullRequestUrl: commandParser.GetValue(pullRequestOpt),
                        serviceTreeId: commandParser.GetValue(optionalServiceTreeIdOpt),
                        productTreeId: commandParser.GetValue(optionalProductTreeIdOpt),
                        ct: ct
                    );

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Services/DevOpsService.cs:99

  • IDevOpsService.GetReleasePlansForProductAsync removed the specApiVersion parameter. Any existing IDevOpsService implementations (including test mocks like MockDevOpsService) must be updated to match the new interface; otherwise the solution won't compile.
    public interface IDevOpsService
    {
        public Task<List<ReleasePlanWorkItem>> ListOverdueReleasePlansAsync(CancellationToken ct);
        public Task<ReleasePlanWorkItem> GetReleasePlanAsync(int releasePlanId, CancellationToken ct);
        public Task<ReleasePlanWorkItem> GetReleasePlanForWorkItemAsync(int workItemId, CancellationToken ct);
        public Task<ReleasePlanWorkItem> GetReleasePlanAsync(string pullRequestUrl, CancellationToken ct);
        public Task<List<ReleasePlanWorkItem>> GetReleasePlansForProductAsync(string productTreeId, string sdkReleaseType, bool isTestReleasePlan = false, CancellationToken ct = default);
        public Task<List<ReleasePlanWorkItem>> GetReleasePlansForPackageAsync(string packageName, string language, bool isTestReleasePlan = false, CancellationToken ct = default);
        public Task<WorkItem> CreateReleasePlanWorkItemAsync(ReleasePlanWorkItem releasePlan, CancellationToken ct);
        public Task<Build> RunSDKGenerationPipelineAsync(string apiSpecBranchRef, string typespecProjectRoot, string apiVersion, string sdkReleaseType, string language, int workItemId, string sdkRepoBranch = "", CancellationToken ct = default);
        public Task<Build> GetPipelineRunAsync(int buildId, CancellationToken ct);

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.

4 participants