mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 11:49:52 +08:00
Reuse the latest module build found.
Before this commit, the base modules used in the `get_reusable_module` have not been sorted and therefore when `get_reusable_module` tried to find out the reusable module built against some base module, it could find a module built against some old version of base module. This could lead to situation when MBS tried to reuse components from quite old module despite the fact that newer module build existed. This commit fixes this by sorting the base modules by stream_version, so MBS always tries to get the reusable module built against the latest base module.
This commit is contained in:
@@ -94,6 +94,10 @@ def get_reusable_module(db_session, module):
|
||||
previous_module_build = None
|
||||
|
||||
base_mmds = get_base_module_mmds(db_session, mmd)["ready"]
|
||||
# Sort the base_mmds based on the stream version, higher version first.
|
||||
base_mmds.sort(
|
||||
key=lambda mmd: models.ModuleBuild.get_stream_version(mmd.get_stream_name(), False),
|
||||
reverse=True)
|
||||
for base_mmd in base_mmds:
|
||||
mbs_xmd = mmd.get_xmd()["mbs"]
|
||||
if base_mmd.get_module_name() not in mbs_xmd["buildrequires"]:
|
||||
|
||||
Reference in New Issue
Block a user