From 759732ebc1939d608acfca0ff9fb6ed138abd996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Mon, 6 Mar 2023 10:54:11 +0100 Subject: [PATCH] Fix list-deliverables command to use release-id With the new release identification / naming schema [1] (like: 2023.1 Antelope) new stable branch naming was introduced (like: stable/2023.1). This was not handled in the list-deliverables command as it still uses the release name. This patch fixes this by reading the 'release-id' field from series_status.yaml and if present then uses it as stable/ for the branch creation. [1] https://governance.openstack.org/tc/reference/release-naming.html Change-Id: Id6a03024fa2268ba233189abfe48556d3530daef --- openstack_releases/cmds/list_deliverables.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/openstack_releases/cmds/list_deliverables.py b/openstack_releases/cmds/list_deliverables.py index 0c2ae0ff0c..9689b63132 100644 --- a/openstack_releases/cmds/list_deliverables.py +++ b/openstack_releases/cmds/list_deliverables.py @@ -19,6 +19,21 @@ import openstack_releases from openstack_releases import defaults from openstack_releases import deliverable from openstack_releases import schema +from openstack_releases import series_status + + +def get_stable_branch_id(series): + """Retrieve the stable branch ID of the series. + + Returns the release-id if the series has such field, otherwise + returns the series name. This is needed for the new stable branch + naming style: stable/2023.1 (versus the old style: stable/zed). + """ + series_status_data = series_status.SeriesStatus.default() + release_id = series_status_data[series].release_id + if release_id is None: + release_id = series + return str(release_id) def main(): @@ -220,7 +235,8 @@ def main(): continue if deliv.stable_branch_type is None: continue - if deliv.get_branch_location('stable/' + series) is not None: + if deliv.get_branch_location('stable/' + + get_stable_branch_id(series)) is not None: continue if args.unreleased and (deliv.is_released or not deliv.is_releasable): continue