mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-12 17:44:59 +08:00
Prefix the component disttag with the platform stream
This commit is contained in:
@@ -212,8 +212,26 @@ def get_rpm_release(module_build):
|
||||
mse_build_ids = module_build.siblings + [module_build.id or 0]
|
||||
mse_build_ids.sort()
|
||||
index = mse_build_ids[0]
|
||||
return "{prefix}{index}+{dist_hash}".format(
|
||||
try:
|
||||
buildrequires = module_build.mmd().get_xmd()['mbs']['buildrequires']
|
||||
except (ValueError, KeyError):
|
||||
log.warn('Module build {0} does not have buildrequires in its xmd'.format(module_build.id))
|
||||
buildrequires = None
|
||||
|
||||
base_module_stream = ''
|
||||
if buildrequires:
|
||||
for base_module in conf.base_module_names:
|
||||
base_module_stream = buildrequires.get(base_module, {}).get('stream', '')
|
||||
if base_module_stream:
|
||||
base_module_stream += '+'
|
||||
break
|
||||
else:
|
||||
log.warn('Module build {0} does not buildrequire a base module ({1})'
|
||||
.format(module_build.id, ' or '.join(conf.base_module_names)))
|
||||
|
||||
return '{prefix}{base_module_stream}{index}+{dist_hash}'.format(
|
||||
prefix=conf.default_dist_tag_prefix,
|
||||
base_module_stream=base_module_stream,
|
||||
index=index,
|
||||
dist_hash=dist_hash,
|
||||
)
|
||||
|
||||
@@ -462,7 +462,7 @@ def submit_module_build(username, url, mmd, scm, optional_params=None):
|
||||
modules = []
|
||||
|
||||
for mmd in mmds:
|
||||
# Prefix the version of the modulemd based on the platform it buildrequires
|
||||
# Prefix the version of the modulemd based on the base module it buildrequires
|
||||
version = get_prefixed_version(mmd)
|
||||
mmd.set_version(version)
|
||||
version_str = str(version)
|
||||
|
||||
@@ -282,6 +282,12 @@ class TestUtils:
|
||||
assert release_one == "module+2+b8645bbb"
|
||||
assert release_two == "module+2+17e35784"
|
||||
|
||||
def test_get_rpm_release_platform_stream(self):
|
||||
scheduler_init_data(1)
|
||||
build_one = models.ModuleBuild.query.get(2)
|
||||
release = module_build_service.utils.get_rpm_release(build_one)
|
||||
assert release == 'module+f28+2+814cfa39'
|
||||
|
||||
@pytest.mark.parametrize('scmurl', [
|
||||
('git://pkgs.stg.fedoraproject.org/modules/testmodule.git'
|
||||
'?#620ec77321b2ea7b0d67d82992dda3e1d67055b4'),
|
||||
|
||||
Reference in New Issue
Block a user