From f1be45bc279efed8975fc922c3c37399505c2b14 Mon Sep 17 00:00:00 2001 From: Qixiang Wan Date: May 21 2019 08:21:36 +0000 Subject: Not check requires/buildrequires for existing koji tags When we're going to add a new module build tag into tag's inheritance data, we check existing module tags in inheritance first, previously we filter these module tags with requires and buildrequires, tags not match the requires/buildrequires will not be considered as old tags of the new module build. That is incorrect, we should have only one one combination of NAME & STREAM in one koji tag, which means we should not filter out the module tags that belong to the same NAME & STREAM but with different requires or buildrequires. --- diff --git a/tests/test_add_module.py b/tests/test_add_module.py index 5ee2ca1..be43e2f 100644 --- a/tests/test_add_module.py +++ b/tests/test_add_module.py @@ -419,8 +419,7 @@ class TestAddModuleFunctions: }], []), - # koji_tag exists in tag inheritance and module builds are - # filtered by both requires and buildrequires. + # koji_tag exists in tag inheritance and module builds (ModuleConfig({'name': 'mariadb', 'stream': '10.4', 'version': '3120190304180825', 'context': 'f636be4b', 'requires': {'platform': 'f30'}, @@ -444,7 +443,7 @@ class TestAddModuleFunctions: }], ['module-mariadb-10.4-3020190304180835-a5b0195c']), - # No module builds match the platform:f30 + # filter with requires/buildrequires, it won't filter out mariadb:10.4 modules (ModuleConfig({'name': 'mariadb', 'stream': '10.4', 'version': '3120190304180825', 'context': 'f636be4b', 'requires': {'platform': 'f30'}, @@ -467,7 +466,7 @@ class TestAddModuleFunctions: requires={'platform': 'f28'}, buildrequires={'platform': 'f28'}).dumps(), }], - []), + ['module-mariadb-10.4-3020190304180835-a5b0195c']), ]) @patch('ursa_major.koji_service.koji') @patch('requests.get') @@ -478,7 +477,7 @@ class TestAddModuleFunctions: {'parent_id': 100, 'name': 'module-ant-1.10-20181122140939-819b5873'}, {'parent_id': 101, - 'name': '"module-hyperfine-latest-3120190318171218-f636be4b'}, + 'name': 'module-hyperfine-latest-3120190318171218-f636be4b'}, {'parent_id': 102, 'name': 'module-exa-latest-2820190316115637-8de94f32'}, {'parent_id': 103, diff --git a/ursa_major/handlers/base.py b/ursa_major/handlers/base.py index 9396aa2..f6785c7 100644 --- a/ursa_major/handlers/base.py +++ b/ursa_major/handlers/base.py @@ -116,8 +116,6 @@ class BaseHandler(object): """ tags_from_koji = set(t['name'] for t in self.koji.get_inheritance_data(tag)) modules = self.mbs.get_modules( - requires=module_config.requires, - buildrequires=module_config.buildrequires, name=module_config.name, stream=module_config.stream, state=MBS_BUILD_READY_STATE,