From a952de875246122098151c1142e032a15ec25e9e Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Wed, 14 Jun 2023 16:02:25 -0700 Subject: [PATCH] Remove the CLOSED_SERIES static list Currently we have a, short, static list of closed releases. We maintain this data in series_status.yaml. This change loads this data to build CLOSED_SERIES on load. Change-Id: I3270eb7771f892cf8b2de760c1d0966bcfc8417c --- .../release-tools/process_release_requests.py | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/roles/copy-release-tools-scripts/files/release-tools/process_release_requests.py b/roles/copy-release-tools-scripts/files/release-tools/process_release_requests.py index 019392b849..df60cfeb0e 100755 --- a/roles/copy-release-tools-scripts/files/release-tools/process_release_requests.py +++ b/roles/copy-release-tools-scripts/files/release-tools/process_release_requests.py @@ -23,25 +23,7 @@ import subprocess import yaml -# TODO(dhellmann): Instead of using a fixed list, look for the series -# name -eol tag to determine that a series is closed. -CLOSED_SERIES = set([ - 'austin', - 'bexar', - 'cactus', - 'diablo', - 'essex', - 'folsom', - 'grizzly', - 'havana', - 'icehouse', - 'juno', - 'kilo', - 'liberty', - 'mitaka', - 'newton', -]) - +CLOSED_SERIES = set() PRE_RELEASE_RE = re.compile(r''' \.(\d+(?:[ab]|rc)+\d*)$ ''', flags=re.VERBOSE | re.UNICODE) @@ -117,6 +99,13 @@ def make_branch(repo, name, ref, nextbranchname=None): return 0 +def load_series_status(reporoot): + status_path = os.path.join(reporoot, "data", "series_status.yaml") + with open(status_path) as f: + series_status = yaml.safe_load(f) + return series_status + + def process_release_requests(reporoot, filenames, meta_data): """Return a sequence of tuples containing the new versions. @@ -135,6 +124,11 @@ def process_release_requests(reporoot, filenames, meta_data): reporoot ) + series_status = load_series_status(reporoot) + for series in series_status: + if series.get("status") == "end of life": + CLOSED_SERIES.add(series.get("name")) + error_count = 0 for basename in deliverable_files: