mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-11-30 16:14:44 +08:00
Generate koji tag from MBS and use informative name
koji now supports tags with max length of 256, we can use
more informative tag name instead of the hash one.
The new format of koji tag name is:
module-<name>-<stream>-<version>-<context>
However when the generated tag's length > (256 - len('build')), we
fallback to the old way of name in hash format (module-<hash>).
In this change, koji tag is always generated from MBS itself, even
with pdc resolver.
FIXES: #918 #925
This commit is contained in:
@@ -21,8 +21,6 @@
|
||||
#
|
||||
# Written by Matt Prahl <mprahl@redhat.com>
|
||||
|
||||
import hashlib
|
||||
|
||||
from module_build_service import log
|
||||
from module_build_service.resolver.base import GenericResolver
|
||||
from module_build_service import models
|
||||
@@ -67,21 +65,6 @@ class DBResolver(GenericResolver):
|
||||
"Cannot find any module builds for %s:%s" % (name, stream))
|
||||
return [build.mmd() for build in builds]
|
||||
|
||||
def get_module_tag(self, name, stream, version, context, strict=False):
|
||||
"""
|
||||
Gets the module tag from the resolver. Since the resolver is the DB, it is just generated
|
||||
here.
|
||||
:param name: a string of the module's name
|
||||
:param stream: a string of the module's stream
|
||||
:param version: a string or int of the module's version
|
||||
:param context: a string of the module's context
|
||||
:kwarg strict: Here solely for compatibility with the base class' function signature
|
||||
:return: a string of the tag to use
|
||||
"""
|
||||
# This algorithm mimicks what pdc-updater does
|
||||
tag_str = '.'.join([name, stream, str(version), context])
|
||||
return 'module-{0}'.format(hashlib.sha1(tag_str).hexdigest()[:16])
|
||||
|
||||
def resolve_profiles(self, mmd, keys):
|
||||
"""
|
||||
Returns a dictionary with keys set according the `keys` parameters and values
|
||||
|
||||
Reference in New Issue
Block a user