Merge "Fix propose-final-releases command to use release-id"

This commit is contained in:
Zuul 2023-03-23 11:33:01 +00:00 committed by Gerrit Code Review
commit 2e15253474

View File

@ -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,
)