Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vukelich
Copy link
Member

More changes after #1056

  • More random product code that needs CancellationToken parameters
  • Fixes to corresponding unit tests

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

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a 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 CancellationToken parameters 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 and TestContext.Current.CancellationToken for 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

@vukelich
Copy link
Member Author

/azp run mcp - pullrequest - live

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vukelich vukelich force-pushed the users/vukelich/cancellation_part2 branch 2 times, most recently from 56b80eb to 3de74e6 Compare November 11, 2025 02:14
Copy link
Member

@anuchandy anuchandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty Steven!

- More random product code that needs CancellationToken parameters
- Fixes to corresponding unit tests
@vukelich vukelich force-pushed the users/vukelich/cancellation_part2 branch from 3de74e6 to f95cdb2 Compare November 11, 2025 19:40
@vukelich vukelich enabled auto-merge (squash) November 11, 2025 21:58
Copy link
Member

@srnagar srnagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vukelich vukelich merged commit 2050f7d into main Nov 11, 2025
36 checks passed
@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Nov 11, 2025
@vukelich vukelich deleted the users/vukelich/cancellation_part2 branch November 11, 2025 21:59
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants