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/<release-id> for the branch creation.

[1] https://governance.openstack.org/tc/reference/release-naming.html

Change-Id: Id6a03024fa2268ba233189abfe48556d3530daef
This commit is contained in:
Hervé Beraud 2023-03-06 10:54:11 +01:00
parent 0243d899c4
commit 759732ebc1
1 changed files with 17 additions and 1 deletions

View File

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