Validate membership of EOL tag on unmaintained branch

Before the 'Unmaintained' phase of series was introduced all tags had
to be applied on master or stable branches. Now it is also possible
that am *-eol tag is applied on an unmaintained branch.

Change-Id: I767b1e80c594a84efe5f4874e9140d3ddc0347da
This commit is contained in:
Előd Illés 2024-11-22 19:05:18 +01:00
parent 1928a01ae5
commit efebb17b8a
2 changed files with 18 additions and 5 deletions

View File

@ -41,6 +41,19 @@ def get_stable_branch_id(series):
return series_status_data[series].release_id return series_status_data[series].release_id
def get_full_branch_name(series):
"""Retrieve the full branch name for the series.
Returns stable/<release-id> if the series is still maintained
or returns unmaintained/<release-id> if the series already went
to Unmaintained.
"""
series_status_data = series_status.SeriesStatus.default()
return '%s/%s' % (
'unmaintained' if series_status_data[series].is_eom else 'stable',
series_status_data[series].release_id)
def find_modified_deliverable_files(): def find_modified_deliverable_files():
"Return a list of files modified by the most recent commit." "Return a list of files modified by the most recent commit."
results = processutils.check_output( results = processutils.check_output(
@ -260,7 +273,7 @@ def check_branch_sha(workdir, repo, series, sha):
if stable/N exists we could not create stable/N-1). if stable/N exists we could not create stable/N-1).
""" """
remote_match = 'remotes/origin/stable/%s' % get_stable_branch_id(series) remote_match = 'remotes/origin/%s' % get_full_branch_name(series)
try: try:
containing_branches = _filter_branches( containing_branches = _filter_branches(
processutils.check_output( processutils.check_output(

View File

@ -875,10 +875,10 @@ class TestValidateReleaseBranchMembership(base.BaseTestCase):
self.assertEqual(0, len(self.ctx.warnings)) self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors)) self.assertEqual(0, len(self.ctx.errors))
@mock.patch('openstack_releases.gitutils.get_stable_branch_id') @mock.patch('openstack_releases.gitutils.get_full_branch_name')
def test_not_descendent(self, get_stable_branch_id): def test_not_descendent(self, get_full_branch_name):
get_stable_branch_id.configure_mock( get_full_branch_name.configure_mock(
return_value='meiji', return_value='stable/meiji',
) )
deliv = deliverable.Deliverable( deliv = deliverable.Deliverable(
team='team', team='team',