Repository navigation
{CLI} Load scoped help metadata only from verb contributors - #1468
Open
DanielMicrosoft wants to merge 1 commit into
Open
DanielMicrosoft wants to merge 1 commit into
DanielMicrosoft wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DanielMicrosoft
marked this pull request as ready for review
November 16, 2026 05:10
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Scoped help can incorrectly return VerbNotFound for legacy indexes with valid commands but empty ownership lists; the broad-selection fallback and a real-loader regression test are needed.
1 open issue
What changed in this PR
This PR narrows scoped CLI help discovery to routing-selected packages that contribute to the requested verb, avoiding unrelated metadata loads while keeping root help broad.
Changes:
- Retain verb ownership alongside selected package versions and DLL locations.
- Pass the requested verb through help discovery, retaining shared contributors even when routing-index construction fails.
- Add integration coverage for scoped loading and update the help-system documentation.
| File | Description |
|---|---|
| tests/Cli.Tests/Help/RuntimeHelpDispatcherTests.cs | Update mocks for verb-aware package selection. |
| tests/Cli.Tests/Extensions/SelectedExtensionIntegrationTests.cs | Verify scoped versus root loading and unmatched-verb behavior. |
| tests/Cli.Tests/Extensions/ExtensionRoutingDiscoveryTests.cs | Cover shared ownership, selected versions, and commandless verbs. |
| src/CLI/Program.cs | Forward the help verb to routing selection. |
| src/CLI/Help/RuntimeHelpDispatcher.cs | Request packages for the scoped help verb. |
| src/CLI/CliExtensionServiceRegistration.cs | Record verb ownership and expose filtered selection. |
| src/CLI/AssemblyLoading/SelectedExtensionLocations.cs | Store ownership metadata and filter package IDs by verb. |
| eng-docs/spec/help-system.md | Document scoped discovery and routing fallback behavior. |
Review effort: Balanced
Comment on lines
+150
to
+151
| selectedLocations?.Record(info.PackageId, info.ResolvedVersion, info.Location, | ||
| info.Verbs.Concat(projection.Namespaces)); |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Related command
az vm --help,az vm create --help, and other scoped CLI help requestsDescription
Fixes Azure/CLIPS#992.
Scoped help currently loads full metadata for every routing-selected extension before filtering by verb. This change uses the existing routing selection to load only packages contributing to the requested verb.
Selection is deliberately verb-level, not command/group-path-level. Routing's existing DLL fallback for missing or invalid sidecars is unchanged.
Testing Guide
This PR represents a solid perf improvement.
Before:

After:
No timing benchmark or full test suite was run.
History Notes
[Component Name]for customer-facing changes or{Component Name}for non-customer-facing changes, and does not end with trailing punctuation or spaces.