[Draft] Add azldev repo query and repo diff commands#206
Draft
liunan-ms wants to merge 4 commits into
Draft
Conversation
Contributor
liunan-ms
commented
May 22, 2026
… enforcement Add a flag to (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. Also 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. Regenerate CLI docs.
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
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 adds batch spec querying from locally rendered specs (including binary subpackage enumeration) and introduces a new azldev repo command group for querying/diffing published RPM repositories.
Changes:
- Extend spec query logic to support enumerating binary subpackages and expose reusable rpmspec queryformat/parsers.
- Add a batched
rpmspecexecution path in the mock chroot via an embedded Python helper. - Introduce
azldev repo queryandazldev repo diffcommands plus generated CLI docs.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario/internal/projecttest/testspec.go | Extend test spec rendering to optionally generate subpackages. |
| scenario/component_query_test.go | Update scenario test to render specs first and assert subpackages in output. |
| pkg/app/azldev_cli/azldev_test.go | Update CLI instantiation test to include new repo top-level command. |
| pkg/app/azldev_cli/azldev.go | Register the new repo command tree. |
| internal/rpm/specquery_test.go | Add tests for parsing subpackage output and SRPM query output. |
| internal/rpm/specquery.go | Add Subpackages to SpecInfo, export queryformats, and add subpackage parsing helpers. |
| internal/app/azldev/core/sources/specquery_test.go | Add tests for batch query JSON parsing and input validation. |
| internal/app/azldev/core/sources/specquery.go | Implement batch spec querying orchestration + input validation for rendered-spec queries. |
| internal/app/azldev/core/sources/query_process.py | Embedded helper to run batched rpmspec queries inside mock (srpm + builtrpms). |
| internal/app/azldev/core/sources/mockprocessor.go | Generalize mock processor to run embedded batch scripts and install configurable packages. |
| internal/app/azldev/cmds/repo/repo.go | Add repo command root. |
| internal/app/azldev/cmds/repo/query.go | Implement azldev repo query using dnf repoquery and write bucketed lists. |
| internal/app/azldev/cmds/repo/diff.go | Implement azldev repo diff to compare published repo buckets vs project-derived buckets. |
| internal/app/azldev/cmds/component/render.go | Update render flow to pass required mock packages to the mock processor. |
| internal/app/azldev/cmds/component/query_test.go | Update query tests to cover rendered-specs-dir validation behavior. |
| internal/app/azldev/cmds/component/query_internal_test.go | Add internal tests for building batch spec query inputs. |
| internal/app/azldev/cmds/component/query.go | Rework component query to use rendered specs + batched mock querying, with --arch. |
| internal/app/azldev/cmds/component/mockproc.go | Centralize required-package lists for render/query mock processor use. |
| docs/user/reference/cli/azldev_repo_query.md | Add generated docs for azldev repo query. |
| docs/user/reference/cli/azldev_repo_diff.md | Add generated docs for azldev repo diff. |
| docs/user/reference/cli/azldev_repo.md | Add generated docs for azldev repo. |
| docs/user/reference/cli/azldev_component_query.md | Update generated docs for new component query behavior + --arch. |
| docs/user/reference/cli/azldev_component.md | Update generated docs to reflect updated component query short description. |
| docs/user/reference/cli/azldev.md | Update generated docs to include new top-level repo command. |
Comment on lines
+94
to
+96
| if strings.Contains(cleaned, "..") { | ||
| return fmt.Errorf("spec path %#q must not contain path traversal", relPath) | ||
| } |
Comment on lines
+292
to
+304
| relSpecPath, relErr := filepath.Rel(renderedSpecsDir, specPath) | ||
| if relErr != nil { | ||
| return nil, 0, fmt.Errorf("relativizing spec path %#q against %#q:\n%w", | ||
| specPath, renderedSpecsDir, relErr) | ||
| } | ||
|
|
||
| inputs = append(inputs, sources.SpecQueryInput{ | ||
| Name: name, | ||
| SpecRelPath: relSpecPath, | ||
| With: cfg.Build.With, | ||
| Without: cfg.Build.Without, | ||
| Defines: cfg.Build.Defines, | ||
| }) |
Comment on lines
+16
to
+17
| python3 query_process.py <scratch_dir> <specs_dir> <max_workers> | ||
|
|
Comment on lines
+104
to
+105
| // as warnings; the corresponding entry is omitted from the result list and | ||
| // the function returns an aggregated error after attempting every component. |
Comment on lines
+88
to
+92
| func WithSubpackage(suffix string) TestSpecOption { | ||
| return func(s *TestSpec) { | ||
| s.subpackages = append(s.subpackages, suffix) | ||
| } | ||
| } |
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.