mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-06-14 22:17:34 +08:00
Don't filter RPMs of reused components from a module that depends on itself
If a module has filters set and it buildrequires itself, issues occur during component reuse. In that event, the filtered RPMs from the previous module build will not be available in the buildroot because the NVRs in the filters will match the RPMs from the reused component. Co-authored-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
@@ -167,7 +167,7 @@ def attempt_to_reuse_all_components(builder, session, module):
|
||||
return True
|
||||
|
||||
|
||||
def get_reusable_components(session, module, component_names):
|
||||
def get_reusable_components(session, module, component_names, previous_module_build=None):
|
||||
"""
|
||||
Returns the list of ComponentBuild instances belonging to previous module
|
||||
build which can be reused in the build of module `module`.
|
||||
@@ -181,6 +181,9 @@ def get_reusable_components(session, module, component_names):
|
||||
:param session: SQLAlchemy database session
|
||||
:param module: the ModuleBuild object of module being built.
|
||||
:param component_names: List of component names to be reused.
|
||||
:kwarg previous_module_build: the ModuleBuild instance of a module build
|
||||
which contains the components to reuse. If not passed, get_reusable_module
|
||||
is called to get the ModuleBuild instance.
|
||||
:return: List of ComponentBuild instances to reuse in the same
|
||||
order as `component_names`
|
||||
"""
|
||||
@@ -188,7 +191,8 @@ def get_reusable_components(session, module, component_names):
|
||||
if conf.system not in ['koji', 'test']:
|
||||
return [None] * len(component_names)
|
||||
|
||||
previous_module_build = get_reusable_module(session, module)
|
||||
if not previous_module_build:
|
||||
previous_module_build = get_reusable_module(session, module)
|
||||
if not previous_module_build:
|
||||
return [None] * len(component_names)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user