Skip to content

Move config-manager install to package manager abstraction#4848

Open
thrix wants to merge 3 commits intomainfrom
worktree-feature-config-manager-abstraction
Open

Move config-manager install to package manager abstraction#4848
thrix wants to merge 3 commits intomainfrom
worktree-feature-config-manager-abstraction

Conversation

@thrix
Copy link
Copy Markdown
Contributor

@thrix thrix commented Apr 30, 2026

Follow the copr_plugin / enable_copr() pattern: add a config_manager_plugin ClassVar and install_config_manager() method to the package manager layer instead of duplicating dnf-command(config-manager) installation in feature plugins.

  • Dnf: dnf-command(config-manager)
  • Dnf5: dnf5-command(config-manager)
  • Yum: yum-utils

Closes: #4847

Assisted-by: Claude Code

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a unified install_config_manager method across package managers and refactors the CRB and EPEL features to use this abstraction. Add an immediately parameter to the install_config_manager method to support batching package installations in image mode.

Comment thread tmt/package_managers/dnf.py Outdated
Copy link
Copy Markdown
Member

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

Sure. Only suggestion is to switch the order of the PRs

@github-project-automation github-project-automation Bot moved this to backlog in planning Apr 30, 2026
@tcornell-bus tcornell-bus moved this from backlog to implement in planning Apr 30, 2026
@thrix thrix force-pushed the worktree-feature-config-manager-abstraction branch from 45bd5a1 to cbaa1a0 Compare May 4, 2026 12:46
@thrix thrix marked this pull request as ready for review May 4, 2026 13:08
@thrix thrix force-pushed the worktree-feature-config-manager-abstraction branch from cbaa1a0 to 0072821 Compare May 4, 2026 13:10
@thrix thrix changed the base branch from feature-plugins-image-mode to main May 4, 2026 13:12
@thrix
Copy link
Copy Markdown
Contributor Author

thrix commented May 4, 2026

/packit build

@thrix thrix moved this from implement to review in planning May 4, 2026
@thrix
Copy link
Copy Markdown
Contributor Author

thrix commented May 4, 2026

/packit retest-failed

@thrix thrix added ci | full test Pull request is ready for the full test execution area | package managers Changes related to implementations of package managers labels May 4, 2026
Comment thread tests/unit/test_package_managers.py Outdated
Comment on lines +515 to +524
CONTAINER_CONFIG_MANAGER_MATRIX = [
(container, pm_class)
for container, pm_class in CONTAINER_BASE_MATRIX
if pm_class
in (
tmt.package_managers.dnf.Dnf,
tmt.package_managers.dnf.Dnf5,
tmt.package_managers.dnf.Yum,
)
]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There already is CONTAINER_BASE_MATRIX, please reuse it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@LecrisUT should be addressed.

Comment thread tests/unit/test_package_managers.py Outdated
Comment on lines +526 to +529
CONTAINER_CONFIG_MANAGER_MATRIX_IDS = [
f'{container.url} / {package_manager_class.__name__.lower()}'
for container, package_manager_class in CONTAINER_CONFIG_MANAGER_MATRIX
]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not loop over CONTAINER_MATRIX_IDS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should be addressed.

Comment thread tmt/package_managers/__init__.py Outdated
"""
return self.install(*installables, options=options)

def install_config_manager(self) -> None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just a naming issue: so far we're using assert_something() naming scheme for making sure something is available - assert_reachable(), _assert_rsync(), etc. It's not the best naming scheme, but I'd recommend to sticking to it so we can find the "make sure config manager tool is present" case later when we find a better name for such methods. Maybe assert_config_manager()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@happz renamed according to the suggestion

Comment thread tmt/steps/prepare/feature/epel.py Outdated
@thrix thrix force-pushed the worktree-feature-config-manager-abstraction branch from 0072821 to 9b76c8a Compare May 4, 2026 23:19
@psss psss added this to the 1.73 milestone May 5, 2026
@thrix thrix force-pushed the worktree-feature-config-manager-abstraction branch from 9b76c8a to fbde1a0 Compare May 6, 2026 16:36
@thrix thrix requested a review from happz May 6, 2026 16:36
thrix added 3 commits May 7, 2026 13:54
Follow the `copr_plugin` / `enable_copr()` pattern: add a
`config_manager_plugin` ClassVar and `install_config_manager()`
method to the package manager layer instead of duplicating
`dnf-command(config-manager)` installation in feature plugins.

- `Dnf`: `dnf-command(config-manager)`
- `Dnf5`: `dnf5-command(config-manager)`
- `Yum`: `yum-utils`

Closes: #4847

Assisted-by: Claude Code
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
* refactor tests
* rename function name

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
@thrix thrix force-pushed the worktree-feature-config-manager-abstraction branch from fbde1a0 to 4b3393c Compare May 7, 2026 11:54
@tcornell-bus tcornell-bus modified the milestones: 1.73, 1.74 May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | package managers Changes related to implementations of package managers ci | full test Pull request is ready for the full test execution

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

Move config-manager plugin installation to the package manager abstraction layer

5 participants