-
Notifications
You must be signed in to change notification settings - Fork 218
Allow forced creation when release plans already exist #12516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 support for forcing the creation of release plans even when existing plans are found, addressing issue #12489. The change adds a new --force-create-release flag that bypasses duplicate detection.
Key changes:
- Added a new command-line option to force release plan creation
- Enhanced duplicate detection to check both pull request URL and product/API version combinations
- Updated documentation to guide users on handling existing release plans
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ReleasePlanTool.cs | Added --force-create-release option and conditional duplicate checking logic |
| DevOpsService.cs | Added GetReleasePlansForProductAsync method to query existing plans by product and API version |
| create-release-plan.instructions.md | Updated workflow to handle existing release plans and present force creation option |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
| { | ||
| try | ||
| { | ||
| var query = $"SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '{Constants.AZURE_SDK_DEVOPS_RELEASE_PROJECT}' AND [Custom.ProductServiceTreeID] = '{productTreeId}' AND [System.WorkItemType] = 'Release Plan' AND [System.State] IN ('New','Not Started','In Progress')"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should skip the test release plans created with Tag Release Planner App Test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also check whether existing release plan is for same SDK release type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh interesting. This is a great find!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should skip the test release plans created with Tag
Release Planner App Test
with the condition that if the mcp is running under test mode, then we do want to make sure we only list the work items that have that tag :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. So we should avoid the release plans with test app tag when test mode env variable is present.
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
Outdated
Show resolved
Hide resolved
eng/common/instructions/azsdk-tools/create-release-plan.instructions.md
Outdated
Show resolved
Hide resolved
| { | ||
| try | ||
| { | ||
| var query = $"SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '{Constants.AZURE_SDK_DEVOPS_RELEASE_PROJECT}' AND [Custom.ProductServiceTreeID] = '{productTreeId}' AND [System.WorkItemType] = 'Release Plan' AND [System.State] IN ('New','Not Started','In Progress')"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh interesting. This is a great find!
| { | ||
| try | ||
| { | ||
| var query = $"SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '{Constants.AZURE_SDK_DEVOPS_RELEASE_PROJECT}' AND [Custom.ProductServiceTreeID] = '{productTreeId}' AND [System.WorkItemType] = 'Release Plan' AND [System.State] IN ('New','Not Started','In Progress')"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should skip the test release plans created with Tag
Release Planner App Test
with the condition that if the mcp is running under test mode, then we do want to make sure we only list the work items that have that tag :)
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
| return new ObjectCommandResponse | ||
| // Check for existing release plan for the given pull request URL. | ||
| logger.LogInformation("Checking for existing release plan for pull request URL: {specPullRequestUrl}", specPullRequestUrl); | ||
| var existingReleasePlan = await devOpsService.GetReleasePlanAsync(specPullRequestUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are multiples Release plans with the same API spec PR, wouldn't this return a list of release plans?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think service method fetches only latest release plan. @smw-ms can you please check and confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one release plan is returned. looking at the code there is no sorting happening, it just returns the first linked release plan it comes across, so there is no guarantee that it is the latest release plan
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
|
The following pipelines have been queued for testing: |
Co-authored-by: Praven Kuttappan <[email protected]>
|
The following pipelines have been queued for testing: |
tools/azsdk-cli/Azure.Sdk.Tools.Cli/Tools/ReleasePlan/ReleasePlanTool.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Ben Broderick Phillips <[email protected]>
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
… existing-release-plan-during-creation
|
The following pipelines have been queued for testing: |
… existing-release-plan-during-creation
|
The following pipelines have been queued for testing: |
|
/check-enforcer override |
Issue: #12489