From 796aa9996cd5ccc5f3748c90e39e4a5be83299c7 Mon Sep 17 00:00:00 2001 From: Carl George Date: Mar 24 2021 19:28:18 +0000 Subject: [PATCH 1/3] is_epel regex no longer needs to match el6 --- diff --git a/fedscm_admin/__init__.py b/fedscm_admin/__init__.py index 363709e..dcffb2f 100644 --- a/fedscm_admin/__init__.py +++ b/fedscm_admin/__init__.py @@ -133,7 +133,7 @@ def is_epel(branch): :param branch: a string of the branch name :return: a boolean """ - return bool(re.match(r'^(?:el|epel)\d+$', branch)) + return bool(re.match(r'^epel\d+$', branch)) from .fas import FASClient # noqa: E402 From 9af046841ab2de719a615e096e31302c0752c6e6 Mon Sep 17 00:00:00 2001 From: Carl George Date: Mar 24 2021 19:28:18 +0000 Subject: [PATCH 2/3] is_epel regex should also match playground/next branches --- diff --git a/fedscm_admin/__init__.py b/fedscm_admin/__init__.py index dcffb2f..5c13ac4 100644 --- a/fedscm_admin/__init__.py +++ b/fedscm_admin/__init__.py @@ -133,7 +133,7 @@ def is_epel(branch): :param branch: a string of the branch name :return: a boolean """ - return bool(re.match(r'^epel\d+$', branch)) + return bool(re.match(r'^epel\d+(?:-playground|-next)?$', branch)) from .fas import FASClient # noqa: E402 From 1335839504756010533a7b26d910982c0e906e1c Mon Sep 17 00:00:00 2001 From: Carl George Date: Mar 24 2021 19:28:18 +0000 Subject: [PATCH 3/3] Partially revert 5ae79fa8505525006364af9364f891692f924b95 The file pkg_cs8.json doesn't exist yet. Creating that file will be more difficult than initially expected. For now, just rely on the pkg_el8.json file. That still accounts for the vast majority of packages that shouldn't be allowed to have epel* branches. --- diff --git a/fedscm_admin/utils.py b/fedscm_admin/utils.py index 66efa9e..e3e4c08 100644 --- a/fedscm_admin/utils.py +++ b/fedscm_admin/utils.py @@ -763,10 +763,7 @@ def valid_epel_package(name, branch): """ # Extract any digits in the branch name to determine the EL version version = ''.join([i for i in branch if re.match(r'\d', i)]) - if branch.endswith('-next'): - url = f'https://infrastructure.fedoraproject.org/repo/json/pkg_cs{version}.json' - else: - url = f'https://infrastructure.fedoraproject.org/repo/json/pkg_el{version}.json' + url = f'https://infrastructure.fedoraproject.org/repo/json/pkg_el{version}.json' rv = requests_wrapper( url, timeout=60, service_name='infrastructure.fedoraproject.org') rv_json = get_request_json(rv, 'getting the list of official EL packages')