Skip to content

[Draft] Add azldev repo query and repo diff commands#206

Draft
liunan-ms wants to merge 4 commits into
microsoft:mainfrom
liunan-ms:liunan/repo
Draft

[Draft] Add azldev repo query and repo diff commands#206
liunan-ms wants to merge 4 commits into
microsoft:mainfrom
liunan-ms:liunan/repo

Conversation

@liunan-ms
Copy link
Copy Markdown
Contributor

image

reubeno and others added 4 commits May 20, 2026 22:58
… 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.
Copilot AI review requested due to automatic review settings May 22, 2026 00:18
@github-actions
Copy link
Copy Markdown

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:

No release type found in pull request title "[Draft] Add azldev repo query and repo diff commands". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rpmspec execution path in the mock chroot via an embedded Python helper.
  • Introduce azldev repo query and azldev repo diff commands 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)
}
}
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.

3 participants