[quality-improver] AOTSG0001–AOTSG0005 (AOT reflection source generator) diagnostics have no HelpLinkUri, unlike MSTEST0xxx rules

Chiusa
#11,920 0 commenti 1 reazione 2 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Evangelink ci sta già lavorando.

Dal 14/10/2026.

  • #11924 di @copilot-swe-agent — integrata

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
40/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, markdown

Direzione di ricerca

Start in src/Analyzers/MSTest.SourceGeneration/Diagnostics/DiagnosticDescriptors.cs, where the five AOTSG new DiagnosticDescriptor(...) calls omit helpLinkUri, and compare with DiagnosticDescriptorHelper.Create in src/Analyzers/MSTest.Analyzers/Helpers/DiagnosticDescriptorHelper.cs. The docs destination must be decided first (Task 1), so ask maintainers before editing. Done means all five descriptors have a working helpLinkUri, a doc page exists for AOTSG0001–AOTSG0005, and docs/glossary.md has an entry.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type/automation type/tech-debt
🎯 Repository Quality Improvement Report — AOT Source-Generator Diagnostic Documentation Parity

Analysis Date: 2026-10-13
Focus Area: aotsg-diagnostic-documentation-parity (custom)
Strategy Type: Custom

Executive Summary

MSTest.SourceGeneration ships five AOT-reflection diagnostics — AOTSG0001...AOTSG0005 — that fire when the source generator encounters a [TestClass] shape it cannot materialize (static class, open generic, inaccessible type, generic method, by-ref parameter). Unlike every MSTEST0xxx analyzer rule, which goes through DiagnosticDescriptorHelper.Create and automatically gets a helpLinkUri of (learn.microsoft.com/redacted), the five AOTSGdescriptors insrc/Analyzers/MSTest.SourceGeneration/Diagnostics/DiagnosticDescriptors.csare constructed directly vianew DiagnosticDescriptor(...)without ahelpLinkUriargument at all. EveryDiagnosticDescriptorin that file therefore hasHelpLinkUri == null`.

This means a developer who hits, say, AOTSG0003: InaccessibleTestClass in an IDE or build log has no click-through documentation link — the one discoverability affordance every other first-party MSTest/analyzer diagnostic in this repo provides. The gap is structural (no helper reused) rather than an oversight on a single rule, so all five IDs are affected identically.

Three concrete, independently fixable gaps were found:

  1. None of the five AOTSG descriptors set helpLinkUri.
  2. There is no docs/ page (or glossary entry) describing the AOTSG rule category at all, so even if a helpLinkUri were added it would 404 against the existing mstest-analyzers doc tree, which only covers MSTEST0xxx IDs.
  3. docs/glossary.md has no entry for "AOT reflection source generator" / AOTSG, even though the glossary tracks other MTP/MSTest-specific terms like AzureFoundry, AssemblyFixtureProviderAttribute, etc.
Full Analysis Report
Focus Area: AOT Source-Generator Diagnostic Documentation Parity
Current State Assessment

Metrics Collected:

Metric Value Status
AOTSG descriptors defined 5 (AOTSG0001–AOTSG0005) ⚠️
AOTSG descriptors with helpLinkUri 0 / 5 ❌
MSTEST0xxx descriptors with helpLinkUri effectively all (via DiagnosticDescriptorHelper.Create) ✅
Doc pages referencing AOTSG 0 ❌
Glossary entries for AOT reflection source generator 0 ❌
AnalyzerReleases.Shipped.md tracking for AOTSG0001–0005 present (Release 4.4.0) ✅
Unit test coverage exercising AOTSG ids yes (MSTestReflectionMetadataGeneratorTests.cs, 27 references) ✅
Findings
Strengths
  • All five AOTSG rule IDs are correctly registered in AnalyzerReleases.Shipped.md (Release 4.4.0) — no release-tracking gap here.
  • Each descriptor already carries a clear description string explaining the remediation (e.g. "Remove the 'static' modifier or use a non-static container."), so the raw information for a docs page already exists verbatim in source.
  • MSTestReflectionMetadataGeneratorTests.cs has solid coverage exercising these diagnostics (27 references to AOTSG ids).
Areas for Improvement
  • ❌ No helpLinkUri on any AOTSG descriptor. Source: src/Analyzers/MSTest.SourceGeneration/Diagnostics/DiagnosticDescriptors.cs, lines defining StaticTestClass, GenericTestClass, InaccessibleTestClass, GenericTestMethod, ByRefParameter — all five new DiagnosticDescriptor(...) calls omit the helpLinkUri positional/named argument, so it defaults to null.
  • ⚠️ No reusable helper, unlike MSTest.Analyzers' DiagnosticDescriptorHelper.Create, which centralizes helpLinkUri generation for every MSTEST0xxx rule (src/Analyzers/MSTest.Analyzers/Helpers/DiagnosticDescriptorHelper.cs). MSTest.SourceGeneration constructs descriptors ad hoc, so there is nowhere a future AOTSG0006 could inherit link generation from.
  • ⚠️ No documentation tree for AOTSG. The existing mstest-analyzers/{id} URL scheme is specific to MSTEST0xxx; a straight reuse of that helper for AOTSG IDs would point at nonexistent learn.microsoft.com pages. A distinct, owned URL scheme (or a dedicated section under docs/) is needed before wiring up links.
  • ⚠️ No glossary entry. docs/glossary.md documents dozens of MTP/MSTest-specific terms but has nothing for the AOT reflection source generator or the AOTSG diagnostic category, so a reader hitting these new 4.4.0-era warnings has no in-repo starting point either.

🤖 Suggested Improvement Tasks
Task 1: Decide the AOTSG documentation destination before adding links

Priority: High
Estimated Effort: Small

Before wiring up helpLinkUri, decide where AOTSG rule documentation will live: a new docs/mstest-analyzers-style subsection, a dedicated docs/aot-source-generator-diagnostics.md, or inline repo documentation (since these are generator diagnostics, not Roslyn analyzer rules shipped to learn.microsoft.com the same way). Record the decision so Task 2 and 3 use a real, working URL scheme instead of guessing at the existing mstest-analyzers/{id} pattern.

Task 2: Add helpLinkUri to the five AOTSG descriptors

Priority: Medium
Estimated Effort: Small

In src/Analyzers/MSTest.SourceGeneration/Diagnostics/DiagnosticDescriptors.cs, add a helpLinkUri argument to each of the five new DiagnosticDescriptor(...) calls (StaticTestClass, GenericTestClass, InaccessibleTestClass, GenericTestMethod, ByRefParameter), pointing at the destination chosen in Task 1. Consider introducing a small local helper (mirroring DiagnosticDescriptorHelper.Create in MSTest.Analyzers) so a future AOTSG0006 inherits the link pattern automatically instead of needing another manual edit.

Task 3: Write the corresponding documentation page(s)

Priority: Medium
Estimated Effort: Medium

Author the doc content for AOTSG0001–AOTSG0005 at the destination from Task 1. Each descriptor's existing description string (e.g. "Open generic test classes ... have no closed type at generation time. Use a concrete subclass that closes every type parameter.") already contains the core remediation guidance and can be the starting point for each rule's page/section, minimizing new authoring effort.

Task 4: Add a glossary entry for the AOT reflection source generator

Priority: Low
Estimated Effort: Small

Add a short entry to docs/glossary.md (alphabetically under "A") describing the AOT reflection source generator and the AOTSG diagnostic category, with a pointer to the new documentation from Task 3 once it exists.


📊 Historical Context
Previous Focus Areas (last 5 runs)
Date Focus Area Type
2026-10-06 dependency-health-followup Standard (reused via follow-up)
2026-10-07 objectdisposedexception-throwif-polyfill-gap Custom
2026-10-08 experimental-api-diagnostic-url-consistency Custom
2026-10-09 central-package-management-dead-entries Custom
2026-10-12 mutation-testing-manifest-coverage-gap Custom

A related run on 2026-10-05 (analyzer-release-tracking-and-suppressor-resource-fidelity, filed as #11760) audited AnalyzerReleases.*.md tracking completeness and suppressor justification-resource correctness for MSTEST0xxx rules; it did not examine helpLinkUri coverage, and did not touch the MSTest.SourceGeneration project at all. This report is a distinct finding in a different project and dimension (link/documentation parity, not release tracking).


🎯 Recommendations
Immediate Actions (This Week)
  1. Decide the documentation destination for AOTSG rules (Task 1) — Priority: High
Short-term Actions (This Month)
  1. Wire up helpLinkUri and publish the documentation (Tasks 2–3) — Priority: Medium
  2. Add the glossary entry (Task 4) — Priority: Low

Next analysis: 2026-10-14 — Focus area selected based on diversity algorithm

🤖 Automated content by GitHub Copilot. Generated by the Repository Quality Improver workflow. · copilot · auto · 252 AIC · ⌖ 7.94 AIC · ⊞ 17.5K · [◷]( · ◷)

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repository-quality-improver.md@main
  • expires on Oct 15, 2026, 10:30 PM UTC
Lingua principale
C#
Stelle
1.1k
Fork
312
Merge medio
10h 52m
PR unite (30g)
339

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/testfx

Tutte le issue di microsoft/testfx

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.