Skip to content

Commit 59cd733

Browse files
authored
Merge pull request #9 from jason-famedly/jason/update-poetry-lock
2 parents 5c4f8a9 + efcb28c commit 59cd733

150 files changed

Lines changed: 7582 additions & 1315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Re-usable workflow (https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows)
2+
name: Reusable Complement testing
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
use_latest_deps:
8+
type: boolean
9+
default: false
10+
use_twisted_trunk:
11+
type: boolean
12+
default: false
13+
14+
# Control the permissions granted to `GITHUB_TOKEN`.
15+
permissions:
16+
# `actions/checkout` reads the repository (also see
17+
# https://github.com/actions/checkout/tree/de0fac2e4500dabe0009e67214ff5f5447ce83dd/#recommended-permissions)
18+
contents: read
19+
20+
env:
21+
RUST_VERSION: 1.87.0
22+
23+
jobs:
24+
complement:
25+
runs-on: ubuntu-latest
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
include:
31+
- arrangement: monolith
32+
database: SQLite
33+
34+
- arrangement: monolith
35+
database: Postgres
36+
37+
- arrangement: workers
38+
database: Postgres
39+
40+
- arrangement: monolith
41+
database: Psycopg
42+
43+
- arrangement: workers
44+
database: Psycopg
45+
46+
steps:
47+
- name: Checkout synapse codebase
48+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
49+
with:
50+
path: synapse
51+
52+
# Log Docker system info for debugging (compare with your local environment) and
53+
# tracking GitHub runner changes over time (can easily compare a run from last
54+
# week with the current one in question).
55+
- run: docker system info
56+
shell: bash
57+
58+
- name: Install Rust
59+
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
60+
with:
61+
toolchain: ${{ env.RUST_VERSION }}
62+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
63+
64+
# We use `poetry` in `complement.sh`
65+
- uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
66+
with:
67+
poetry-version: "2.2.1"
68+
# Matches the `path` where we checkout Synapse above
69+
working-directory: "synapse"
70+
71+
- name: Prepare Complement's Prerequisites
72+
run: synapse/.ci/scripts/setup_complement_prerequisites.sh
73+
74+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
75+
with:
76+
cache-dependency-path: complement/go.sum
77+
go-version-file: complement/go.mod
78+
79+
# This step is specific to the 'Twisted trunk' test run:
80+
- name: Patch dependencies
81+
if: ${{ inputs.use_twisted_trunk }}
82+
run: |
83+
set -x
84+
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq python3 pipx
85+
pipx install poetry==2.2.1
86+
87+
poetry remove -n twisted
88+
poetry add -n --extras tls git+https://github.com/twisted/twisted.git#trunk
89+
poetry lock
90+
working-directory: synapse
91+
92+
# Run the image sanity check test first as this is the first thing we want to know
93+
# about (are we actually testing what we expect?) and we don't want to debug
94+
# downstream failures (wild goose chase).
95+
- name: Sanity check Complement image
96+
id: run_sanity_check_complement_image_test
97+
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
98+
# are underpowered and don't like running tons of Synapse instances at once.
99+
# -json: Output JSON format so that gotestfmt can parse it.
100+
#
101+
# tee /tmp/gotest-complement.log: We tee the output to a file so that we can re-process it
102+
# later on for better formatting with gotestfmt. But we still want the command
103+
# to output to the terminal as it runs so we can see what's happening in
104+
# real-time.
105+
run: |
106+
set -o pipefail
107+
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh --in-repo -p 1 -json -run 'TestSynapseVersion/Synapse_version_matches_current_git_checkout' 2>&1 | tee /tmp/gotest-sanity-check-complement.log
108+
shell: bash
109+
env:
110+
POSTGRES: ${{ (matrix.database == 'Postgres' || matrix.database == 'Psycopg') && matrix.database || '' }}
111+
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
112+
113+
- name: Formatted sanity check Complement test logs
114+
# Always run this step if we attempted to run the Complement tests.
115+
if: always() && steps.run_sanity_check_complement_image_test.outcome != 'skipped'
116+
# We do not hide successful tests in `gotestfmt` here as the list of sanity
117+
# check tests is so short. Feel free to change this when we get more tests.
118+
#
119+
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
120+
# it derives several values under `$settings` and passes them to our
121+
# custom `.ci/complement_package.gotpl` template to render the output.
122+
run: cat /tmp/gotest-sanity-check-complement.log | gotestfmt -hide "successful-downloads,empty-packages"
123+
124+
- name: Run Complement Tests
125+
id: run_complement_tests
126+
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
127+
# are underpowered and don't like running tons of Synapse instances at once.
128+
# -json: Output JSON format so that gotestfmt can parse it.
129+
#
130+
# tee /tmp/gotest-complement.log: We tee the output to a file so that we can re-process it
131+
# later on for better formatting with gotestfmt. But we still want the command
132+
# to output to the terminal as it runs so we can see what's happening in
133+
# real-time.
134+
run: |
135+
set -o pipefail
136+
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -p 1 -json 2>&1 | tee /tmp/gotest-complement.log
137+
shell: bash
138+
env:
139+
POSTGRES: ${{ (matrix.database == 'Postgres' || matrix.database == 'Psycopg') && matrix.database || '' }}
140+
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
141+
TEST_ONLY_IGNORE_POETRY_LOCKFILE: ${{ inputs.use_latest_deps && 1 || '' }}
142+
TEST_ONLY_SKIP_DEP_HASH_VERIFICATION: ${{ inputs.use_twisted_trunk && 1 || '' }}
143+
144+
- name: Formatted Complement test logs (only failing are shown)
145+
# Always run this step if we attempted to run the Complement tests.
146+
if: always() && steps.run_complement_tests.outcome != 'skipped'
147+
# Hide successful tests in order to reduce the verbosity of the otherwise very large output.
148+
#
149+
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
150+
# it derives several values under `$settings` and passes them to our
151+
# custom `.ci/complement_package.gotpl` template to render the output.
152+
run: cat /tmp/gotest-complement.log | gotestfmt -hide "successful-downloads,successful-tests,empty-packages"
153+
154+
- name: Run in-repo Complement Tests
155+
id: run_in_repo_complement_tests
156+
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
157+
# are underpowered and don't like running tons of Synapse instances at once.
158+
# -json: Output JSON format so that gotestfmt can parse it.
159+
#
160+
# tee /tmp/gotest-in-repo-complement.log: We tee the output to a file so that we can re-process it
161+
# later on for better formatting with gotestfmt. But we still want the command
162+
# to output to the terminal as it runs so we can see what's happening in
163+
# real-time.
164+
run: |
165+
set -o pipefail
166+
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh --in-repo -p 1 -json 2>&1 | tee /tmp/gotest-in-repo-complement.log
167+
shell: bash
168+
env:
169+
POSTGRES: ${{ (matrix.database == 'Postgres' || matrix.database == 'Psycopg') && matrix.database || '' }}
170+
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
171+
TEST_ONLY_IGNORE_POETRY_LOCKFILE: ${{ inputs.use_latest_deps && 1 || '' }}
172+
TEST_ONLY_SKIP_DEP_HASH_VERIFICATION: ${{ inputs.use_twisted_trunk && 1 || '' }}
173+
174+
- name: Formatted in-repo Complement test logs (only failing are shown)
175+
# Always run this step if we attempted to run the Complement tests.
176+
if: always() && steps.run_in_repo_complement_tests.outcome != 'skipped'
177+
# Hide successful tests in order to reduce the verbosity of the otherwise very large output.
178+
#
179+
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
180+
# it derives several values under `$settings` and passes them to our
181+
# custom `.ci/complement_package.gotpl` template to render the output.
182+
run: cat /tmp/gotest-in-repo-complement.log | gotestfmt -hide "successful-downloads,successful-tests,empty-packages"

.github/workflows/docker.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141
echo "SYNAPSE_VERSION=$(grep "^version" pyproject.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV
4242
4343
- name: Log in to DockerHub
44-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
44+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
4545
with:
4646
username: ${{ secrets.DOCKERHUB_USERNAME }}
4747
password: ${{ secrets.DOCKERHUB_TOKEN }}
4848

4949
- name: Log in to GHCR
50-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
50+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
5151
with:
5252
registry: ghcr.io
5353
username: ${{ github.repository_owner }}
@@ -79,7 +79,7 @@ jobs:
7979
services/backend-repositories/secret/data/oci.element.io password | OCI_PASSWORD ;
8080
8181
- name: Login to Element OCI Registry
82-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
82+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
8383
with:
8484
registry: oci-push.vpn.infra.element.io
8585
username: ${{ steps.import-secrets.outputs.OCI_USERNAME }}
@@ -136,14 +136,14 @@ jobs:
136136
merge-multiple: true
137137

138138
- name: Log in to DockerHub
139-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
139+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
140140
if: ${{ startsWith(matrix.repository, 'docker.io') }}
141141
with:
142142
username: ${{ secrets.DOCKERHUB_USERNAME }}
143143
password: ${{ secrets.DOCKERHUB_TOKEN }}
144144

145145
- name: Log in to GHCR
146-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
146+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
147147
if: ${{ startsWith(matrix.repository, 'ghcr.io') }}
148148
with:
149149
registry: ghcr.io
@@ -176,7 +176,7 @@ jobs:
176176
services/backend-repositories/secret/data/oci.element.io password | OCI_PASSWORD ;
177177
178178
- name: Login to Element OCI Registry
179-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
179+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
180180
with:
181181
registry: oci-push.vpn.infra.element.io
182182
username: ${{ steps.import-secrets.outputs.OCI_USERNAME }}
@@ -186,7 +186,7 @@ jobs:
186186
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
187187

188188
- name: Install Cosign
189-
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
189+
uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1
190190

191191
- name: Calculate docker image tag
192192
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0

.github/workflows/latest_deps.yml

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -181,84 +181,11 @@ jobs:
181181
/logs/**/*.log*
182182
183183
complement:
184+
uses: ./.github/workflows/complement_tests.yml
184185
needs: check_repo
185186
if: "!failure() && !cancelled() && needs.check_repo.outputs.should_run_workflow == 'true'"
186-
runs-on: ubuntu-latest
187-
188-
strategy:
189-
fail-fast: false
190-
matrix:
191-
include:
192-
- arrangement: monolith
193-
database: SQLite
194-
195-
- arrangement: monolith
196-
database: Postgres
197-
198-
- arrangement: workers
199-
database: Postgres
200-
201-
steps:
202-
- name: Check out synapse codebase
203-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
204-
with:
205-
path: synapse
206-
207-
- name: Prepare Complement's Prerequisites
208-
run: synapse/.ci/scripts/setup_complement_prerequisites.sh
209-
210-
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
211-
with:
212-
cache-dependency-path: complement/go.sum
213-
go-version-file: complement/go.mod
214-
215-
- name: Run Complement Tests
216-
id: run_complement_tests
217-
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
218-
# are underpowered and don't like running tons of Synapse instances at once.
219-
# -json: Output JSON format so that gotestfmt can parse it.
220-
#
221-
# tee /tmp/gotest-complement.log: We tee the output to a file so that we can re-process it
222-
# later on for better formatting with gotestfmt. But we still want the command
223-
# to output to the terminal as it runs so we can see what's happening in
224-
# real-time.
225-
run: |
226-
set -o pipefail
227-
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -p 1 -json 2>&1 | tee /tmp/gotest-complement.log
228-
shell: bash
229-
env:
230-
POSTGRES: ${{ (matrix.database == 'Postgres') && 1 || '' }}
231-
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
232-
TEST_ONLY_IGNORE_POETRY_LOCKFILE: 1
233-
234-
- name: Formatted Complement test logs
235-
# Always run this step if we attempted to run the Complement tests.
236-
if: always() && steps.run_complement_tests.outcome != 'skipped'
237-
run: cat /tmp/gotest-complement.log | gotestfmt -hide "successful-downloads,empty-packages"
238-
239-
- name: Run in-repo Complement Tests
240-
id: run_in_repo_complement_tests
241-
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
242-
# are underpowered and don't like running tons of Synapse instances at once.
243-
# -json: Output JSON format so that gotestfmt can parse it.
244-
#
245-
# tee /tmp/gotest-in-repo-complement.log: We tee the output to a file so that we can re-process it
246-
# later on for better formatting with gotestfmt. But we still want the command
247-
# to output to the terminal as it runs so we can see what's happening in
248-
# real-time.
249-
run: |
250-
set -o pipefail
251-
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh --in-repo -p 1 -json 2>&1 | tee /tmp/gotest-in-repo-complement.log
252-
shell: bash
253-
env:
254-
POSTGRES: ${{ (matrix.database == 'Postgres') && 1 || '' }}
255-
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
256-
TEST_ONLY_IGNORE_POETRY_LOCKFILE: 1
257-
258-
- name: Formatted in-repo Complement test logs
259-
# Always run this step if we attempted to run the Complement tests.
260-
if: always() && steps.run_in_repo_complement_tests.outcome != 'skipped'
261-
run: cat /tmp/gotest-in-repo-complement.log | gotestfmt -hide "successful-downloads,empty-packages"
187+
with:
188+
use_latest_deps: true
262189

263190
# Open an issue if the build fails, so we know about it.
264191
# Only do this if we're not experimenting with this action in a PR.

.github/workflows/push_complement_image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
poetry-version: "2.2.1"
5454
- name: Login to registry
55-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
55+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
5656
with:
5757
registry: ghcr.io
5858
username: ${{ github.actor }}

.github/workflows/release-artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
6565

6666
- name: Set up docker layer caching
67-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
67+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
6868
with:
6969
path: /tmp/.buildx-cache
7070
key: ${{ runner.os }}-buildx-${{ github.sha }}

0 commit comments

Comments
 (0)