diff --git a/openstack_releases/cmds/propose_final_releases.py b/openstack_releases/cmds/propose_final_releases.py index f93ef74c1d..ead5fae8a4 100644 --- a/openstack_releases/cmds/propose_final_releases.py +++ b/openstack_releases/cmds/propose_final_releases.py @@ -24,11 +24,26 @@ import tempfile import openstack_releases from openstack_releases import deliverable from openstack_releases import gitutils +from openstack_releases import series_status from openstack_releases import yamlutils PRE_RELEASE = re.compile('(a|b|rc)') +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 get_prior_branch_point(workdir, repo, branch): """Return the tag of the base of the branch. @@ -180,7 +195,7 @@ def main(): (latest_release.version.split('.')[:-1] + ['0'])[:3] ) - branch = 'stable/{}'.format(args.prior_series) + branch = 'stable/{}'.format(get_stable_branch_id(args.prior_series)) diff_start = get_prior_branch_point( workdir, projects[0].repo.name, branch, )