Merge "drop support for driverfixes branches"
This commit is contained in:
commit
a467622d66
@ -198,11 +198,7 @@ Prepare the branch request by submitting a patch to this repository.
|
||||
|
||||
``feature/`` -- for temporary feature branches
|
||||
|
||||
``driverfixes/`` -- for long-term driver maintenance, beyond the end of
|
||||
the stable branch
|
||||
|
||||
* ``stable/`` and ``driverfixes/`` branch names must match a valid series
|
||||
name.
|
||||
* ``stable/`` branch names must match a valid series name.
|
||||
|
||||
* If you are not the release liaison or PTL, have the PTL of the
|
||||
project acknowledge the request with a +1.
|
||||
@ -471,10 +467,6 @@ Each entry in the ``branches`` list is a mapping with keys:
|
||||
mapping between the target repository name and the SHA of a commit
|
||||
already in the target repository.
|
||||
|
||||
If a branch name starts with driverfixes/ then the location must be
|
||||
a mapping between the target repository name and the SHA of a commit
|
||||
already in the target repository on the associated stable branch.
|
||||
|
||||
|
||||
Examples
|
||||
========
|
||||
@ -517,41 +509,6 @@ and then for the subsequent release it would be updated to contain::
|
||||
This release includes the change to stop importing
|
||||
from the 'oslo' namespace package.
|
||||
|
||||
A driverfixes branch might be added to a project in a similar
|
||||
way. This example shows the branch created in cinder for the newton
|
||||
series. The branch was created from the HEAD of the stable/newton
|
||||
branch at the time.
|
||||
|
||||
::
|
||||
|
||||
---
|
||||
launchpad: cinder
|
||||
team: cinder
|
||||
type: service
|
||||
release-model: cycle-with-milestones
|
||||
release-notes: https://docs.openstack.org/releasenotes/cinder/newton.html
|
||||
branches:
|
||||
- name: stable/newton
|
||||
location: 9.0.0.0rc1
|
||||
- name: driverfixes/newton
|
||||
location:
|
||||
openstack/cinder: 08bfc7d817f313451e619b535299121b686d7bd8
|
||||
releases:
|
||||
# ...
|
||||
- version: 9.0.0.0rc1
|
||||
projects:
|
||||
- repo: openstack/cinder
|
||||
hash: 0ba267fbc1836722735102994b466ecd7803b10a
|
||||
- version: 9.0.0.0rc2
|
||||
projects:
|
||||
- repo: openstack/cinder
|
||||
hash: ab9518112137f3141739e873b19cdc0085963bc7
|
||||
# ...
|
||||
- version: 9.1.4
|
||||
projects:
|
||||
- repo: openstack/cinder
|
||||
hash: 908def6bb993798146cccc1621a9cee18950629d
|
||||
|
||||
For deliverables with multiple repositories, the list of projects
|
||||
would contain all of them. For example, the Neutron deliverable might
|
||||
be described by ``deliverables/mitaka/neutron.yaml`` containing:
|
||||
|
@ -78,7 +78,6 @@ _USES_PREVER = set([
|
||||
_VALID_BRANCH_PREFIXES = set([
|
||||
'stable',
|
||||
'feature',
|
||||
'driverfixes',
|
||||
])
|
||||
|
||||
_NO_STABLE_BRANCH_CHECK = set([
|
||||
@ -1541,67 +1540,6 @@ def validate_feature_branches(deliv, context):
|
||||
)
|
||||
|
||||
|
||||
def validate_driverfixes_branches(deliv, context):
|
||||
"Apply the rules for driverfixes branches."
|
||||
|
||||
if deliv.type == 'tempest-plugin' and deliv.branches:
|
||||
context.error('Tempest plugins do not support branching.')
|
||||
return
|
||||
|
||||
known_series = sorted(list(
|
||||
d for d in os.listdir('deliverables')
|
||||
if not d.startswith('_')
|
||||
))
|
||||
|
||||
for branch in deliv.branches:
|
||||
try:
|
||||
prefix, series = branch.name.split('/')
|
||||
except ValueError:
|
||||
context.error(
|
||||
('driverfixes branch name expected to be driverfixes/name '
|
||||
'but got %s') % (branch.name,))
|
||||
continue
|
||||
|
||||
if prefix != 'driverfixes':
|
||||
print('{} is not a driverfixes branch, skipping'.format(
|
||||
branch.name))
|
||||
continue
|
||||
|
||||
if series not in known_series:
|
||||
context.error(
|
||||
('driverfixes branches must be named for known series '
|
||||
'but %s was not found in %s' % (
|
||||
branch.name, known_series))
|
||||
)
|
||||
|
||||
location = branch.location
|
||||
if not isinstance(location, dict):
|
||||
context.error(
|
||||
('branch location for %s is '
|
||||
'expected to be a mapping but got a %s' % (
|
||||
branch.name, type(location)))
|
||||
)
|
||||
# The other rules aren't going to be testable, so skip them.
|
||||
continue
|
||||
|
||||
for repo, loc in sorted(location.items()):
|
||||
if not is_a_hash(loc):
|
||||
context.error(
|
||||
('driverfixes branches should be created from commits by '
|
||||
'SHA but location %s for branch %s of %s does not look '
|
||||
'like a SHA' % (
|
||||
(loc, repo, branch.name)))
|
||||
)
|
||||
if not gitutils.commit_exists(context.workdir, repo, loc):
|
||||
context.error(
|
||||
('driverfixes branches should be created from merged '
|
||||
'commits but location %s for branch %s of %s does not '
|
||||
'exist' % (
|
||||
(loc, repo, branch.name)))
|
||||
)
|
||||
_require_gitreview(repo, context)
|
||||
|
||||
|
||||
def validate_branch_points(deliv, context):
|
||||
"Make sure the branch points given are on the expected branches."
|
||||
|
||||
@ -1619,23 +1557,15 @@ def validate_branch_points(deliv, context):
|
||||
print('could not parse the branch name, skipping')
|
||||
continue
|
||||
|
||||
if prefix == 'feature':
|
||||
if prefix != 'stable':
|
||||
print('these rules do not apply to feature branches, skipping')
|
||||
continue
|
||||
|
||||
elif prefix == 'stable':
|
||||
expected = set([
|
||||
'master',
|
||||
branch.name,
|
||||
])
|
||||
|
||||
else:
|
||||
# driverfixes
|
||||
expected = set([
|
||||
branch.name,
|
||||
'stable/' + series,
|
||||
])
|
||||
|
||||
location = branch.get_repo_map()
|
||||
|
||||
for repo, hash in sorted(location.items()):
|
||||
@ -1850,7 +1780,6 @@ def main():
|
||||
validate_branch_prefixes,
|
||||
validate_stable_branches,
|
||||
validate_feature_branches,
|
||||
validate_driverfixes_branches,
|
||||
validate_branch_points,
|
||||
]
|
||||
for check in checks:
|
||||
|
@ -2383,175 +2383,6 @@ class TestValidateFeatureBranches(base.BaseTestCase):
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
|
||||
class TestValidateDriverfixesBranches(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.ctx = validate.ValidationContext()
|
||||
gitutils.clone_repo(self.ctx.workdir, 'openstack/automaton')
|
||||
|
||||
def test_unknown_series(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/abc
|
||||
location:
|
||||
openstack/automaton: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
def test_location_not_a_dict(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/austin
|
||||
location: 1.5.0
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
def test_location_not_a_sha(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/austin
|
||||
location:
|
||||
openstack/automaton: 1.5.0
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
def test_location_a_sha(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/austin
|
||||
location:
|
||||
openstack/automaton: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(0, len(self.ctx.errors))
|
||||
|
||||
def test_badly_formatted_name(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: austin
|
||||
location:
|
||||
openstack/automaton: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
def test_location_no_such_sha(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/austin
|
||||
location:
|
||||
openstack/automaton: de2885f544637e6ee6139df7dc7bf937925804dd
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
def test_tempest_plugin(self):
|
||||
deliverable_data = textwrap.dedent('''
|
||||
type: tempest-plugin
|
||||
releases:
|
||||
- version: 1.5.0
|
||||
projects:
|
||||
- repo: openstack/automaton
|
||||
hash: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
branches:
|
||||
- name: driverfixes/austin
|
||||
location:
|
||||
openstack/automaton: be2885f544637e6ee6139df7dc7bf937925804dd
|
||||
''')
|
||||
deliv = deliverable.Deliverable(
|
||||
team='team',
|
||||
series='ocata',
|
||||
name='release-test',
|
||||
data=yamlutils.loads(deliverable_data),
|
||||
)
|
||||
validate.validate_driverfixes_branches(deliv, self.ctx)
|
||||
self.ctx.show_summary()
|
||||
self.assertEqual(0, len(self.ctx.warnings))
|
||||
self.assertEqual(1, len(self.ctx.errors))
|
||||
|
||||
|
||||
class TestValidateSeriesOpen(base.BaseTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user