-
Notifications
You must be signed in to change notification settings - Fork 285
The Great Cancellation: Part 2 #1133
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
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 systematically adds CancellationToken parameters to asynchronous methods across the codebase as part of "The Great Cancellation: Part 2". The changes enable proper cancellation support for long-running operations and align with best practices for async/await patterns in C#.
Key Changes:
- Added
CancellationTokenparameters to service layer methods across multiple tools (Speech, Monitor, MySQL, EventGrid, Communication, etc.) - Updated corresponding unit tests to use
Arg.Any<CancellationToken>()for mock setups andTestContext.Current.CancellationTokenfor invoking product code - Modified interface definitions to include the cancellation token parameter with default values
Reviewed Changes
Copilot reviewed 116 out of 116 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Speech service files | Added CancellationToken to speech recognition methods and updated token handling in recognizers |
| Monitor service files | Added CancellationToken to metrics, logs, and monitoring service methods |
| MySQL/Postgres service files | Added CancellationToken to database operation methods |
| EventGrid service files | Added CancellationToken to event publishing and subscription methods |
| Communication service files | Added CancellationToken to SMS and email sending methods |
| Core services | Added CancellationToken to subscription and resource group service methods |
| Unit test files | Updated all mocks to use Arg.Any<CancellationToken>() and product code calls to use TestContext.Current.CancellationToken |
| Documentation | Updated new-command.md with guidelines for CancellationToken usage in tests |
...r/tests/Azure.Mcp.Tools.Monitor.UnitTests/HealthModels/Entity/EntityGetHealthCommandTests.cs
Show resolved
Hide resolved
...r/tests/Azure.Mcp.Tools.Monitor.UnitTests/HealthModels/Entity/EntityGetHealthCommandTests.cs
Show resolved
Hide resolved
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
56b80eb to
3de74e6
Compare
anuchandy
left a comment
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.
ty Steven!
tools/Azure.Mcp.Tools.Speech/src/Services/Recognizers/RealtimeTranscriptionRecognizer.cs
Show resolved
Hide resolved
- More random product code that needs CancellationToken parameters - Fixes to corresponding unit tests
3de74e6 to
f95cdb2
Compare
srnagar
left a comment
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.
LGTM
More changes after #1056
What does this PR do?
[Provide a clear, concise description of the changes][Any additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test prompts/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline