diff --git a/deliverables/victoria/release-test.yaml b/deliverables/victoria/release-test.yaml index b55e0a4b45..195ffd225b 100644 --- a/deliverables/victoria/release-test.yaml +++ b/deliverables/victoria/release-test.yaml @@ -25,6 +25,10 @@ releases: projects: - repo: openstack/release-test hash: 371d36be8f6c72900fd99fcba3b4e1aad0c8eb4e + - version: 3.2.0 + projects: + - repo: openstack/release-test + hash: 371d36be8f6c72900fd99fcba3b4e1aad0c8eb4e branches: - - name: stable/3.1 - location: 3.1.0 + - name: bugfix/3.2 + location: 3.2.0 diff --git a/doc/source/reference/using.rst b/doc/source/reference/using.rst index 347b85138e..621f413647 100644 --- a/doc/source/reference/using.rst +++ b/doc/source/reference/using.rst @@ -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. 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. ``tagless`` diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index 1b66bfceac..8430a894d9 100644 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -79,6 +79,7 @@ _USES_PREVER = set([ _VALID_BRANCH_PREFIXES = set([ 'stable', 'feature', + 'bugfix', ]) _NO_STABLE_BRANCH_CHECK = set([ @@ -1505,8 +1506,8 @@ def validate_stable_branches(deliv, context): ('stable branch name expected to be stable/name ' 'but got %s') % (branch.name,)) continue - if prefix != 'stable': - print('{} is not a stable branch, skipping'.format( + if prefix != 'stable' and prefix != 'bugfix': + print('{} is not a stable or bugfix branch, skipping'.format( branch.name)) continue @@ -1529,9 +1530,10 @@ def validate_stable_branches(deliv, context): ) return branch_exists = all( - gitutils.stable_branch_exists( + gitutils.branch_exists( context.workdir, repo, + prefix, series, ) for repo in deliv.known_repo_names if @@ -1542,9 +1544,10 @@ def validate_stable_branches(deliv, context): branch.name)) continue - if deliv.is_independent: + if deliv.is_independent or prefix == 'bugfix': print('"latest release" rule does not apply ' - 'to independent repositories, skipping') + 'to independent repositories or bugfix ' + 'branches, skipping') else: latest_release = deliv.releases[-1] if location != latest_release.version: @@ -1614,15 +1617,15 @@ def validate_stable_branches(deliv, context): else: if series != deliv.series: if branch_mode == 'std-with-versions': - # Not a normal stable branch, so it must be a version - # branch (stable/3.1) + # Not a normal stable branch, so it must be a versioned + # bugfix branch (bugfix/3.1) expected_version = '.'.join(location.split('.')[0:2]) if series != expected_version: context.error( 'cycle-based projects must match series names ' 'for stable branches, or branch based on version ' 'for short term support. %s should be stable/%s ' - 'or stable/%s' % ( + 'or bugfix/%s' % ( branch.name, deliv.series, expected_version)) else: context.error( diff --git a/openstack_releases/gitutils.py b/openstack_releases/gitutils.py index 0c23b28947..db395896c4 100644 --- a/openstack_releases/gitutils.py +++ b/openstack_releases/gitutils.py @@ -204,9 +204,16 @@ def _filter_branches(output): ] -def stable_branch_exists(workdir, repo, series): - "Does the stable/series branch exist?" - remote_match = 'remotes/origin/stable/%s' % series +def branch_exists(workdir, repo, prefix, identifier): + """Does the prefix/identifier branch exist. + + 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: containing_branches = _filter_branches( processutils.check_output( @@ -222,6 +229,11 @@ def stable_branch_exists(workdir, repo, series): 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): """Check if the SHA is in the targeted branch.