Change the numbering convention for hotfixes to increment the patch number, not the hyphen number.

fixes #4364

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2022-04-04 17:42:39 +01:00 committed by Kris Nuttycombe
parent 862d19de84
commit 1b967fcae2
3 changed files with 34 additions and 41 deletions

View File

@ -1,14 +1,14 @@
Hotfix Release Process Hotfix Release Process
====================== ======================
Hotfix releases are versioned by incrementing the build number of the latest Hotfix releases are versioned by incrementing the patch number of the latest
release. For example: release. For example:
First hotfix: v1.0.11 -> v1.0.11-1 First hotfix: v1.0.0 -> v1.0.1
Second hotfix: v1.0.11-1 -> v1.0.11-2 Second hotfix: v1.0.1 -> v1.0.2
In the commands below, <RELEASE> and <RELEASE_PREV> are prefixed with a v, ie. In the commands below, <RELEASE> and <RELEASE_PREV> are prefixed with a v, ie.
v1.0.11 (not 1.0.11). v1.0.2 (not 1.0.2).
## Create a hotfix branch ## Create a hotfix branch

View File

@ -14,15 +14,9 @@ is a common reason.)
### Pre-release checklist: ### Pre-release checklist:
Check that dependencies are properly hosted by looking at the `check-depends` builder: Check that dependencies are properly hosted.
https://ci.z.cash/#/builders/1 Check that there are no surprising performance regressions.
Check that there are no surprising performance regressions:
https://speed.z.cash
Ensure that new performance metrics appear on that site.
Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc. Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc.
@ -70,7 +64,7 @@ progress bar displayed during the build process.
## Release process ## Release process
In the commands below, <RELEASE> and <RELEASE_PREV> are prefixed with a v, ie. In the commands below, <RELEASE> and <RELEASE_PREV> are prefixed with a v, ie.
v1.0.9 (not 1.0.9). v1.1.0 (not 1.1.0).
### Create the release branch ### Create the release branch
@ -82,8 +76,8 @@ changes to that branch locally:
Examples: Examples:
$ ./zcutil/make-release.py v1.0.9 v1.0.8-1 v1.0.8-1 120000 $ ./zcutil/make-release.py v1.1.0 v1.0.0 v1.0.0 120000
$ ./zcutil/make-release.py v1.0.13 v1.0.13-rc1 v1.0.12 222900 $ ./zcutil/make-release.py v1.1.0 v1.1.0-rc1 v1.0.0 222900
### Create, Review, and Merge the release branch pull request ### Create, Review, and Merge the release branch pull request
@ -121,8 +115,8 @@ Then create the git tag. The `-s` means the release tag will be signed.
Enter "Release <version>." and save when prompted for a commit message. Enter "Release <version>." and save when prompted for a commit message.
**CAUTION:** Remember the `v` at the beginning here: **CAUTION:** Remember the `v` at the beginning here:
$ git tag -s v1.0.9 $ git tag -s v1.1.0
$ git push origin v1.0.9 $ git push origin v1.1.0
## Make and deploy deterministic builds ## Make and deploy deterministic builds

View File

@ -55,7 +55,7 @@ def parse_args(args):
p.add_argument( p.add_argument(
'RELEASE_VERSION', 'RELEASE_VERSION',
type=Version.parse_arg, type=Version.parse_arg,
help='The release version: vX.Y.Z-N', help='The release version: vX.Y.Z',
) )
p.add_argument( p.add_argument(
'RELEASE_PREV', 'RELEASE_PREV',
@ -196,9 +196,8 @@ def verify_version(release, releaseprev, hotfix):
expected = Version( expected = Version(
releaseprev.major, releaseprev.major,
releaseprev.minor, releaseprev.minor,
releaseprev.patch, releaseprev.patch + 1,
releaseprev.betarc, releaseprev.betarc,
releaseprev.hotfix + 1 if releaseprev.hotfix else 1,
) )
if release != expected: if release != expected:
raise SystemExit( raise SystemExit(
@ -498,39 +497,39 @@ class Version (object):
), ),
) )
else: else:
[major, minor, patch, _, betarc, hotfix] = m.groups() [major, minor, patch, _, betarc, hyphen] = m.groups()
return Version( return Version(
int(major), int(major),
int(minor), int(minor),
int(patch), int(patch),
betarc, betarc,
int(hotfix) if hotfix is not None else None, int(hyphen) if hyphen is not None else None,
) )
def __init__(self, major, minor, patch, betarc, hotfix): def __init__(self, major, minor, patch, betarc, hyphen):
for i in [major, minor, patch]: for i in [major, minor, patch]:
assert type(i) is int, i assert type(i) is int, i
assert betarc in {None, 'rc', 'beta'}, betarc assert betarc in {None, 'rc', 'beta'}, betarc
assert hotfix is None or type(hotfix) is int, hotfix assert hyphen is None or type(hyphen) is int, hyphen
if betarc is not None: if betarc is not None:
assert hotfix is not None, (betarc, hotfix) assert hyphen is not None, (betarc, hyphen)
self.major = major self.major = major
self.minor = minor self.minor = minor
self.patch = patch self.patch = patch
self.betarc = betarc self.betarc = betarc
self.hotfix = hotfix self.hyphen = hyphen
if hotfix is None: if hyphen is None:
self.build = 50 self.build = 50
else: else:
assert hotfix > 0, hotfix assert hyphen > 0, hyphen
if betarc is None: if betarc is None:
assert hotfix < 50, hotfix assert hyphen < 50, hyphen
self.build = 50 + hotfix self.build = 50 + hyphen
else: else:
assert hotfix < 26, hotfix assert hyphen < 26, hyphen
self.build = {'beta': 0, 'rc': 25}[betarc] + hotfix - 1 self.build = {'beta': 0, 'rc': 25}[betarc] + hyphen - 1
@property @property
def novtext(self): def novtext(self):
@ -547,29 +546,29 @@ class Version (object):
def _novtext(self, debian): def _novtext(self, debian):
novtext = '{}.{}.{}'.format(self.major, self.minor, self.patch) novtext = '{}.{}.{}'.format(self.major, self.minor, self.patch)
if self.hotfix is None: if self.hyphen is None:
return novtext return novtext
else: else:
assert self.hotfix > 0, self.hotfix assert self.hyphen > 0, self.hyphen
if self.betarc is None: if self.betarc is None:
assert self.hotfix < 50, self.hotfix assert self.hyphen < 50, self.hyphen
sep = '+' if debian else '-' sep = '+' if debian else '-'
return '{}{}{}'.format(novtext, sep, self.hotfix) return '{}{}{}'.format(novtext, sep, self.hyphen)
else: else:
assert self.hotfix < 26, self.hotfix assert self.hyphen < 26, self.hyphen
sep = '~' if debian else '-' sep = '~' if debian else '-'
return '{}{}{}{}'.format( return '{}{}{}{}'.format(
novtext, novtext,
sep, sep,
self.betarc, self.betarc,
self.hotfix, self.hyphen,
) )
def __repr__(self): def __repr__(self):
return '<Version {}>'.format(self.vtext) return '<Version {}>'.format(self.vtext)
def _sort_tup(self): def _sort_tup(self):
if self.hotfix is None: if self.hyphen is None:
prio = 2 prio = 2
else: else:
prio = {'beta': 0, 'rc': 1, None: 3}[self.betarc] prio = {'beta': 0, 'rc': 1, None: 3}[self.betarc]
@ -579,7 +578,7 @@ class Version (object):
self.minor, self.minor,
self.patch, self.patch,
prio, prio,
self.hotfix, self.hyphen,
) )
def __lt__(self, other): def __lt__(self, other):
@ -646,7 +645,7 @@ class TestVersion (unittest.TestCase):
cases = [ cases = [
'v07.0.0', 'v07.0.0',
'v1.0.03', 'v1.0.03',
'v1.2.3-0', # Hotfix numbers must begin w/ 1 'v1.2.3-0',
'v1.2.3~0', 'v1.2.3~0',
'v1.2.3+0', 'v1.2.3+0',
'1.2.3', '1.2.3',