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 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:
First hotfix: v1.0.11 -> v1.0.11-1
Second hotfix: v1.0.11-1 -> v1.0.11-2
First hotfix: v1.0.0 -> v1.0.1
Second hotfix: v1.0.1 -> v1.0.2
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

View File

@ -14,15 +14,9 @@ is a common reason.)
### 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:
https://speed.z.cash
Ensure that new performance metrics appear on that site.
Check that there are no surprising performance regressions.
Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc.
@ -70,7 +64,7 @@ progress bar displayed during the build process.
## Release process
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
@ -82,8 +76,8 @@ changes to that branch locally:
Examples:
$ ./zcutil/make-release.py v1.0.9 v1.0.8-1 v1.0.8-1 120000
$ ./zcutil/make-release.py v1.0.13 v1.0.13-rc1 v1.0.12 222900
$ ./zcutil/make-release.py v1.1.0 v1.0.0 v1.0.0 120000
$ ./zcutil/make-release.py v1.1.0 v1.1.0-rc1 v1.0.0 222900
### 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.
**CAUTION:** Remember the `v` at the beginning here:
$ git tag -s v1.0.9
$ git push origin v1.0.9
$ git tag -s v1.1.0
$ git push origin v1.1.0
## Make and deploy deterministic builds

View File

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