feat(pkg): split list 'group' column into 'packageGroups' and 'componentGroups'#165
feat(pkg): split list 'group' column into 'packageGroups' and 'componentGroups'#165liunan-ms wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates azldev pkg list group attribution so packages not belonging to any package-group fall back to their resolved component’s component-group(s), and documents the new behavior.
Changes:
- Add component-group fallback (sorted, comma-joined) for the
groupfield when no package-group match exists, including SRPM rows. - Add tests covering fallback behavior and package-group precedence.
- Update CLI help and documentation to describe the new
groupattribution semantics.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/app/azldev/cmds/pkg/list.go | Implements component-group fallback logic via componentGroupLabel, applies it to RPM and SRPM results, and updates help/comments. |
| internal/app/azldev/cmds/pkg/list_test.go | Adds unit tests validating fallback behavior, sorting/determinism, and package-group precedence, including --rpm-file cases. |
| docs/user/reference/cli/azldev_package_list.md | Documents the updated meaning of the group column in CLI reference output. |
| docs/user/how-to/inspect-package-config.md | Updates the Group column description to include the component-group fallback behavior. |
ba62ab4 to
ee4dc12
Compare
|
@liunan-ms Is the group actually getting used for anything? Or is it just a diagnostic data point? (I would hope nothing is relying on it for routing correctness.) |
It's metadata surfaced on |
Given that's the case, I'd recommend that we replace 'group' with |
9bceee5 to
5979a8e
Compare
group to component-group(s) if a binary RPM is not in any package-groupWhen a binary RPM is not in any package-group, attribute it to the resolved component's component-group(s) (sorted, comma-joined). SRPM rows from --rpm-file and synthesized -debugsource entries get the same attribution. Update Cobra help, the inspect-package-config how-to, and regenerated CLI reference docs. Tests: adds unit tests covering the component-group baseline (single and multi-membership, sort/join), the package-group override, the --rpm-file path (SRPM and binary RPM both attributed to the component-group), and the -debugsource package-group override over the component-group baseline.
…entGroups' Replace the single Group field on PackageListResult with two independent sorted []string fields: PackageGroups (every package-group whose 'packages' list contains the package; always empty for SRPM rows) and ComponentGroups (every component-group the resolved component belongs to). Both fields are guaranteed non-nil so JSON output is '[]' instead of 'null'. Updates the table output, JSON schema, CLI help, how-to docs, and unit tests accordingly.
5979a8e to
94bd53f
Compare
Good idea! Instead of having a nested |
Currently the
groupfield on eachPackageListResultis the name of the package-group that contains the binary package, or "" if the package isn't in any group. After switching to component-based config, it cannot reflect the component group.This pull request replaces the single
groupfield on PackageListResult with two independent sorted []string fields:packageGroups(every package-group whose 'packages' list contains the package; always empty for SRPM rows) andcomponentGroups(every component-group the resolved component belongs to). Both fields are guaranteed non-nil so JSON output is '[]' instead of 'null'.Updates the table output, JSON schema, CLI help, how-to docs, and unit tests accordingly.
Example output of
azldev pkg list --rpm-file <rpm_source_map.json>: