Fix validator for tagless deliverables

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 accepted in the validator command.
Previously the validator was fixed for 'std' and 'std-with-versions'
branching typed deliverables, but missed the 'tagless' deliverables
case. This patch fixes this by accepting the new branch naming style,
stable/<release-id>, for tagless deliverables, too.

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

Change-Id: I6ba51454213e095e6b76e0813dab3ce44b1457ba
This commit is contained in:
Előd Illés 2023-02-27 17:07:44 +01:00
parent e083e30512
commit 32c9bc69eb
2 changed files with 26 additions and 1 deletions

View File

@ -1699,7 +1699,7 @@ def validate_stable_branches(deliv, context):
'or stable/<year>.<release_number> (for example: '
'stable/2023.1) or bugfix/%s' % (
branch.name, deliv.series, expected_version))
elif branch_mode == 'std':
elif branch_mode == 'std' or branch_mode == 'tagless':
# Looking for SLURP naming (e.g: 2023.1)
if not _is_branch_with_release_id(branch.name):
context.error(

View File

@ -2390,6 +2390,31 @@ class TestValidateStableBranches(base.BaseTestCase):
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
def test_tagless_stable_branch_type_with_release_id(self):
deliverable_data = textwrap.dedent('''
stable-branch-type: tagless
releases:
- version: 99.0.3
projects:
- repo: openstack/release-test
hash: 0cd17d1ee3b9284d36b2a0d370b49a6f0bbb9660
branches:
- name: stable/2022.2
location:
openstack/release-test: 0cd17d1ee3b9284d36b2a0d370b49a6f0bbb9660
repository-settings:
openstack/release-test: {}
''')
deliv = deliverable.Deliverable(
team='team',
series='antelope',
name='release-test',
data=yamlutils.loads(deliverable_data),
)
validate.validate_stable_branches(deliv, self.ctx)
self.assertEqual(0, len(self.ctx.warnings))
self.assertEqual(0, len(self.ctx.errors))
def test_tempest_plugin(self):
deliverable_data = textwrap.dedent('''
type: tempest-plugin