Skip to content

Commit 37b3777

Browse files
committed
Merge branch 'develop' of github.com:element-hq/synapse into HEAD
2 parents cdb42f1 + 3878699 commit 37b3777

File tree

411 files changed

+32747
-9921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

411 files changed

+32747
-9921
lines changed

.ci/before_build_wheel.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
set -xeu
3+
4+
# On 32-bit Linux platforms, we need libatomic1 to use rustup
5+
if command -v yum &> /dev/null; then
6+
yum install -y libatomic
7+
fi
8+
9+
# Install a Rust toolchain
10+
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.82.0 -y --profile minimal

.ci/scripts/check_lockfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
try:
1313
lock_version = lockfile["metadata"]["lock-version"]
14-
assert lock_version == "2.0"
14+
assert lock_version == "2.1"
1515
except Exception:
1616
print(
1717
"""\
18-
Lockfile is not version 2.0. You probably need to upgrade poetry on your local box
19-
and re-run `poetry lock --no-update`. See the Poetry cheat sheet at
18+
Lockfile is not version 2.1. You probably need to upgrade poetry on your local box
19+
and re-run `poetry lock`. See the Poetry cheat sheet at
2020
https://element-hq.github.io/synapse/develop/development/dependencies.html
2121
"""
2222
)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
- End with either a period (.) or an exclamation mark (!).
1010
- Start with a capital letter.
1111
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
12-
* [ ] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct
13-
(run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
12+
* [ ] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

.github/workflows/docker.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ jobs:
1818
steps:
1919
- name: Set up QEMU
2020
id: qemu
21-
uses: docker/setup-qemu-action@v3
21+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
2222
with:
2323
platforms: arm64
2424

2525
- name: Set up Docker Buildx
2626
id: buildx
27-
uses: docker/setup-buildx-action@v3
27+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
2828

2929
- name: Inspect builder
3030
run: docker buildx inspect
3131

3232
- name: Install Cosign
33-
uses: sigstore/cosign-installer@v3.7.0
33+
uses: sigstore/cosign-installer@fb28c2b6339dcd94da6e4cbcbc5e888961f6f8c3 # v3.9.0
3434

3535
- name: Checkout repository
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737

3838
- name: Extract version from pyproject.toml
3939
# Note: explicitly requesting bash will mean bash is invoked with `-eo pipefail`, see
@@ -43,21 +43,21 @@ jobs:
4343
echo "SYNAPSE_VERSION=$(grep "^version" pyproject.toml | sed -E 's/version\s*=\s*["]([^"]*)["]/\1/')" >> $GITHUB_ENV
4444
4545
- name: Log in to DockerHub
46-
uses: docker/login-action@v3
46+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
4747
with:
4848
username: ${{ secrets.DOCKERHUB_USERNAME }}
4949
password: ${{ secrets.DOCKERHUB_TOKEN }}
5050

5151
- name: Log in to GHCR
52-
uses: docker/login-action@v3
52+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
5353
with:
5454
registry: ghcr.io
5555
username: ${{ github.repository_owner }}
5656
password: ${{ secrets.GITHUB_TOKEN }}
5757

5858
- name: Calculate docker image tag
5959
id: set-tag
60-
uses: docker/metadata-action@master
60+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
6161
with:
6262
images: |
6363
docker.io/matrixdotorg/synapse
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Build and push all platforms
7474
id: build-and-push
75-
uses: docker/build-push-action@v6
75+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
7676
with:
7777
push: true
7878
labels: |

.github/workflows/docs-pr-netlify.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
1515
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
1616
- name: 📥 Download artifact
17-
uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7
17+
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11
1818
with:
1919
workflow: docs-pr.yaml
2020
run_id: ${{ github.event.workflow_run.id }}
2121
name: book
2222
path: book
2323

2424
- name: 📤 Deploy to Netlify
25-
uses: matrix-org/netlify-pr-preview@v3
25+
uses: matrix-org/netlify-pr-preview@9805cd123fc9a7e421e35340a05e1ebc5dee46b5 # v3
2626
with:
2727
path: book
2828
owner: ${{ github.event.workflow_run.head_repository.owner.login }}

.github/workflows/docs-pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: GitHub Pages
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1717
with:
1818
# Fetch all history so that the schema_versions script works.
1919
fetch-depth: 0
@@ -24,7 +24,7 @@ jobs:
2424
mdbook-version: '0.4.17'
2525

2626
- name: Setup python
27-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2828
with:
2929
python-version: "3.x"
3030

@@ -39,7 +39,7 @@ jobs:
3939
cp book/welcome_and_overview.html book/index.html
4040
4141
- name: Upload Artifact
42-
uses: actions/upload-artifact@v4
42+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4343
with:
4444
name: book
4545
path: book
@@ -50,7 +50,7 @@ jobs:
5050
name: Check links in documentation
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5454

5555
- name: Setup mdbook
5656
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 # v2.0.0

.github/workflows/docs.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
needs:
5151
- pre
5252
steps:
53-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5454
with:
5555
# Fetch all history so that the schema_versions script works.
5656
fetch-depth: 0
@@ -64,7 +64,7 @@ jobs:
6464
run: echo 'window.SYNAPSE_VERSION = "${{ needs.pre.outputs.branch-version }}";' > ./docs/website_files/version.js
6565

6666
- name: Setup python
67-
uses: actions/setup-python@v5
67+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
6868
with:
6969
python-version: "3.x"
7070

@@ -78,6 +78,18 @@ jobs:
7878
mdbook build
7979
cp book/welcome_and_overview.html book/index.html
8080
81+
- name: Prepare and publish schema files
82+
run: |
83+
sudo apt-get update && sudo apt-get install -y yq
84+
mkdir -p book/schema
85+
# Remove developer notice before publishing.
86+
rm schema/v*/Do\ not\ edit\ files\ in\ this\ folder
87+
# Copy schema files that are independent from current Synapse version.
88+
cp -r -t book/schema schema/v*/
89+
# Convert config schema from YAML source file to JSON.
90+
yq < schema/synapse-config.schema.yaml \
91+
> book/schema/synapse-config.schema.json
92+
8193
# Deploy to the target directory.
8294
- name: Deploy to gh pages
8395
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0

.github/workflows/fix_lint.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,22 @@ jobs:
1313

1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1717

1818
- name: Install Rust
19-
uses: dtolnay/rust-toolchain@master
19+
uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 # master (rust 1.85.1)
2020
with:
2121
# We use nightly so that `fmt` correctly groups together imports, and
2222
# clippy correctly fixes up the benchmarks.
2323
toolchain: nightly-2022-12-01
24-
components: rustfmt
25-
- uses: Swatinem/rust-cache@v2
24+
components: clippy, rustfmt
25+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
2626

2727
- name: Setup Poetry
28-
uses: matrix-org/setup-python-poetry@v1
28+
uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
2929
with:
3030
install-project: "false"
31+
poetry-version: "2.1.1"
3132

3233
- name: Run ruff check
3334
continue-on-error: true
@@ -43,6 +44,6 @@ jobs:
4344
- run: cargo fmt
4445
continue-on-error: true
4546

46-
- uses: stefanzweifel/git-auto-commit-action@v5
47+
- uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
4748
with:
4849
commit_message: "Attempt to fix linting"

.github/workflows/latest_deps.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ jobs:
3939
if: needs.check_repo.outputs.should_run_workflow == 'true'
4040
runs-on: ubuntu-latest
4141
steps:
42-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4343
- name: Install Rust
44-
uses: dtolnay/rust-toolchain@stable
45-
- uses: Swatinem/rust-cache@v2
44+
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable (rust 1.85.1)
45+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
4646

4747
# The dev dependencies aren't exposed in the wheel metadata (at least with current
4848
# poetry-core versions), so we install with poetry.
49-
- uses: matrix-org/setup-python-poetry@v1
49+
- uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
5050
with:
5151
python-version: "3.x"
52-
poetry-version: "1.3.2"
52+
poetry-version: "2.1.1"
5353
extras: "all"
5454
# Dump installed versions for debugging.
5555
- run: poetry run pip list > before.txt
@@ -72,11 +72,11 @@ jobs:
7272
postgres-version: "14"
7373

7474
steps:
75-
- uses: actions/checkout@v4
75+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7676

7777
- name: Install Rust
78-
uses: dtolnay/rust-toolchain@stable
79-
- uses: Swatinem/rust-cache@v2
78+
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable (rust 1.85.1)
79+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
8080

8181
- run: sudo apt-get -qq install xmlsec1
8282
- name: Set up PostgreSQL ${{ matrix.postgres-version }}
@@ -86,7 +86,7 @@ jobs:
8686
-e POSTGRES_PASSWORD=postgres \
8787
-e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \
8888
postgres:${{ matrix.postgres-version }}
89-
- uses: actions/setup-python@v5
89+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
9090
with:
9191
python-version: "3.x"
9292
- run: pip install .[all,test]
@@ -145,11 +145,11 @@ jobs:
145145
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
146146

147147
steps:
148-
- uses: actions/checkout@v4
148+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
149149

150150
- name: Install Rust
151-
uses: dtolnay/rust-toolchain@stable
152-
- uses: Swatinem/rust-cache@v2
151+
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable (rust 1.85.1)
152+
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
153153

154154
- name: Ensure sytest runs `pip install`
155155
# Delete the lockfile so sytest will `pip install` rather than `poetry install`
@@ -164,7 +164,7 @@ jobs:
164164
if: ${{ always() }}
165165
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
166166
- name: Upload SyTest logs
167-
uses: actions/upload-artifact@v4
167+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
168168
if: ${{ always() }}
169169
with:
170170
name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }})
@@ -192,15 +192,15 @@ jobs:
192192
database: Postgres
193193

194194
steps:
195-
- name: Run actions/checkout@v4 for synapse
196-
uses: actions/checkout@v4
195+
- name: Check out synapse codebase
196+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
197197
with:
198198
path: synapse
199199

200200
- name: Prepare Complement's Prerequisites
201201
run: synapse/.ci/scripts/setup_complement_prerequisites.sh
202202

203-
- uses: actions/setup-go@v5
203+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
204204
with:
205205
cache-dependency-path: complement/go.sum
206206
go-version-file: complement/go.mod
@@ -225,7 +225,7 @@ jobs:
225225
runs-on: ubuntu-latest
226226

227227
steps:
228-
- uses: actions/checkout@v4
228+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
229229
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
230230
env:
231231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/poetry_lockfile.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
name: "Check locked dependencies have sdists"
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-python@v5
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2121
with:
2222
python-version: '3.x'
2323
- run: pip install tomli

0 commit comments

Comments
 (0)