Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Plan Creation Process
You goal is to create a valid release plan. You must prompt user to provide all required information and all input must match the format and requirement mentioned in step 3 below.
Comment thread
smw-ms marked this conversation as resolved.
Outdated

> **Important Note**
Comment thread
maririos marked this conversation as resolved.
Outdated
> Do **not** ask the user to manually edit the DevOps work item.
> To update a release plan manually, the user must use the [Release Planner Tool](https://aka.ms/sdk-release-planner).
> When referring to a release plan in conversation with a user:
> - Always include both the **Release Plan Link** and **Release Plan ID** for clarity.
> - If the reference is intended for use by the LLM (e.g., for internal logic), use the **Release Plan Work Item ID** instead.

Follow these steps in order to create or manage a release plan for an API specification pull request:

## Step 1: Validate Prerequisites
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ public async Task Test_Create_releasePlan_with_valid_inputs()
var testCodeFilePath = "TypeSpecTestData/specification/testcontoso/Contoso.Management";
var releaseplan = await releasePlanTool.CreateReleasePlan(testCodeFilePath, "July 2025", "12345678-1234-5678-9012-123456789012", "12345678-1234-5678-9012-123456789012", "2025-01-01", "https://github.com/Azure/azure-rest-api-specs/pull/35446", "beta", isTestReleasePlan: true);
Assert.IsNotNull(releaseplan);
Assert.True(releaseplan.Contains("Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem"));
Assert.True(releaseplan.Contains("ReleasePlanDetails"));

releaseplan = await releasePlanTool.CreateReleasePlan(testCodeFilePath, "July 2025", "12345678-1234-5678-9012-123456789012", "12345678-1234-5678-9012-123456789012", "2025-01-01-preview", "https://github.com/Azure/azure-rest-api-specs/pull/35446", "beta", isTestReleasePlan: true);
Assert.IsNotNull(releaseplan);
Assert.True(releaseplan.Contains("Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem"));
Assert.True(releaseplan.Contains("ReleasePlanDetails"));
}

[Test]
Expand Down Expand Up @@ -136,7 +136,7 @@ public async Task Test_Create_releasePlan_with_AZSDKTOOLS_AGENT_TESTING_true_cre

// Assert
Assert.IsNotNull(releaseplan);
Assert.True(releaseplan.Contains("Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem"));
Assert.True(releaseplan.Contains("ReleasePlanDetails"));

// Verify the environment helper was called
environmentHelperMock.Verify(x => x.GetBooleanVariable("AZSDKTOOLS_AGENT_TESTING", false), Times.Once);
Expand Down Expand Up @@ -173,7 +173,7 @@ public async Task Test_Create_releasePlan_with_AZSDKTOOLS_AGENT_TESTING_false_re

// Assert
Assert.IsNotNull(releaseplan);
Assert.True(releaseplan.Contains("Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models.WorkItem"));
Assert.True(releaseplan.Contains("ReleasePlanDetails"));

// Verify the environment helper was called
environmentHelperMock.Verify(x => x.GetBooleanVariable("AZSDKTOOLS_AGENT_TESTING", false), Times.Once);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,46 @@ public class ReleasePlanDetails
public string SDKLanguages { get; set; } = string.Empty;
public bool IsSpecApproved { get; set; } = false;
public int ApiSpecWorkItemId { get; set; } = 0;
public override string ToString()
{
var sdkInfoFormatted = SDKInfo != null && SDKInfo.Any()
? string.Join("\n ", SDKInfo.Select(s => s.ToString()))
: "None";

var specPullRequestsFormatted = SpecPullRequests != null && SpecPullRequests.Any()
? string.Join(", ", SpecPullRequests)
: "None";

return $@"ReleasePlanDetails:
Comment thread
smw-ms marked this conversation as resolved.
Outdated
WorkItemId: {WorkItemId}
WorkItemUrl: {WorkItemUrl}
WorkItemHtmlUrl: {WorkItemHtmlUrl}
ServiceTreeId: {ServiceTreeId}
ProductTreeId: {ProductTreeId}
ProductName: {ProductName}
Title: {Title}
Description: {Description}
Owner: {Owner}
Status: {Status}
SpecPullRequests: [{specPullRequestsFormatted}]
SDKReleaseMonth: {SDKReleaseMonth}
IsManagementPlane: {IsManagementPlane}
IsDataPlane: {IsDataPlane}
SpecAPIVersion: {SpecAPIVersion}
SpecType: {SpecType}
ReleasePlanLink: {ReleasePlanLink}
IsTestReleasePlan: {IsTestReleasePlan}
ReleasePlanId: {ReleasePlanId}
SDKReleaseType: {SDKReleaseType}
SDKInfo:
{sdkInfoFormatted}
ReleasePlanSubmittedByEmail: {ReleasePlanSubmittedByEmail}
IsCreatedByAgent: {IsCreatedByAgent}
ActiveSpecPullRequest: {ActiveSpecPullRequest}
SDKLanguages: {SDKLanguages}
IsSpecApproved: {IsSpecApproved}
ApiSpecWorkItemId: {ApiSpecWorkItemId}";
}

public Microsoft.VisualStudio.Services.WebApi.Patch.Json.JsonPatchDocument GetPatchDocument()
{
Expand Down Expand Up @@ -132,7 +172,15 @@ public class SDKInfo
{
public string Language { get; set; } = string.Empty;
public string GenerationPipelineUrl { get; set; } = string.Empty;
public string SdkPullRequestUrl { get; set; } = string.Empty;
public string SdkPullRequestUrl { get; set; } = string.Empty;
public string PackageName { get; set; } = string.Empty;
public override string ToString()
{
return $@"SDKInfo:
Language: {Language}
GenerationPipelineUrl: {GenerationPipelineUrl}
SdkPullRequestUrl: {SdkPullRequestUrl}
PackageName: {PackageName}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Please create a pull request in the public Azure/azure-rest-api-specs repository
}
}

[McpServerTool(Name = "azsdk_create_release_plan"), Description("Create Release Plan work item.")]
[McpServerTool(Name = "azsdk_create_release_plan"), Description("Create Release Plan")]
public async Task<string> CreateReleasePlan(string typeSpecProjectPath, string targetReleaseMonthYear, string serviceTreeId, string productTreeId, string specApiVersion, string specPullRequestUrl, string sdkReleaseType, string userEmail = "", bool isTestReleasePlan = false)
{
try
Expand Down Expand Up @@ -272,7 +272,22 @@ public async Task<string> CreateReleasePlan(string typeSpecProjectPath, string t
}
else
{
return output.Format(workItem);
if (workItem.Id is int workItemId)
Comment thread
maririos marked this conversation as resolved.
{
releasePlan.WorkItemId = workItemId;
}

if (workItem.Fields.TryGetValue("Custom.ReleasePlanId", out var value) && value is int releasePlanId)
{
releasePlan.ReleasePlanId = releasePlanId;
}

if (workItem.Fields.TryGetValue("Custom.ReleasePlanLink", out value) && value is string releasePlanLink)
Comment thread
smw-ms marked this conversation as resolved.
{
releasePlan.ReleasePlanLink = releasePlanLink;
}

return output.Format(releasePlan);
Comment thread
maririos marked this conversation as resolved.
Outdated
}
}
catch (Exception ex)
Expand Down
Loading