Skip to content

Add dynamic generic-help parity guardrails and skill guidance - #57103

Merged
JeremyKuhne merged 1 commit into
dotnet:mainfrom
JeremyKuhne:generic-help-parity-guardrails
Nov 16, 2026
Merged

JeremyKuhne merged 1 commit into
dotnet:mainfrom
JeremyKuhne:generic-help-parity-guardrails

Conversation

@JeremyKuhne

Copy link
Copy Markdown
Member

Follow-up to #56267 (comment) to catch missed TryParseGenericCommandHelp / CreateCommandForGenericHelp updates when top-level CLI commands, aliases, or help-visible parser configuration change.

Summary

  • Dynamic command, alias, and output-parity tests (dotnet.Tests & dotnet-aot.Tests):
    • Expand TryParseGenericCommandHelp coverage checks in GenericCommandHelpParserTests and AotParserTests to enumerate [command.Name, .. command.Aliases] across Parser.RootCommand.Subcommands rather than command.Name alone.
    • Drive minimal-tree parse parity and full-vs-minimal rendered output parity dynamically from Parser.RootCommand.Subcommands instead of hardcoded per-command [DataRow] lists (including expanding AOT output parity from 4 commands to all eligible non-forwarding commands and aliases).
    • Add TryParseGenericCommandHelp_PreservesHelpSurfaceMetadataForAllInProcessCommands to compare visible options, arguments, subcommands, and help-affecting completion sources (HelpName unset) between the minimal and full trees, catching missed <Name>CommandParser.ConfigureCommand wiring deterministically even without a project fixture or network access.
  • CLI authoring and code-review skills:
    • Update add-cli-command (SKILL.md and references/file-map.md) and code-review (SKILL.md) to explicitly cover CreateCommandForGenericHelp, TryParseGenericCommandHelp, and AotPrintHelpAction.

Validation

  • dotnet.Tests (GenericCommandHelpParserTests): 48 passed, 0 failed.
  • dotnet-aot.Tests (AotParserTests): 94 passed under both the managed runner and NativeAOT-published dotnet-aot.Tests.exe (win-x64).
  • Verified via temporary local mutations that omitting "sln" from CreateCommandForGenericHelp and omitting ReferenceCommandParser.ConfigureCommand from TryParseGenericCommandHelp both fail the new dynamic tests immediately.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:12
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
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.

🟢 Approval recommended

No active review issues block approval of the help-parity regression tests and contributor guidance.

No open issues 🎉

What changed in this PR

Adds regression guardrails for the CLI’s optimized top-level help parsing introduced in #56267. The changes expand tests and contributor guidance without changing production CLI behavior.

Changes:

  • Discover top-level commands and aliases dynamically for managed and Native AOT help-parity tests.
  • Compare managed help metadata and broaden rendered-output parity coverage.
  • Document how CLI authors and reviewers should keep minimal help parsing and AOT fallback routing synchronized.
File Description
test/​dotnet.Tests/​ParserTests/​GenericCommandHelpParserTests.cs Adds dynamic command/alias coverage, help-metadata checks, and output-parity checks.
test/​dotnet-aot.Tests/​AotParserTests.cs Expands dynamic coverage and output parity for eligible AOT commands and aliases.
.github/​skills/​code-review/​SKILL.md Adds review guidance for keeping generic-help paths synchronized.
.github/​skills/​add-cli-command/​SKILL.md Documents help fast-path registration and dynamic-help fallback requirements.
.github/​skills/​add-cli-command/​references/​file-map.md Maps help-routing implementation points and parity tests.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants