From 79f1543ecca7c082a102487bf545845330168aec Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Dec 19 2023 11:30:30 +0000 Subject: Remove epel-playground support EPEL Playground has been shut down in January 2022 [1]. Thus, carrying support for it only needlessly complicates the codebase. Remove all support and test cases for EPEL Playground. [1]: https://docs.fedoraproject.org/en-US/epel/epel-about-playground/ Signed-off-by: Otto Liljalaakso --- diff --git a/fedpkg/__init__.py b/fedpkg/__init__.py index 5933916..ea76877 100644 --- a/fedpkg/__init__.py +++ b/fedpkg/__init__.py @@ -89,13 +89,6 @@ class Commands(pyrpkg.Commands): self.mockconfig = 'epel-%s-%s' % (self._distval, self.localarch) self.override = 'epel%s-override' % self._distval self._distunset = 'fedora' - elif re.match(r'epel\d+-playground$', branch): - self._distval = re.search(r'\d+', branch).group(0) - self._distvar = 'rhel' - self._disttag = 'epel%s.playground' % self._distval - self.mockconfig = 'epel-%s-%s' % (self._distval, self.localarch) - self.override = 'epel%s-override' % self._distval - self._distunset = 'fedora' elif re.match(r'epel\d+-next$', branch): self._distval = re.search(r'\d+', branch).group(0) self._distvar = 'rhel' diff --git a/fedpkg/cli.py b/fedpkg/cli.py index a9fd8d2..bf167f5 100644 --- a/fedpkg/cli.py +++ b/fedpkg/cli.py @@ -1150,8 +1150,6 @@ class fedpkgClient(cliClient): def get_branch(): """Returns the branch according to inputs.""" - if playground_match: - return playground_match.groups()[0] if next_match: return next_match.groups()[0] return branch @@ -1203,8 +1201,6 @@ class fedpkgClient(cliClient): 'names'.format('flatpak' if ns == 'flatpaks' else 'module')) release_branches = list(itertools.chain( *list(get_release_branches(pdc_url).values()))) - # treat epel*-playground the same as epel* release branches - playground_match = re.match(r'^(epel\d+)-playground$', branch) # treat epel*-next the same as epel* release branches next_match = re.match(r'^(epel\d+)-next$', branch) @@ -1263,7 +1259,6 @@ class fedpkgClient(cliClient): auto_module = ( ns == 'rpms' and not re.match(RELEASE_BRANCH_REGEX, b) - and not playground_match # Dont run auto_module on epel-playground requests and not next_match # Dont run auto_module on epel-next requests and not no_auto_module ) diff --git a/fedpkg/utils.py b/fedpkg/utils.py index 6511002..eaa47ab 100644 --- a/fedpkg/utils.py +++ b/fedpkg/utils.py @@ -526,11 +526,6 @@ def get_stream_branches(server_url, package_name): # package.cfg file in the branch. elif 'epel7' == item['name']: continue - # epel8-playground and above playground branches should be considered - # as release branches so that it will use epelX-playground-candidate - # target to build. - elif re.match(r'^epel\d+-playground$', item['name']): - continue # epel8-next and above branches should be considered as release branches # so that it will use epelX-next-candidate target to build. elif re.match(r'^epel\d+-next$', item['name']): @@ -562,10 +557,6 @@ def expand_release(rel, active_releases): return active_releases['epel'] elif rel in active_releases['fedora'] or rel in active_releases['epel']: return [rel] - # if epelX-playground branch then return the release to use - # epelX-playground-candidate target - elif re.match(r'^epel\d+-playground$', rel): - return [rel] else: return None diff --git a/test/test_cli.py b/test/test_cli.py index 1970515..34c7ed7 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -1095,55 +1095,6 @@ class TestRequestBranch(CliTestCase): @patch('requests.post') @patch('fedpkg.cli.get_release_branches') @patch('sys.stdout', new=StringIO()) - def test_request_epel_playground_branch_override( - self, mock_grb, mock_request_post, mock_request_get - ): - """Tests request-epel-branch-override""" - mock_grb.return_value = {'fedora': ['f25', 'f26', 'f27'], - 'epel': ['el6', 'epel7', 'epel8']} - - mock_rv = Mock() - mock_rv.ok = True - mock_rv.json.return_value = {"arches": [], "packages": {}} - mock_request_get.return_value = mock_rv - - mock_rv = Mock() - mock_rv.ok = True - mock_rv.json.return_value = {'issue': {'id': 2}} - mock_request_post.return_value = mock_rv - - # Checkout the epel7 branch - self.run_cmd(['git', 'checkout', 'epel7'], cwd=self.cloned_repo_path) - - cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path, - 'request-branch', '--repo', 'sudoku', 'epel8-playground'] - cli = self.get_cli(cli_cmd) - cli.request_branch() - - expected_issue_content = { - 'action': 'new_branch', - 'repo': 'sudoku', - 'namespace': 'rpms', - 'branch': 'epel8-playground', - 'create_git_branch': True - } - self.assertEqual(len(mock_request_post.call_args_list), 1) - - # Get the data that was submitted to Pagure - post_data = mock_request_post.call_args_list[0][1]['data'] - actual_issue_content = json.loads(json.loads( - post_data)['issue_content'].strip('```')) - self.assertEqual(expected_issue_content, actual_issue_content) - - output = sys.stdout.getvalue().strip() - expected_output = ('https://pagure.stg.example.com/releng/' - 'fedora-scm-requests/issue/2') - self.assertEqual(output, expected_output) - - @patch('requests.get') - @patch('requests.post') - @patch('fedpkg.cli.get_release_branches') - @patch('sys.stdout', new=StringIO()) def test_request_branch_module(self, mock_grb, mock_request_post, mock_request_get): """Tests request-branch for a new module branch""" mock_grb.return_value = {'fedora': ['f25', 'f26', 'f27'], diff --git a/test/test_commands.py b/test/test_commands.py index 1ea3e2d..fb417ff 100644 --- a/test/test_commands.py +++ b/test/test_commands.py @@ -252,21 +252,6 @@ class TestLoadRpmDefines(CommandTestCase): self.assert_rpmdefines() @patch('pyrpkg.Commands.branch_merge', new_callable=PropertyMock) - def test_load_epel8_playground_dist_tag(self, branch_merge): - branch_merge.return_value = 'epel8-playground' - - self.cmd.load_rpmdefines() - - self.assertEqual('8', self.cmd._distval) - self.assertEqual('rhel', self.cmd._distvar) - self.assertEqual('epel8.playground', self.cmd._disttag) - self.assertEqual('epel-8-i686', self.cmd.mockconfig) - self.assertEqual('epel8-override', self.cmd.override) - self.assertTrue(hasattr(self.cmd, '_distunset')) - - self.assert_rpmdefines() - - @patch('pyrpkg.Commands.branch_merge', new_callable=PropertyMock) def test_load_epel8_next_dist_tag(self, branch_merge): branch_merge.return_value = 'epel8-next' diff --git a/test/test_utils.py b/test/test_utils.py index 49dc1da..e3debc9 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -482,7 +482,6 @@ class TestGetStreamBranches(unittest.TestCase): {'name': 'epel7'}, {'name': 'rawhide'}, {'name': 'epel8'}, - {'name': 'epel8-playground'} ], 'next': None }