-
Notifications
You must be signed in to change notification settings - Fork 233
Add new MCP tool to update language exclusion justification #12417
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
Merged
praveenkuttappan
merged 5 commits into
Azure:main
from
praveenkuttappan:language_exclusion_mcp_tools
Oct 8, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7e65bdf
Add new MCP tool to update language exclusion justification
praveenkuttappan 35327f0
Add optional language param to request exclusion for a language
praveenkuttappan f52a215
Apply suggestions from code review
praveenkuttappan 387c143
Fix spelling
praveenkuttappan 3a8aa9d
Updated change log
praveenkuttappan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
94 changes: 94 additions & 0 deletions
94
tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Tools/ReleasePlanManualTests.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using Azure.Sdk.Tools.Cli.Helpers; | ||
| using Azure.Sdk.Tools.Cli.Models; | ||
| using Azure.Sdk.Tools.Cli.Services; | ||
| using Azure.Sdk.Tools.Cli.Tests.Mocks.Services; | ||
| using Azure.Sdk.Tools.Cli.Tests.TestHelpers; | ||
| using Azure.Sdk.Tools.Cli.Tools.ReleasePlan; | ||
| using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Helpers; | ||
| using Moq; | ||
|
|
||
| namespace Azure.Sdk.Tools.Cli.Tests.Tools | ||
| { | ||
| internal class ReleasePlanManualTests | ||
| { | ||
| private IAzureService azureService; | ||
| private IDevOpsService devOpsService; | ||
| private ReleasePlanTool releasePlan; | ||
| private TestLogger<ReleasePlanTool> logger; | ||
| private IGitHubService gitHubService; | ||
| private ITypeSpecHelper typeSpecHelper; | ||
| private IUserHelper userHelper; | ||
| private IEnvironmentHelper environmentHelper; | ||
|
|
||
| public ReleasePlanManualTests() | ||
| { | ||
| azureService = new AzureService(); | ||
| var devopsLogger = new TestLogger<DevOpsService>(); | ||
| var devopsConnection = new DevOpsConnection(azureService); | ||
| devOpsService = new DevOpsService(devopsLogger, devopsConnection); | ||
|
|
||
| logger = new TestLogger<ReleasePlanTool>(); | ||
| gitHubService = new Mock<IGitHubService>().Object; | ||
|
|
||
| var typeSpecHelperMock = new Mock<ITypeSpecHelper>(); | ||
| typeSpecHelperMock.Setup(x => x.IsRepoPathForPublicSpecRepo(It.IsAny<string>())).Returns(true); | ||
| typeSpecHelper = typeSpecHelperMock.Object; | ||
|
|
||
| var userHelperMock = new Mock<IUserHelper>(); | ||
| userHelperMock.Setup(x => x.GetUserEmail()).ReturnsAsync("test@example.com"); | ||
| userHelper = userHelperMock.Object; | ||
|
|
||
| var environmentHelperMock = new Mock<IEnvironmentHelper>(); | ||
| environmentHelperMock.Setup(x => x.GetBooleanVariable(It.IsAny<string>(), It.IsAny<bool>())).Returns(false); | ||
| environmentHelper = environmentHelperMock.Object; | ||
| releasePlan = new ReleasePlanTool(devOpsService, typeSpecHelper, logger, userHelper, gitHubService, environmentHelper); | ||
| } | ||
|
|
||
| [Test] // disabled by default because it makes real API calls | ||
| [Ignore("Manual test - requires real API calls")] | ||
| public async Task Test_UpdateExclusionJustification() | ||
| { | ||
| int releasePlanWorkItemId = 28940; // replace with a real release plan ID | ||
| string exclusionJustification = "Updated justification for exclusion."; | ||
| var updateStatus = await this.releasePlan.UpdateLanguageExclusionJustification(releasePlanWorkItemId, exclusionJustification); | ||
| Assert.IsNotNull(updateStatus); | ||
| Assert.That(updateStatus.Message, Does.Contain("Updated language exclusion")); | ||
|
|
||
| var releasePlanInfo = await this.devOpsService.GetReleasePlanForWorkItemAsync(releasePlanWorkItemId); | ||
| Assert.That(exclusionJustification, Is.EqualTo(releasePlanInfo.LanguageExclusionRequesterNote)); | ||
| } | ||
|
|
||
| [Test] // disabled by default because it makes real API calls | ||
| [Ignore("Manual test - requires real API calls")] | ||
| public async Task Test_UpdateExclusionJustificationWithLanguage() | ||
| { | ||
| int releasePlanWorkItemId = 28940; // replace with a real release plan ID | ||
| string exclusionJustification = "Updated justification for exclusion."; | ||
| var updateStatus = await this.releasePlan.UpdateLanguageExclusionJustification(releasePlanWorkItemId, exclusionJustification, "Java"); | ||
| Assert.IsNotNull(updateStatus); | ||
| Assert.That(updateStatus.Message, Does.Contain("Updated language exclusion")); | ||
|
|
||
| var releasePlanInfo = await this.devOpsService.GetReleasePlanForWorkItemAsync(releasePlanWorkItemId); | ||
| Assert.That(exclusionJustification, Is.EqualTo(releasePlanInfo.LanguageExclusionRequesterNote)); | ||
| } | ||
|
|
||
|
|
||
| [Test] // disabled by default because it makes real API calls | ||
| [Ignore("Manual test - requires real API calls")] | ||
| public async Task Test_Get_ReleaseExclusionStatus() | ||
| { | ||
| int releasePlan = 28940; // replace with a real release plan ID | ||
| var releasePlanInfo = await this.devOpsService.GetReleasePlanForWorkItemAsync(releasePlan); | ||
| Assert.IsNotNull(releasePlanInfo); | ||
|
|
||
| var pythonSdk = releasePlanInfo.SDKInfo.FirstOrDefault(sdk => sdk.Language.Equals("Python", StringComparison.OrdinalIgnoreCase)); | ||
| Assert.IsNotNull(pythonSdk); | ||
| Assert.That(pythonSdk.ReleaseExclusionStatus, Is.EqualTo("Requested")); | ||
| } | ||
| } | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
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.
lol