Skip to content

feat(component): add 'metadata' command listing overlay and group metadata#279

Draft
liunan-ms wants to merge 1 commit into
microsoft:mainfrom
liunan-ms:liunan/component-metadata-cmd
Draft

feat(component): add 'metadata' command listing overlay and group metadata#279
liunan-ms wants to merge 1 commit into
microsoft:mainfrom
liunan-ms:liunan/component-metadata-cmd

Conversation

@liunan-ms

@liunan-ms liunan-ms commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Add 'azldev component metadata', which lists documentation metadata from both a component's overlays and the component groups it explicitly belongs to. Each row is tagged with its source ('overlay' or 'group'). By default both sources are listed; --overlays or --groups restricts output to one source.

Only entries carrying a [metadata] block are listed; unannotated overlays and groups are excluded. Filters:

  • --category: only entries whose metadata declares this category
  • --upstream-status: only entries whose metadata declares this upstream status (upstreamed, upstreamable, needs-upstream-hook, inapplicable, or unknown)

The command is read-only and skips lock validation.

Regenerate CLI reference docs and the MCP snapshot; cross-link the
new command from the overlays config doc.

Copilot AI review requested due to automatic review settings July 13, 2026 20:17

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

Adds a new read-only azldev component metadata subcommand that surfaces documentation metadata for components, aggregating annotated metadata from both component overlays and explicitly-associated component groups. This fits into the existing component command suite as an inspection/reporting command intended for documentation and workflow visibility.

Changes:

  • Introduces component metadata command implementation with filtering (--category, --upstream-status) and source selection (--overlays, --groups).
  • Adds unit tests covering metadata collection/sorting/filtering behavior.
  • Regenerates CLI reference docs and MCP snapshot, and cross-links the command from the overlays config documentation.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scenario/snapshots/TestMCPServerMode_1.snap.json Updates MCP tool snapshot to include the new component-metadata tool schema.
internal/app/azldev/cmds/component/metadata.go Implements the new azldev component metadata subcommand and metadata collection/filtering/sorting logic.
internal/app/azldev/cmds/component/metadata_test.go Adds tests for metadata listing behavior across overlays/groups and filter options.
internal/app/azldev/cmds/component/component.go Wires the new metadata subcommand into the component command tree.
docs/user/reference/config/overlays.md Adds a short doc section pointing users to azldev component metadata.
docs/user/reference/cli/azldev_component.md Regenerated CLI index to include the new subcommand.
docs/user/reference/cli/azldev_component_metadata.md New auto-generated CLI reference page for azldev component metadata.

Comment thread internal/app/azldev/cmds/component/metadata.go Outdated
Comment thread internal/app/azldev/cmds/component/metadata_test.go
@liunan-ms
liunan-ms force-pushed the liunan/component-metadata-cmd branch from 8679804 to 8a49b06 Compare July 13, 2026 20:44
Copilot AI review requested due to automatic review settings July 13, 2026 20:44

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +185 to +187
if options.Category != "" && !projectconfig.OverlayCategory(options.Category).IsValid() {
return nil, fmt.Errorf("%w: unknown overlay category %#q", azldev.ErrInvalidUsage, options.Category)
}
Comment on lines +190 to +194
return nil, fmt.Errorf(
"%w: unknown upstream-status value %#q; want 'upstreamed', 'upstreamable', "+
"'needs-upstream-hook', 'inapplicable', or 'unknown'",
azldev.ErrInvalidUsage, options.UpstreamStatus,
)
…adata

Add 'azldev component metadata', which lists documentation metadata
from both a component's overlays and the component groups it
explicitly belongs to. Each row is tagged with its source ('overlay'
or 'group'). By default both sources are listed; --overlays or
--groups restricts output to one source.

Only entries carrying a [metadata] block are listed; unannotated
overlays and groups are excluded. Filters:

  --category         only entries whose metadata declares this category
  --upstream-status  only entries whose metadata declares this upstream
                     status (upstreamed, upstreamable, needs-upstream-hook,
                     inapplicable, or unknown)

The command is read-only and skips lock validation.

Regenerate CLI reference docs and the MCP snapshot; cross-link the
new command from the overlays config doc.
Copilot AI review requested due to automatic review settings July 15, 2026 16:11
@liunan-ms
liunan-ms force-pushed the liunan/component-metadata-cmd branch from 8a49b06 to d1e6cf4 Compare July 15, 2026 16:11

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

ValidArgsFunction: components.GenerateComponentNameCompletions,
}

azldev.ExportAsMCPTool(cmd)
Comment on lines +185 to +187
if options.Category != "" && !projectconfig.OverlayCategory(options.Category).IsValid() {
return nil, fmt.Errorf("%w: unknown overlay category %#q", azldev.ErrInvalidUsage, options.Category)
}
Comment on lines +189 to +195
if options.UpstreamStatus != "" && !projectconfig.OverlayUpstreamStatus(options.UpstreamStatus).IsValid() {
return nil, fmt.Errorf(
"%w: unknown upstream-status value %#q; want 'upstreamed', 'upstreamable', "+
"'needs-upstream-hook', 'inapplicable', or 'unknown'",
azldev.ErrInvalidUsage, options.UpstreamStatus,
)
}
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.

2 participants