Skip to content

Conversation

@rezib
Copy link
Collaborator

@rezib rezib commented Jan 12, 2026

Introduce a generic interface to load, check, build, test and publish packages, with abstract classes Package and ActionableArchPackage. All RPM specifics are now handled by children classes PackageRPM and ActionableArchPackageRPM classes. The Controller build, test and validate actions are updated to use the new generic interface. This is one step to make rift able to support other package formats, in addition to RPM.

ProjectPackages class is also introduced. This is a factory to retrieve project's packages as concrete package objects with the corresponding format. It replaces Package.list() generator.

ProjectArchRepositories do not support extra repositories anymore. This was used to hold staging repository. The staging repository is now directly provided to build, test and publish methods.

The Package specfile attribute is renamed buildfile to make it more generic as well. Some modules still expect actual RPM packages. They now instanciate concrete PackageRPM objects. This implies many small changes throughout the code base and the tests.

Introduce a generic interface to load, check, build, test and publish
packages, with abstract classes Package and ActionableArchPackage. All
RPM specifics are now handled by children classes PackageRPM and
ActionableArchPackageRPM classes. The Controller build, test and
validate actions are updated to use the new generic interface. This is
one step to make rift able to support other package formats, in addition
to RPM.

ProjectPackages class is also introduced. This is a factory to retrieve
project's packages as concrete package objects with the corresponding
format. It replaces Package.list() generator.

ProjectArchRepositories do not support extra repositories anymore. This
was used to hold staging repository. The staging repository is now
directly provided to build, test and publish methods.

The Package specfile attribute is renamed buildfile to make it more
generic as well. Some modules still expect actual RPM packages. They now
instanciate concrete PackageRPM objects. This implies many small changes
throughout the code base and the tests.
@rezib rezib requested review from qa-cea and valeriyoann January 12, 2026 09:31
Copy link
Collaborator

@qa-cea qa-cea left a comment

Choose a reason for hiding this comment

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

I'm not really getting the difference between the Package and the ActionableArchPackage classes, do we really need two abstract classes ?

self._modules = modules
self.name = name
# check package format
if _format != 'rpm':
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: maybe having of supported format somewhere in the code would be easier to maintain ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I initially planned to introduce this later but you're right, it is probably a good idea to introduce it now 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done with 216fecc.

def __init__(self, name, config, staff, modules):
super().__init__(name, config, staff, modules, 'rpm', f"{name}.spec")

# Attribytes assigned in load()
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed with 1bdddbf.

@rezib
Copy link
Collaborator Author

rezib commented Jan 19, 2026

I'm not really getting the difference between the Package and the ActionableArchPackage classes, do we really need two abstract classes ?

A Package is conceptually what's found in packages directory with its format and its metadata. It can be loaded, queried and instanciate specific ActionableArchPackage.

An ActionableArchPackage is basically an instance of a Package for a specific architecture, with its build environment and repos. It can built, tested and published.

This model has been chosen because IMO it is well suited to Controller build and validation logic. It notably avoids providing the arch argument to all methods build/test/publish/clean methods.

YMMV though. If you prefer a model with just a Package base class, I can change this of course.

@qa-cea
Copy link
Collaborator

qa-cea commented Jan 19, 2026

I understand better now, thank you. Let's wait for Yoann input on this.

rezib added 3 commits January 20, 2026 11:18
Make Package and ActionableArchPackage classes real abtract classes with
abc module. Also add tests to cover more base classes code.
Introduce this set as single source of thruth for all package formats
supported by Rift.
@rezib rezib force-pushed the pr/controller-build-format-agnostic branch from 216fecc to 50cdcbc Compare January 20, 2026 10:59
@rezib rezib requested a review from qa-cea January 20, 2026 11:14
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.

2 participants