Open
Conversation
Contributor
There was a problem hiding this comment.
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-versionoptional 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/UpdateReleasePlanflows (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 includesupdateApiVersionOptand it isRequired = 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-requiredsdkReleaseTypeparameter. Remove/relax the--api-versionoption 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.GetReleasePlansForProductAsyncremoved thespecApiVersionparameter. Any existingIDevOpsServiceimplementations (including test mocks likeMockDevOpsService) 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);
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Show resolved
Hide resolved
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…-sdk-tools into Optional-api-version
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.
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