feat(component query): bulk spec querying with --arch enforcement#204
Open
liunan-ms wants to merge 2 commits into
Open
feat(component query): bulk spec querying with --arch enforcement#204liunan-ms wants to merge 2 commits into
liunan-ms wants to merge 2 commits into
Conversation
Contributor
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 component query to operate on locally rendered specs and to batch rpmspec execution in a shared mock chroot, including reporting binary subpackages.
Changes:
- Added batched spec querying via an embedded Python helper and shared Go scaffolding for running batch scripts in mock.
- Extended spec query results to include binary subpackages and updated tests to validate subpackage extraction.
- Updated CLI help/docs and adjusted
component queryto require and validaterendered-specs-dir.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario/internal/projecttest/testspec.go | Adds subpackage rendering support in test spec generation. |
| scenario/component_query_test.go | Updates scenario test to render first and validate subpackages in query output. |
| internal/rpm/specquery.go | Exposes rpmspec queryformat constants and adds subpackage parsing helper. |
| internal/rpm/specquery_test.go | Adds unit tests for subpackage-output parsing and SRPM parsing behavior. |
| internal/app/azldev/core/sources/specquery.go | Introduces batch spec query orchestration and input validation. |
| internal/app/azldev/core/sources/specquery_test.go | Adds tests for batched query JSON parsing and validation. |
| internal/app/azldev/core/sources/query_process.py | Implements parallel per-spec rpmspec execution inside mock chroot. |
| internal/app/azldev/core/sources/mockprocessor.go | Refactors shared batch-script runner and adds configurable required package install. |
| internal/app/azldev/command.go | Emits partial results even when a command returns an error, with typed-nil guarding. |
| internal/app/azldev/cmds/component/query.go | Reworks component query to read rendered specs and use batched rpmspec querying. |
| internal/app/azldev/cmds/component/mockproc.go | Centralizes mock required-package presets and mock processor creation. |
| internal/app/azldev/cmds/component/query_test.go | Updates query command tests for rendered-specs-dir validation behavior. |
| internal/app/azldev/cmds/component/query_internal_test.go | Adds internal tests for building batch query inputs and skip behavior. |
| docs/user/reference/cli/azldev_component_query.md | Updates CLI reference to match rendered-spec-based query and new --arch flag. |
| docs/user/reference/cli/azldev_component.md | Updates command list description for component query. |
… enforcement Add an --arch flag to 'component query' (default x86_64) that drives rpmspec's --target and enforces ExclusiveArch/ExcludeArch policy via a probe queryformat wrapped around the srpm query. Specs excluded by the selected arch surface as ExcludedFromArch entries and are summarized in a per-run log line. Harden the per-spec query subprocess: - 180s rpmspec timeout with a dedicated _RpmspecTimeout exception - UTF-8 decoding with errors=replace on file IO and subprocess output Plumb the arch parameter through BatchQuerySpecs and add ExcludedFromArch to SpecQueryResult / its JSON mapping. Teach runFuncInternal to render partial results when the inner func returns both a value and an error, so per-component query failures still print the successful rows while exiting non-zero. Add javapackages-common to the mock package list so %javadoc_package (from macros.fjava) doesn't silently disappear. Bump scenario AZL 4.0 upstream + mock releasever to Fedora 43; java-srpm-macros is missing from f42-build koji. Regenerate CLI docs.
a6a9778 to
abb1a51
Compare
liunan-ms
commented
May 21, 2026
|
|
||
| [distros.azurelinux.versions.'4.0'.default-component-config] | ||
| spec = { type = "upstream", upstream-distro = { name = "fedora", version = "42" } } | ||
| spec = { type = "upstream", upstream-distro = { name = "fedora", version = "43" } } |
Contributor
Author
There was a problem hiding this comment.
java-srpm-macros is not available in f42 as a standalone binary RPM. Bumping the test mock to releasever=43 (and the matching f43-build URL) to unblock the scenario tests.
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.
Introduces
azldev component queryfor bulk-querying rendered RPM specs inside a single shared mock chroot, with arch-aware policy enforcement.CLI
azldev component querycommand — selects components via the standard component filter, renders results as a table / CSV / Markdown / JSON.--archflag (defaultx86_64, also acceptsaarch64) drivingrpmspec --target=<arch>and ExclusiveArch/ExcludeArch policy.Docs
CLI reference under
docs/user/reference/cli/regenerated.