Test bugfix branching with release-test
This does a new release with release-test to see if everything is covered to allow branches to have a bugfix/* prefix. Change-Id: I7869cf412524d7352249f02f7449b2fddf401d2c Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
@@ -25,6 +25,10 @@ releases:
|
|||||||
projects:
|
projects:
|
||||||
- repo: openstack/release-test
|
- repo: openstack/release-test
|
||||||
hash: 371d36be8f6c72900fd99fcba3b4e1aad0c8eb4e
|
hash: 371d36be8f6c72900fd99fcba3b4e1aad0c8eb4e
|
||||||
|
- version: 3.2.0
|
||||||
|
projects:
|
||||||
|
- repo: openstack/release-test
|
||||||
|
hash: 371d36be8f6c72900fd99fcba3b4e1aad0c8eb4e
|
||||||
branches:
|
branches:
|
||||||
- name: stable/3.1
|
- name: bugfix/3.2
|
||||||
location: 3.1.0
|
location: 3.2.0
|
||||||
|
@@ -415,7 +415,7 @@ The top level of a deliverable file is a mapping with keys:
|
|||||||
addition that version-based branches can be created as well.
|
addition that version-based branches can be created as well.
|
||||||
|
|
||||||
These version-based branches are shorter term stable branches that
|
These version-based branches are shorter term stable branches that
|
||||||
are named for the major and minor version number (e.g. stable/3.1).
|
are named for the major and minor version number (e.g. bugfix/3.1).
|
||||||
This is primarily used for Ironic releases.
|
This is primarily used for Ironic releases.
|
||||||
|
|
||||||
``tagless``
|
``tagless``
|
||||||
|
@@ -79,6 +79,7 @@ _USES_PREVER = set([
|
|||||||
_VALID_BRANCH_PREFIXES = set([
|
_VALID_BRANCH_PREFIXES = set([
|
||||||
'stable',
|
'stable',
|
||||||
'feature',
|
'feature',
|
||||||
|
'bugfix',
|
||||||
])
|
])
|
||||||
|
|
||||||
_NO_STABLE_BRANCH_CHECK = set([
|
_NO_STABLE_BRANCH_CHECK = set([
|
||||||
@@ -1505,8 +1506,8 @@ def validate_stable_branches(deliv, context):
|
|||||||
('stable branch name expected to be stable/name '
|
('stable branch name expected to be stable/name '
|
||||||
'but got %s') % (branch.name,))
|
'but got %s') % (branch.name,))
|
||||||
continue
|
continue
|
||||||
if prefix != 'stable':
|
if prefix != 'stable' and prefix != 'bugfix':
|
||||||
print('{} is not a stable branch, skipping'.format(
|
print('{} is not a stable or bugfix branch, skipping'.format(
|
||||||
branch.name))
|
branch.name))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -1529,9 +1530,10 @@ def validate_stable_branches(deliv, context):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
branch_exists = all(
|
branch_exists = all(
|
||||||
gitutils.stable_branch_exists(
|
gitutils.branch_exists(
|
||||||
context.workdir,
|
context.workdir,
|
||||||
repo,
|
repo,
|
||||||
|
prefix,
|
||||||
series,
|
series,
|
||||||
)
|
)
|
||||||
for repo in deliv.known_repo_names if
|
for repo in deliv.known_repo_names if
|
||||||
@@ -1542,9 +1544,10 @@ def validate_stable_branches(deliv, context):
|
|||||||
branch.name))
|
branch.name))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if deliv.is_independent:
|
if deliv.is_independent or prefix == 'bugfix':
|
||||||
print('"latest release" rule does not apply '
|
print('"latest release" rule does not apply '
|
||||||
'to independent repositories, skipping')
|
'to independent repositories or bugfix '
|
||||||
|
'branches, skipping')
|
||||||
else:
|
else:
|
||||||
latest_release = deliv.releases[-1]
|
latest_release = deliv.releases[-1]
|
||||||
if location != latest_release.version:
|
if location != latest_release.version:
|
||||||
@@ -1614,15 +1617,15 @@ def validate_stable_branches(deliv, context):
|
|||||||
else:
|
else:
|
||||||
if series != deliv.series:
|
if series != deliv.series:
|
||||||
if branch_mode == 'std-with-versions':
|
if branch_mode == 'std-with-versions':
|
||||||
# Not a normal stable branch, so it must be a version
|
# Not a normal stable branch, so it must be a versioned
|
||||||
# branch (stable/3.1)
|
# bugfix branch (bugfix/3.1)
|
||||||
expected_version = '.'.join(location.split('.')[0:2])
|
expected_version = '.'.join(location.split('.')[0:2])
|
||||||
if series != expected_version:
|
if series != expected_version:
|
||||||
context.error(
|
context.error(
|
||||||
'cycle-based projects must match series names '
|
'cycle-based projects must match series names '
|
||||||
'for stable branches, or branch based on version '
|
'for stable branches, or branch based on version '
|
||||||
'for short term support. %s should be stable/%s '
|
'for short term support. %s should be stable/%s '
|
||||||
'or stable/%s' % (
|
'or bugfix/%s' % (
|
||||||
branch.name, deliv.series, expected_version))
|
branch.name, deliv.series, expected_version))
|
||||||
else:
|
else:
|
||||||
context.error(
|
context.error(
|
||||||
|
@@ -204,9 +204,16 @@ def _filter_branches(output):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def stable_branch_exists(workdir, repo, series):
|
def branch_exists(workdir, repo, prefix, identifier):
|
||||||
"Does the stable/series branch exist?"
|
"""Does the prefix/identifier branch exist.
|
||||||
remote_match = 'remotes/origin/stable/%s' % series
|
|
||||||
|
Checks if a named branch already exists.
|
||||||
|
:param workdir: The working directory for the local clone.
|
||||||
|
:param repo: The name of the repo.
|
||||||
|
:param prefix: The branch prefix (e.g. "stable" or "bugfix").
|
||||||
|
:param idenifier: The branch identifier (series name or version).
|
||||||
|
"""
|
||||||
|
remote_match = 'remotes/origin/{}/{}'.format(prefix, identifier)
|
||||||
try:
|
try:
|
||||||
containing_branches = _filter_branches(
|
containing_branches = _filter_branches(
|
||||||
processutils.check_output(
|
processutils.check_output(
|
||||||
@@ -222,6 +229,11 @@ def stable_branch_exists(workdir, repo, series):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def stable_branch_exists(workdir, repo, series):
|
||||||
|
"Does the stable/series branch exist?"
|
||||||
|
return branch_exists(workdir, repo, 'stable', series)
|
||||||
|
|
||||||
|
|
||||||
def check_branch_sha(workdir, repo, series, sha):
|
def check_branch_sha(workdir, repo, series, sha):
|
||||||
"""Check if the SHA is in the targeted branch.
|
"""Check if the SHA is in the targeted branch.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user