mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-02 20:59:06 +08:00
handle default_ref recursively for module components
This commit is contained in:
@@ -247,7 +247,7 @@ def _scm_get_latest(data):
|
||||
return {"pkg_name": data.rpm_component.get_name(), "pkg_ref": pkgref, "error": None}
|
||||
|
||||
|
||||
def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None):
|
||||
def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None, default_ref=None):
|
||||
"""
|
||||
Prepares the modulemd for the MBS. This does things such as replacing the
|
||||
branches of components with commit hashes and adding metadata in the xmd
|
||||
@@ -281,7 +281,8 @@ def format_mmd(mmd, scmurl, module=None, db_session=None, srpm_overrides=None):
|
||||
|
||||
xmd["mbs"]["commit"] = full_scm_hash
|
||||
|
||||
default_ref = xmd["mbs"].get("branch") or conf.default_branch
|
||||
if default_ref is None:
|
||||
default_ref = xmd["mbs"].get("branch") or conf.default_branch
|
||||
|
||||
if mmd.get_rpm_component_names() or mmd.get_module_component_names():
|
||||
if "rpms" not in xmd["mbs"]:
|
||||
@@ -510,6 +511,8 @@ def record_component_builds(
|
||||
# planned for batch 2 and following.
|
||||
batch = initial_batch
|
||||
|
||||
default_ref = mmd.get_xmd()["mbs"].get("branch")
|
||||
|
||||
for component in all_components:
|
||||
# Increment the batch number when buildorder increases.
|
||||
if previous_buildorder != component.get_buildorder():
|
||||
@@ -525,7 +528,7 @@ def record_component_builds(
|
||||
# It is OK to whitelist all URLs here, because the validity
|
||||
# of every URL have been already checked in format_mmd(...).
|
||||
included_mmd = fetch_mmd(full_url, whitelist_url=True)[0]
|
||||
format_mmd(included_mmd, module.scmurl, module, db_session, srpm_overrides)
|
||||
format_mmd(included_mmd, module.scmurl, module, db_session, srpm_overrides, default_ref)
|
||||
batch = record_component_builds(
|
||||
included_mmd, module, batch, previous_buildorder, main_mmd)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user