Allow to blacklist some projects to declare branch independence
Change-Id: Ib48246721f56bc928c1d9b40ebc03fd0d3a24c37
This commit is contained in:
parent
106c879cb8
commit
97c8427760
@ -64,6 +64,9 @@ _VALID_BRANCH_PREFIXES = set([
|
||||
'feature',
|
||||
'driverfixes',
|
||||
])
|
||||
_NO_STABLE_BRANCH_CHECK = set([
|
||||
'gnocchi',
|
||||
])
|
||||
_PLEASE = ('It is too expensive to determine this value during '
|
||||
'the site build, please set it explicitly.')
|
||||
|
||||
@ -425,6 +428,9 @@ def validate_branch_prefixes(deliverable_info, mk_waring, mk_error):
|
||||
|
||||
def validate_stable_branches(deliverable_info, mk_warning, mk_error):
|
||||
"Apply the rules for stable branches."
|
||||
if ('launchpad' in deliverable_info and
|
||||
deliverable_info['launchpad'] in _NO_STABLE_BRANCH_CHECK):
|
||||
return
|
||||
branches = deliverable_info.get('branches', [])
|
||||
known_releases = list(
|
||||
r['version']
|
||||
|
@ -1051,6 +1051,29 @@ class TestValidateStableBranches(base.BaseTestCase):
|
||||
self.assertEqual(0, len(warnings))
|
||||
self.assertEqual(1, len(errors))
|
||||
|
||||
def test_can_have_independent_branches(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
launchpad: gnocchi
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: stable/abc
|
||||
location: 1.5.0
|
||||
''')
|
||||
warnings = []
|
||||
errors = []
|
||||
deliverable_info = yaml.safe_load(deliverable_data)
|
||||
validate.validate_stable_branches(
|
||||
deliverable_info,
|
||||
warnings.append,
|
||||
errors.append,
|
||||
)
|
||||
self.assertEqual(0, len(warnings))
|
||||
self.assertEqual(0, len(errors))
|
||||
|
||||
|
||||
class TestValidateFeatureBranches(base.BaseTestCase):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user