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 a62d2e8b8d..af08631866 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 @@ -160,16 +160,21 @@ def process_release_requests(reporoot, filenames, meta_data): branch_name = get_branch(series_status, series_name) + with open(filename, 'r', encoding='utf-8') as f: + deliverable_data = yaml.safe_load(f.read()) + + trailing = deliverable_data.get('type') == 'trailing' + closed_series = series_name in CLOSED_SERIES + # If the series is closed, do not process the file. We're # likely updating old data in the releases repo and we do not # want to reprocess any old branches or tags. - if series_name in CLOSED_SERIES: + # Exception is if the project is cycle-trailing typed, in that + # case late final stable release and EOL tagging is allowed. + if closed_series and not trailing: print(' {} skipping closed series'.format(filename)) continue - with open(filename, 'r', encoding='utf-8') as f: - deliverable_data = yaml.safe_load(f.read()) - deliverable_releases = deliverable_data.get('releases', []) # If there are no releases or branches listed in this file, skip it. @@ -221,6 +226,12 @@ def process_release_requests(reporoot, filenames, meta_data): first_full_release, meta_data, branch_name, ) + # If the series is closed, do not process the branch + # section to avoid already deleted branch re-creation. + if closed_series: + print(' {} skipping closed series'.format(filename)) + continue + # Create branches and adapt master for branch in deliverable_data.get('branches', []): masterbranchname = nextbranchname(branch['name'], reporoot)