Skip to content

Cleanup repo to follow best practices - #3291

Merged
Alan Zimmer (alzimmermsft) merged 4 commits into
microsoft:mainfrom
alzimmermsft:CleanupRepoToFollowBestPractices
Aug 18, 2026
Merged

Cleanup repo to follow best practices#3291
Alan Zimmer (alzimmermsft) merged 4 commits into
microsoft:mainfrom
alzimmermsft:CleanupRepoToFollowBestPractices

Conversation

@alzimmermsft

Copy link
Copy Markdown
Contributor

What does this PR do?

Clean-up to follow coding best practices:

  • Use BaseAzureService.WaitForLroCompletionAsync to handle polling long-running operations until completion.
  • Only use *.Tests for test projects, not *.UnitTests or *.LiveTests.

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
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • 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 running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • 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 tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • 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 command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • 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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 standardizes long-running ARM operation handling by switching to WaitUntil.Started + BaseAzureService.WaitForLroCompletionAsync, and normalizes test project naming/namespace conventions to use *.Tests instead of *.UnitTests / *.LiveTests.

Changes:

  • Updated multiple Azure resource operations (Resilience Management, Azure Backup) to start LROs and then explicitly await completion via WaitForLroCompletionAsync.
  • Renamed/realigned test project namespaces and InternalsVisibleTo targets from *.UnitTests / *.LiveTests to *.Tests, and updated solution references accordingly.
  • Introduced new *.Tests csproj files for internal tooling test projects (ToolMetadataExporter, ToolDescriptionEvaluator).

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

Reviewed changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.ResilienceManagement/src/Services/ResilienceManagementService.cs Uses WaitUntil.Started + WaitForLroCompletionAsync for ARM LROs when creating usage plans/enrollments.
tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/IoTHubCommandTests.cs Renames test namespace from LiveTests to Tests.
tools/Azure.Mcp.Tools.IoTHub/tests/Azure.Mcp.Tools.IoTHub.Tests/assets.json Updates recorded-test assets tag naming to match *.Tests.
tools/Azure.Mcp.Tools.IoTHub/src/AssemblyInfo.cs Updates InternalsVisibleTo to the new Azure.Mcp.Tools.IoTHub.Tests assembly name.
tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Services/SamplingServiceTests.cs Renames test namespace from UnitTests to Tests.
tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Services/PropertyAggregatorTests.cs Renames test namespace from UnitTests to Tests.
tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Services/AggregationFilterTests.cs Renames test namespace from UnitTests to Tests.
tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/InsightsGetCommandTests.cs Adds localized warning suppression and renames namespace to Tests.
tools/Azure.Mcp.Tools.Insights/tests/Azure.Mcp.Tools.Insights.Tests/Azure.Mcp.Tools.Insights.Tests.csproj Removes project-wide MCP9005 suppression in favor of localized suppression in tests.
tools/Azure.Mcp.Tools.Insights/src/AssemblyInfo.cs Consolidates InternalsVisibleTo entries to the new *.Tests assembly name.
tools/Azure.Mcp.Tools.AzureBackup/tests/Azure.Mcp.Tools.AzureBackup.Tests/AzureBackupCommandTests.cs Updates doc comment cref (but currently introduces an unresolved cref issue).
tools/Azure.Mcp.Tools.AzureBackup/src/Services/RsvBackupOperations.cs Switches RSV operations to WaitUntil.Started + WaitForLroCompletionAsync.
tools/Azure.Mcp.Tools.AzureBackup/src/Services/DppBackupOperations.cs Switches DPP operations to WaitUntil.Started + WaitForLroCompletionAsync.
servers/Azure.Mcp.Server/Azure.Mcp.Server.slnx Updates solution reference to Insights test project path/name (*.Tests).
Microsoft.Mcp.slnx Updates solution references to *.Tests for multiple tool/test projects.
eng/tools/Tools.sln Renames ToolMetadataExporter test project entry to ToolMetadataExporter.Tests.
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/ToolMetadataExporter.Tests.csproj Adds new test csproj (but missing HasUnitTests/HasLiveTests metadata).
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/ToolAnalyzerTests.cs Renames namespace to ToolMetadataExporter.Tests.
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/Services/AzureMcpKustoDatastoreTests.cs Renames namespace to ToolMetadataExporter.Tests.Services.
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/Services/AzmcpProgramTests.cs Renames namespace to ToolMetadataExporter.Tests.Services.
eng/tools/ToolMetadataExporter/tests/ToolMetadataExporter.Tests/Models/RunInformationTests.cs Renames namespace to ToolMetadataExporter.Tests.Models.
eng/tools/ToolMetadataExporter/src/AssemblyInfo.cs Updates InternalsVisibleTo to the new ToolMetadataExporter.Tests assembly name.
eng/tools/ToolDescriptionEvaluator/ToolDescriptionEvaluator.sln Renames ToolDescriptionEvaluator test project to *.Tests.
eng/tools/ToolDescriptionEvaluator/tests/ToolDescriptionEvaluator.Tests/VectorDBTests.cs Renames namespace to ToolDescriptionEvaluator.Tests.
eng/tools/ToolDescriptionEvaluator/tests/ToolDescriptionEvaluator.Tests/ToolDescriptionEvaluator.Tests.csproj Adds new ToolDescriptionEvaluator *.Tests csproj with HasUnitTests/HasLiveTests metadata.
eng/tools/ToolDescriptionEvaluator/tests/ToolDescriptionEvaluator.Tests/InMemoryVectorStoreCollectionTests.cs Renames namespace to ToolDescriptionEvaluator.Tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alzimmermsft
Alan Zimmer (alzimmermsft) merged commit e8aa497 into microsoft:main Aug 18, 2026
17 of 18 checks passed
@alzimmermsft
Alan Zimmer (alzimmermsft) deleted the CleanupRepoToFollowBestPractices branch August 18, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants