Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split package manager code into scripts and execution #3587

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

happz
Copy link
Collaborator

@happz happz commented Mar 8, 2025

Current package manager classes were given a guest, and then were responsible for running commands on the guest to install stuff. To support delayed running of these commands - I'm looking at you, image mode! - we would like to use the existing implementations, use the existing code preparing commands like dnf install foo, we just don't want to run them on the guest.

Package manager classes are now split into two parts: "engine" that is pretty much what package managers are now, i.e. prepares commands that would reaize the requested action, and the "package manager" whose job is to urn these commands. Each package manager has its own engine. The effect is, we can now can access an engine we pick, and use it to construct the commands without actually running them. We can put them into Containerfiles, or run them in a special SSH session, and so on. And it will use the same code as the usual "install me a package now" workflow of regular testing, preventing duplication and exceptions.

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

Current package manager classes were given a guest, and then were
responsible for running commands on the guest to install stuff. To
support delayed running of these commands - I'm looking at you, image
mode! - we would like to use the existing implementations, use the
existing code preparing commands like `dnf install foo`, we just don't
want to run them on the guest.

Package manager classes are now split into two parts: "engine" that is
pretty much what package managers are now, i.e. prepares commands that
would reaize the requested action, and the "package manager" whose job
is to urn these commands. Each package manager has its own engine. The
effect is, we can now can access an engine we pick, and use it to
construct the commands without actually running them. We can put them
into Containerfiles, or run them in a special SSH session, and so on.
And it will use the same code as the usual "install me a package *now*"
workflow of regular testing, preventing duplication and exceptions.
@happz happz added code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. ci | full test Pull request is ready for the full test execution area | package managers Changes related to implementations of package managers labels Mar 8, 2025
@happz happz mentioned this pull request Mar 8, 2025
8 tasks
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 code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant