Merge pull request #5815 from daira/hotfix-versioning
Change the numbering convention for hotfixes
This commit is contained in:
commit
6ce896e878
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
@ -145,7 +145,9 @@ def verify_tags(releaseprev, releasefrom):
|
|||
|
||||
for tag in sh_out('git', 'tag', '--list').splitlines():
|
||||
if candidatergx.match(tag):
|
||||
candidates.append(Version.parse_arg(tag))
|
||||
v = Version.parse(tag)
|
||||
if v is not None:
|
||||
candidates.append(v)
|
||||
|
||||
candidates.sort()
|
||||
try:
|
||||
|
@ -196,9 +198,9 @@ 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,
|
||||
None
|
||||
)
|
||||
if release != expected:
|
||||
raise SystemExit(
|
||||
|
@ -226,7 +228,7 @@ def initialize_git(release, hotfix):
|
|||
),
|
||||
)
|
||||
|
||||
logging.info('Pulling to latest master.')
|
||||
logging.info('Ensuring we are up to date with the branch to be released...')
|
||||
sh_log('git', 'pull', '--ff-only')
|
||||
|
||||
branch = 'release-' + release.vtext
|
||||
|
@ -488,9 +490,24 @@ class Version (object):
|
|||
)
|
||||
|
||||
@staticmethod
|
||||
def parse_arg(text):
|
||||
def parse(text):
|
||||
m = Version.RGX.match(text)
|
||||
if m is None:
|
||||
return None
|
||||
else:
|
||||
[major, minor, patch, _, betarc, hyphen] = m.groups()
|
||||
return Version(
|
||||
int(major),
|
||||
int(minor),
|
||||
int(patch),
|
||||
betarc,
|
||||
int(hyphen) if hyphen is not None else None,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def parse_arg(text):
|
||||
v = Version.parse(text)
|
||||
if v is None:
|
||||
raise argparse.ArgumentTypeError(
|
||||
'Could not parse version {!r} against regex {}'.format(
|
||||
text,
|
||||
|
@ -498,39 +515,32 @@ class Version (object):
|
|||
),
|
||||
)
|
||||
else:
|
||||
[major, minor, patch, _, betarc, hotfix] = m.groups()
|
||||
return Version(
|
||||
int(major),
|
||||
int(minor),
|
||||
int(patch),
|
||||
betarc,
|
||||
int(hotfix) if hotfix is not None else None,
|
||||
)
|
||||
return v
|
||||
|
||||
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 +557,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 +589,7 @@ class Version (object):
|
|||
self.minor,
|
||||
self.patch,
|
||||
prio,
|
||||
self.hotfix,
|
||||
self.hyphen,
|
||||
)
|
||||
|
||||
def __lt__(self, other):
|
||||
|
@ -646,7 +656,8 @@ 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-foobar',
|
||||
'v1.2.3~0',
|
||||
'v1.2.3+0',
|
||||
'1.2.3',
|
||||
|
|
Loading…
Reference in New Issue