π― Repository Quality Improvement Report β Extension UID Stability and Naming Governance
Analysis Date: 2026-07-08
Focus Area: Extension UID Stability and Naming Governance
Strategy Type: Custom
Executive Summary
Every MTP extension and internal platform service implements IExtension.Uid, which is SHA-256-hashed for AppInsights telemetry, displayed verbatim in --info output and error messages, embedded in artifact metadata, and used in feature-detection tests. Renaming the implementing class automatically and silently changes the Uid.
Analysis found 47 IExtension.Uid property definitions and 13 CommandLineOptionsProviderBase UID constructor arguments β ~60 total β that resolve their value via nameof(ClassName). The IExtension.Uid interface doc mentions uniqueness but not stability. Contrast this with the GUID-based auto-registration system, where the MSBuild .props files carry a block-caps warning: "DO NOT CHANGE THE GUID, IT'S A WELL KNOWN EXTENSION POINT." One concrete defect surfaces immediately: MSBuildCommandLineProvider passes nameof(MSBuildCommandLineProvider) as its displayName argument, so --info exposes the internal class name to end users.
Full Analysis
Metrics
| Metric |
Value |
Status |
IExtension.Uid properties using nameof() |
47 |
β οΈ |
CommandLineOptionsProviderBase UID args using nameof() |
13 |
β οΈ |
| Providers with hardcoded stable string UID |
1 ("System" in SystemExtension) |
β |
| Extension UIDs SHA-256-hashed for AppInsights |
All (via ExtensionInformationCollector) |
β οΈ |
IExtension.Uid stability documented |
No |
β |
| Snapshot test capturing registered UIDs |
None |
β |
MSBuildCommandLineProvider.DisplayName using internal class name |
Yes |
β |
Distribution by Package
| Package |
nameof() Uid count |
Microsoft.Testing.Platform |
19 |
Microsoft.Testing.Extensions.AzureDevOpsReport |
6 |
Microsoft.Testing.Extensions.TrxReport |
4 |
Microsoft.Testing.Extensions.Retry |
3 |
Microsoft.Testing.Extensions.MSBuild |
3 |
Microsoft.Testing.Extensions.GitHubActionsReport |
3 |
Microsoft.Testing.Extensions.CrashDump |
3 |
| Others |
6 |
Key Findings
nameof(ClassName) as Uid anti-pattern β IDE "Rename Symbol" silently changes the Uid, breaking telemetry continuity, --info output, artifact URIs, and feature-detection tests.
- No stability documentation β
src/Platform/Microsoft.Testing.Platform/Extensions/IExtension.cs docs say "unique identifier" but nothing about stability across renames.
MSBuildCommandLineProvider DisplayName = internal class name β src/Platform/Microsoft.Testing.Extensions.MSBuild/MSBuildCommandLineProvider.cs passes nameof(MSBuildCommandLineProvider) as displayName in the constructor. --info prints provider.Uid verbatim; users see "MSBuildCommandLineProvider".
- Only one UID stability test β gives false confidence β
NopPlatformOutputDeviceTests.cs:27 asserts Assert.AreEqual(nameof(NopPlatformOutputDevice), device.Uid). Both sides use nameof(), so a rename passes the test while changing the runtime value.
- Feature-detection tied to class name β
DotnetTestPipeOrchestratorHandshakeTests.cs:24 has const string RetryOrchestratorFeature = "RetryOrchestrator", coupling a test constant to RetryOrchestrator's class name via its Uid.
π€ Suggested Improvement Tasks
Task 1: Document UID stability requirement in IExtension
Priority: High | Effort: Small
Update IExtension.Uid XML doc in src/Platform/Microsoft.Testing.Platform/Extensions/IExtension.cs to state that the value must be a stable string constant that survives class renames, and must not use nameof(ImplementingClass).
Task 2: Fix MSBuildCommandLineProvider DisplayName
Priority: High | Effort: Small
src/Platform/Microsoft.Testing.Extensions.MSBuild/MSBuildCommandLineProvider.cs passes nameof(MSBuildCommandLineProvider) (line 20) as both the uid and displayName arguments. Replace the displayName argument with a user-readable string (e.g., move to Resources/ExtensionResources.resx as MSBuildCommandLineProviderDisplayName = "MSBuild Integration").
Task 3: Replace nameof() UIDs in command-line providers with stable string constants
Priority: Medium | Effort: Large
Introduce a stable const string UID per provider (or a shared WellKnownProviderUids file). Priority: the 13 providers whose UIDs appear in --info output and error messages, including PlatformCommandLineProvider, TerminalTestReporterCommandLineOptionsProvider, CrashDumpCommandLineProvider, HangDumpCommandLineProvider, RetryCommandLineOptionsProvider, all 4 report-format command lines, AzureDevOpsCommandLineProvider, GitHubActionsCommandLineProvider, VideoRecorderCommandLineProvider, MSBuildCommandLineProvider.
Task 4: Fix NopPlatformOutputDeviceTests UID assertion
Priority: Medium | Effort: Small
test/UnitTests/Microsoft.Testing.Platform.UnitTests/OutputDevice/NopPlatformOutputDeviceTests.cs:27: change Assert.AreEqual(nameof(NopPlatformOutputDevice), device.Uid) to assert the stable string literal directly (e.g., Assert.AreEqual("NopPlatformOutputDevice", device.Uid)) so a class rename causes the test to fail rather than silently update.
Task 5: Add a UID snapshot test to catch silent renames
Priority: Medium | Effort: Medium
Extend the --info acceptance tests in test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.cs to also assert known provider UIDs alongside the existing display-name assertions. Any UID change β intentional or accidental β produces a conspicuous test failure rather than a silent telemetry break.
π Historical Context
Previous Focus Areas
| Date |
Focus Area |
Type |
| 2026-07-07 |
integration-test-asset-project-hygiene |
Custom |
| 2026-07-06 |
global-test-fixture-implementation-gaps |
Custom |
| 2026-07-03 |
test-context-api-surface-consistency |
Custom |
| 2026-07-02 |
cross-component-diagnostic-metadata-consistency |
Custom |
| 2026-07-01 |
preprocessor-symbol-hygiene |
Custom |
| 2026-06-30 |
mstest-sdk-runner-target-correctness |
Custom |
Next analysis: 2026-07-09 β Focus area selected based on diversity algorithm
π€ Automated content by GitHub Copilot. Generated by the Repository Quality Improver workflow. Β· 186.5 AIC Β· β 10.2 AIC Β· β 10.2K Β· [β·]( Β· β·)
Add this agentic workflows to your repo
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repository-quality-improver.md@main
π― Repository Quality Improvement Report β Extension UID Stability and Naming Governance
Analysis Date: 2026-07-08
Focus Area: Extension UID Stability and Naming Governance
Strategy Type: Custom
Executive Summary
Every MTP extension and internal platform service implements
IExtension.Uid, which is SHA-256-hashed for AppInsights telemetry, displayed verbatim in--infooutput and error messages, embedded in artifact metadata, and used in feature-detection tests. Renaming the implementing class automatically and silently changes the Uid.Analysis found 47
IExtension.Uidproperty definitions and 13CommandLineOptionsProviderBaseUID constructor arguments β ~60 total β that resolve their value vianameof(ClassName). TheIExtension.Uidinterface doc mentions uniqueness but not stability. Contrast this with the GUID-based auto-registration system, where the MSBuild.propsfiles carry a block-caps warning: "DO NOT CHANGE THE GUID, IT'S A WELL KNOWN EXTENSION POINT." One concrete defect surfaces immediately:MSBuildCommandLineProviderpassesnameof(MSBuildCommandLineProvider)as itsdisplayNameargument, so--infoexposes the internal class name to end users.Full Analysis
Metrics
IExtension.Uidproperties usingnameof()CommandLineOptionsProviderBaseUID args usingnameof()"System"inSystemExtension)ExtensionInformationCollector)IExtension.Uidstability documentedMSBuildCommandLineProvider.DisplayNameusing internal class nameDistribution by Package
nameof()Uid countMicrosoft.Testing.PlatformMicrosoft.Testing.Extensions.AzureDevOpsReportMicrosoft.Testing.Extensions.TrxReportMicrosoft.Testing.Extensions.RetryMicrosoft.Testing.Extensions.MSBuildMicrosoft.Testing.Extensions.GitHubActionsReportMicrosoft.Testing.Extensions.CrashDumpKey Findings
nameof(ClassName)as Uid anti-pattern β IDE "Rename Symbol" silently changes the Uid, breaking telemetry continuity,--infooutput, artifact URIs, and feature-detection tests.src/Platform/Microsoft.Testing.Platform/Extensions/IExtension.csdocs say "unique identifier" but nothing about stability across renames.MSBuildCommandLineProviderDisplayName = internal class name βsrc/Platform/Microsoft.Testing.Extensions.MSBuild/MSBuildCommandLineProvider.cspassesnameof(MSBuildCommandLineProvider)asdisplayNamein the constructor.--infoprintsprovider.Uidverbatim; users see "MSBuildCommandLineProvider".NopPlatformOutputDeviceTests.cs:27assertsAssert.AreEqual(nameof(NopPlatformOutputDevice), device.Uid). Both sides usenameof(), so a rename passes the test while changing the runtime value.DotnetTestPipeOrchestratorHandshakeTests.cs:24hasconst string RetryOrchestratorFeature = "RetryOrchestrator", coupling a test constant toRetryOrchestrator's class name via its Uid.π€ Suggested Improvement Tasks
Task 1: Document UID stability requirement in
IExtensionPriority: High | Effort: Small
Update
IExtension.UidXML doc insrc/Platform/Microsoft.Testing.Platform/Extensions/IExtension.csto state that the value must be a stable string constant that survives class renames, and must not usenameof(ImplementingClass).Task 2: Fix
MSBuildCommandLineProviderDisplayNamePriority: High | Effort: Small
src/Platform/Microsoft.Testing.Extensions.MSBuild/MSBuildCommandLineProvider.cspassesnameof(MSBuildCommandLineProvider)(line 20) as both theuidanddisplayNamearguments. Replace thedisplayNameargument with a user-readable string (e.g., move toResources/ExtensionResources.resxasMSBuildCommandLineProviderDisplayName = "MSBuild Integration").Task 3: Replace
nameof()UIDs in command-line providers with stable string constantsPriority: Medium | Effort: Large
Introduce a stable
const stringUID per provider (or a sharedWellKnownProviderUidsfile). Priority: the 13 providers whose UIDs appear in--infooutput and error messages, includingPlatformCommandLineProvider,TerminalTestReporterCommandLineOptionsProvider,CrashDumpCommandLineProvider,HangDumpCommandLineProvider,RetryCommandLineOptionsProvider, all 4 report-format command lines,AzureDevOpsCommandLineProvider,GitHubActionsCommandLineProvider,VideoRecorderCommandLineProvider,MSBuildCommandLineProvider.Task 4: Fix
NopPlatformOutputDeviceTestsUID assertionPriority: Medium | Effort: Small
test/UnitTests/Microsoft.Testing.Platform.UnitTests/OutputDevice/NopPlatformOutputDeviceTests.cs:27: changeAssert.AreEqual(nameof(NopPlatformOutputDevice), device.Uid)to assert the stable string literal directly (e.g.,Assert.AreEqual("NopPlatformOutputDevice", device.Uid)) so a class rename causes the test to fail rather than silently update.Task 5: Add a UID snapshot test to catch silent renames
Priority: Medium | Effort: Medium
Extend the
--infoacceptance tests intest/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/HelpInfoTests.csto also assert known provider UIDs alongside the existing display-name assertions. Any UID change β intentional or accidental β produces a conspicuous test failure rather than a silent telemetry break.π Historical Context
Previous Focus Areas
Next analysis: 2026-07-09 β Focus area selected based on diversity algorithm
Add this agentic workflows to your repo
To install this agentic workflow, run