feat(config): add optional metadata to component groups#262
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an optional [component-groups.<name>.metadata] block by reusing the existing OverlayMetadata schema, allowing component groups to carry documentation-only provenance (category/commits/bugs/upstreamable) and enforcing validation during config load.
Changes:
- Add
Metadata *OverlayMetadatatoComponentGroupConfigand expose it in the JSON schema. - Validate group metadata via
ConfigFile.Validate()(reusingOverlayMetadata.Validate()rules). - Add unit tests and update user docs / regenerated schema snapshots.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/projectconfig/component.go | Adds optional metadata to component group config using OverlayMetadata. |
| internal/projectconfig/configfile.go | Hooks component-group metadata validation into ConfigFile.Validate(). |
| internal/projectconfig/loader_test.go | Adds tests covering group metadata parsing/validation. |
| docs/user/reference/config/component-groups.md | Documents the new metadata block for component groups. |
| schemas/azldev.schema.json | Regenerated schema: adds component-groups.*.metadata referencing OverlayMetadata. |
| scenario/snapshots/TestSnapshotsContainer_config_generate-schema_stdout_1.snap | Regenerated snapshot reflecting schema update. |
| scenario/snapshots/TestSnapshots_config_generate-schema_stdout_1.snap | Regenerated snapshot reflecting schema update. |
Add an optional [component-groups.<name>.metadata] block reusing the existing OverlayMetadata schema (required category plus commits, bugs, and upstreamable). Metadata is documentation only and does not affect how group members are resolved or built. Validation is wired into ConfigFile.Validate. Regenerate JSON schema; update reference docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
de9c745 to
a86ff65
Compare
| | Field | TOML Key | Type | Required | Description | | ||
| |-------|----------|------|----------|-------------| | ||
| | Description | `description` | string | No | Human-readable description of this group | | ||
| | Metadata | `metadata` | [OverlayMetadata](overlays.md) | No | Optional documentation metadata describing the group's intent and provenance | |
There was a problem hiding this comment.
Just a general question, what are we going to be using the metadata for? Is it just to keep track of bugs? Will this be feeding into a pipeline of some sort?
There was a problem hiding this comment.
Metadata will be used for statistical purposes, like tracking the count of our intentional changes, upstreamable fixes (while we work on upstream, we can see the number of upstreamable goes down, which's another way to track our upstream contribution), category distribution of our changes (e.g. how many backport we carry, how many flaky tests we disabled, etc.) It will not be used in build or feed to pipelines.
Summary
This PR is the second PR for adding metadata support, adding an optional
[component-groups.<name>.metadata]block that reuses the existingOverlayMetadataschema — the requiredcategoryplus optionalcommits,bugs, andupstreamable.Metadata is documentation only: it does not affect how group members are resolved, filtered, or built. It gives component groups the same provenance-tracking surface that overlays already have, so consumers can record why a group exists (e.g.
azl-pruning,backport-dist-git) and link back to commits / bugs.Changes
internal/projectconfig/component.go— reuseOverlayMetadataonComponentGroup.internal/projectconfig/configfile.go— wire group-metadata validation intoConfigFile.Validate.internal/projectconfig/loader_test.go— coverage for the new field.docs/user/reference/config/component-groups.md— reference doc updates.schemas/azldev.schema.json+ scenario snapshots — regenerated viamage docs.Testing
mage docs— schema and CLI docs regenerate cleanly (no diff after commit).loader_test.go.Notes