KojiResolver: Filter module builds based on the real stream name.

Query Koji for the real stream name of each module and keep only those matching
requested `stream`.

This needs to be done, because MBS stores the stream name in the "version" field in Koji,
but the "version" field cannot contain "-" character. Therefore MBS replaces all "-"
with "_". This makes it impossible to reconstruct the original stream name from the
"version" field.

We therefore need to ask for real original stream name here and filter out modules based
on this real stream name.
This commit is contained in:
Jan Kaluza
2019-10-11 10:41:28 +02:00
parent 578d6f1e33
commit eeb65c97da
3 changed files with 119 additions and 2 deletions

View File

@@ -1694,6 +1694,9 @@ class TestUtilsModuleReuse:
"release": "20170109091357.78e4a6fd", "tag_name": "module-fedora-27-build"
}]
koji_session.multiCall.return_value = [
[build] for build in koji_session.listTagged.return_value]
# Mark platform:f28 as KojiResolver ready by defining "koji_tag_with_modules".
# Also define the "virtual_streams" to possibly confuse the get_reusable_module.
platform_f28 = db_session.query(models.ModuleBuild).filter_by(name="platform").one()