summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <89468146+nico-famedly@users.noreply.github.com>2022-01-20 13:04:58 +0000
committerGitHub <noreply@github.com>2022-01-20 13:04:58 +0000
commitfa583c2198c75583ed5e16e9ecd157a9d10f6417 (patch)
tree00978d8f5521a622ab494fa6a5ae71063ffa2f2a
parentFix a bug that corrupted the cache of federated space hierarchies (#11775) (diff)
downloadsynapse-fa583c2198c75583ed5e16e9ecd157a9d10f6417.tar.xz
Allow overriding the complement ref. (#11766)
Updates complement.sh to read the ref from an environment
variable (defaulting to master) when downloading a complement
bundle for testing.
-rw-r--r--.gitignore2
-rw-r--r--changelog.d/11766.misc1
-rwxr-xr-xscripts-dev/complement.sh14
3 files changed, 10 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 8eb4eda73d..3bd6b1a08c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,5 +52,5 @@ __pycache__/
 book/
 
 # complement
-/complement-master
+/complement-*
 /master.tar.gz
diff --git a/changelog.d/11766.misc b/changelog.d/11766.misc
new file mode 100644
index 0000000000..3c9e5f95ff
--- /dev/null
+++ b/changelog.d/11766.misc
@@ -0,0 +1 @@
+Allow overriding complement commit using `COMPLEMENT_REF`.
diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh
index 67a22d3ed3..e08ffedaf3 100755
--- a/scripts-dev/complement.sh
+++ b/scripts-dev/complement.sh
@@ -8,7 +8,8 @@
 # By default the script will fetch the latest Complement master branch and
 # run tests with that. This can be overridden to use a custom Complement
 # checkout by setting the COMPLEMENT_DIR environment variable to the
-# filepath of a local Complement checkout.
+# filepath of a local Complement checkout or by setting the COMPLEMENT_REF
+# environment variable to pull a different branch or commit.
 #
 # By default Synapse is run in monolith mode. This can be overridden by
 # setting the WORKERS environment variable.
@@ -31,11 +32,12 @@ cd "$(dirname $0)/.."
 
 # Check for a user-specified Complement checkout
 if [[ -z "$COMPLEMENT_DIR" ]]; then
-  echo "COMPLEMENT_DIR not set. Fetching the latest Complement checkout..."
-  wget -Nq https://github.com/matrix-org/complement/archive/master.tar.gz
-  tar -xzf master.tar.gz
-  COMPLEMENT_DIR=complement-master
-  echo "Checkout available at 'complement-master'"
+  COMPLEMENT_REF=${COMPLEMENT_REF:-master}
+  echo "COMPLEMENT_DIR not set. Fetching Complement checkout from ${COMPLEMENT_REF}..."
+  wget -Nq https://github.com/matrix-org/complement/archive/${COMPLEMENT_REF}.tar.gz
+  tar -xzf ${COMPLEMENT_REF}.tar.gz
+  COMPLEMENT_DIR=complement-${COMPLEMENT_REF}
+  echo "Checkout available at 'complement-${COMPLEMENT_REF}'"
 fi
 
 # Build the base Synapse image from the local checkout