Merged
Conversation
Contributor
There was a problem hiding this comment.
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 |
Member
Author
|
/azp run mcp - pullrequest - live |
|
Azure Pipelines successfully started running 1 pipeline(s). |
56b80eb to
3de74e6
Compare
anuchandy
approved these changes
Nov 11, 2025
srnagar
approved these changes
Nov 11, 2025
- More random product code that needs CancellationToken parameters - Fixes to corresponding unit tests
3de74e6 to
f95cdb2
Compare
This was referenced Nov 14, 2025
colbytimm
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Dec 8, 2025
* The Great Cancellation: Part 2 - More random product code that needs CancellationToken parameters - Fixes to corresponding unit tests
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.
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