diff --git a/scripts-dev/build_debian_packages b/scripts-dev/build_debian_packages
index 546724f89f..e25c5bb265 100755
--- a/scripts-dev/build_debian_packages
+++ b/scripts-dev/build_debian_packages
@@ -10,6 +10,7 @@
# can be passed on the commandline for debugging.
import argparse
+import json
import os
import signal
import subprocess
@@ -34,6 +35,8 @@ By default, builds for all known distributions, but a list of distributions
can be passed on the commandline for debugging.
"""
+projdir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+
class Builder(object):
def __init__(self, redirect_stdout=False):
@@ -57,9 +60,6 @@ class Builder(object):
raise
def _inner_build(self, dist, skip_tests=False):
- projdir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
- os.chdir(projdir)
-
tag = dist.split(":", 1)[1]
# Make the dir where the debs will live.
@@ -93,6 +93,7 @@ class Builder(object):
],
stdout=stdout,
stderr=subprocess.STDOUT,
+ cwd=projdir,
)
container_name = "synapse_build_" + tag
@@ -180,10 +181,18 @@ if __name__ == "__main__":
help="skip running tests after building",
)
parser.add_argument(
+ "--show-dists-json",
+ action="store_true",
+ help="instead of building the packages, just list the dists to build for, as a json array",
+ )
+ parser.add_argument(
"dist",
nargs="*",
default=DISTS,
help="a list of distributions to build for. Default: %(default)s",
)
args = parser.parse_args()
- run_builds(dists=args.dist, jobs=args.jobs, skip_tests=args.no_check)
+ if args.show_dists_json:
+ print(json.dumps(DISTS))
+ else:
+ run_builds(dists=args.dist, jobs=args.jobs, skip_tests=args.no_check)
diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh
index ba060104c3..aca32edc17 100755
--- a/scripts-dev/complement.sh
+++ b/scripts-dev/complement.sh
@@ -65,4 +65,4 @@ if [[ -n "$1" ]]; then
fi
# Run the tests!
-go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
+go test -v -tags synapse_blacklist,msc2946,msc3083,msc2716,msc2403 -count=1 $EXTRA_COMPLEMENT_ARGS ./tests
diff --git a/scripts-dev/release.py b/scripts-dev/release.py
index fc3df9071c..5bfaa4ad2f 100755
--- a/scripts-dev/release.py
+++ b/scripts-dev/release.py
@@ -83,12 +83,6 @@ def run():
if current_version.pre:
# If the current version is an RC we don't need to bump any of the
# version numbers (other than the RC number).
- base_version = "{}.{}.{}".format(
- current_version.major,
- current_version.minor,
- current_version.micro,
- )
-
if rc:
new_version = "{}.{}.{}rc{}".format(
current_version.major,
@@ -97,49 +91,57 @@ def run():
current_version.pre[1] + 1,
)
else:
- new_version = base_version
+ new_version = "{}.{}.{}".format(
+ current_version.major,
+ current_version.minor,
+ current_version.micro,
+ )
else:
- # If this is a new release cycle then we need to know if its a major
- # version bump or a hotfix.
+ # If this is a new release cycle then we need to know if it's a minor
+ # or a patch version bump.
release_type = click.prompt(
"Release type",
- type=click.Choice(("major", "hotfix")),
+ type=click.Choice(("minor", "patch")),
show_choices=True,
- default="major",
+ default="minor",
)
- if release_type == "major":
- base_version = new_version = "{}.{}.{}".format(
- current_version.major,
- current_version.minor + 1,
- 0,
- )
+ if release_type == "minor":
if rc:
new_version = "{}.{}.{}rc1".format(
current_version.major,
current_version.minor + 1,
0,
)
-
+ else:
+ new_version = "{}.{}.{}".format(
+ current_version.major,
+ current_version.minor + 1,
+ 0,
+ )
else:
- base_version = new_version = "{}.{}.{}".format(
- current_version.major,
- current_version.minor,
- current_version.micro + 1,
- )
if rc:
new_version = "{}.{}.{}rc1".format(
current_version.major,
current_version.minor,
current_version.micro + 1,
)
+ else:
+ new_version = "{}.{}.{}".format(
+ current_version.major,
+ current_version.minor,
+ current_version.micro + 1,
+ )
# Confirm the calculated version is OK.
if not click.confirm(f"Create new version: {new_version}?", default=True):
click.get_current_context().abort()
# Switch to the release branch.
- release_branch_name = f"release-v{current_version.major}.{current_version.minor}"
+ parsed_new_version = version.parse(new_version)
+ release_branch_name = (
+ f"release-v{parsed_new_version.major}.{parsed_new_version.minor}"
+ )
release_branch = find_ref(repo, release_branch_name)
if release_branch:
if release_branch.is_remote():
@@ -153,7 +155,7 @@ def run():
# release type.
if current_version.is_prerelease:
default = release_branch_name
- elif release_type == "major":
+ elif release_type == "minor":
default = "develop"
else:
default = "master"
|