From 0389ad36ecd237d1c675cd94a24fd31131562329 Mon Sep 17 00:00:00 2001 From: mprahl Date: Nov 02 2017 14:25:02 +0000 Subject: Remove the caching patch and add a patch that fixes a typo --- diff --git a/fix-typo.patch b/fix-typo.patch new file mode 100644 index 0000000..b7440ab --- /dev/null +++ b/fix-typo.patch @@ -0,0 +1,67 @@ +From 089a0c3db4d4191a508b058eaac0b0e9b1593d17 Mon Sep 17 00:00:00 2001 +From: mprahl +Date: Thu, 2 Nov 2017 08:37:59 -0400 +Subject: [PATCH] Fix typo + +--- + module_build_service/config.py | 2 +- + module_build_service/models.py | 2 +- + module_build_service/views.py | 2 +- + tests/test_views/test_views.py | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/module_build_service/config.py b/module_build_service/config.py +index b51cb18..ce89c72 100644 +--- a/module_build_service/config.py ++++ b/module_build_service/config.py +@@ -586,7 +586,7 @@ class Config(object): + + def _setifok_rebuild_strategy(self, strategy): + if strategy not in SUPPORTED_STRATEGIES: +- raise ValueError('The strategy "{0}" is not supported. Chose from: {1}' ++ raise ValueError('The strategy "{0}" is not supported. Choose from: {1}' + .format(strategy, ', '.join(SUPPORTED_STRATEGIES))) + self._rebuild_strategy = strategy + +diff --git a/module_build_service/models.py b/module_build_service/models.py +index 7941905..80854bd 100644 +--- a/module_build_service/models.py ++++ b/module_build_service/models.py +@@ -233,7 +233,7 @@ class ModuleBuild(MBSBase): + def validate_rebuild_stategy(self, key, rebuild_strategy): + if rebuild_strategy not in self.rebuild_strategies.keys(): + choices = ', '.join(self.rebuild_strategies.keys()) +- raise ValueError('The rebuild_strategy of "{0}" is invalid. Chose from: {1}' ++ raise ValueError('The rebuild_strategy of "{0}" is invalid. Choose from: {1}' + .format(rebuild_strategy, choices)) + return rebuild_strategy + +diff --git a/module_build_service/views.py b/module_build_service/views.py +index a99a096..8b97060 100644 +--- a/module_build_service/views.py ++++ b/module_build_service/views.py +@@ -267,7 +267,7 @@ class BaseHandler(object): + if 'rebuild_strategy' in self.data: + if self.data['rebuild_strategy'] not in conf.rebuild_strategies_allowed: + raise ValidationError( +- 'The rebuild method of "{0}" is not allowed. Chose from: {1}.' ++ 'The rebuild method of "{0}" is not allowed. Choose from: {1}.' + .format(self.data['rebuild_strategy'], + ', '.join(conf.rebuild_strategies_allowed))) + +diff --git a/tests/test_views/test_views.py b/tests/test_views/test_views.py +index c2bb643..80850c8 100644 +--- a/tests/test_views/test_views.py ++++ b/tests/test_views/test_views.py +@@ -538,7 +538,7 @@ class TestViews(unittest.TestCase): + self.assertEqual(rv.status_code, 400) + expected_error = { + 'error': 'Bad Request', +- 'message': ('The rebuild method of "only-changed" is not allowed. Chose from: all.'), ++ 'message': ('The rebuild method of "only-changed" is not allowed. Choose from: all.'), + 'status': 400 + } + self.assertEqual(data, expected_error) +-- +2.13.6 + diff --git a/mbs-cache-buildroot-groups.patch b/mbs-cache-buildroot-groups.patch deleted file mode 100644 index 70db2bc..0000000 --- a/mbs-cache-buildroot-groups.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/module_build_service/builder/base.py b/module_build_service/builder/base.py -index 7d474d5..4165295 100644 ---- a/module_build_service/builder/base.py -+++ b/module_build_service/builder/base.py -@@ -127,7 +127,28 @@ class GenericBuilder(six.with_metaclass(ABCMeta)): - builder = GenericBuilder.create( - module.owner, module, config.system, config, - tag_name=module.koji_tag, components=components) -- groups = GenericBuilder.default_buildroot_groups(session, module) -+ -+ # Getting the groups from PDC can be time consuming, because we need -+ # to get whole dependency tree from PDC, which might result in lot -+ # of calls to PDC, so just get the groups once per module build -+ # and store it in xmd. The buildroot groups of particular module -+ # build don't change during the module built, so it is OK to cache -+ # them like that. -+ mmd = module.mmd() -+ if not "buildroot_groups" in mmd.xmd["mbs"]: -+ build_groups = GenericBuilder.default_buildroot_groups( -+ session, module) -+ # Change to sets to lists, so we can store them in modulemd. -+ for key in build_groups.keys(): -+ build_groups[key] = list(build_groups[key]) -+ mmd.xmd["mbs"]["buildroot_groups"] = build_groups -+ module.modulemd = mmd.dumps() -+ -+ groups = mmd.xmd["mbs"]["buildroot_groups"] -+ # Change to lists to sets, because buildroot_connect expects sets. -+ for key in groups.keys(): -+ groups[key] = set(groups[key]) -+ - builder.buildroot_connect(groups) - return builder - diff --git a/module-build-service.spec b/module-build-service.spec index d168ccb..7617dcc 100644 --- a/module-build-service.spec +++ b/module-build-service.spec @@ -1,14 +1,13 @@ Name: module-build-service Version: 1.4.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Module Build Service for Modularity Group: Development/Tools License: MIT URL: https://pagure.io/fm-orchestrator Source0: https://files.pythonhosted.org/packages/source/m/%{name}/%{name}-%{version}.tar.gz -# hotfix for maven module build blocking the MBS -Patch0: mbs-cache-buildroot-groups.patch +Patch0: fix-typo.patch BuildArch: noarch @@ -217,6 +216,10 @@ done %exclude %{python2_sitelib}/tests/ %changelog +* Thu Nov 2 2017 Matt Prahl - 1.4.0-2 +- Remove the caching patch that was merged upstream +- Add a patch that fixes a typo in error messages + * Wed Nov 1 2017 Matt Prahl - 1.4.0-1 - New version