Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit bbd5923

Browse files
committed
Merge tag 'v1.74.0rc1' into rei/uvloop
Synapse 1.74.0rc1 (2022-12-13) ============================== Features -------- - Improve user search for international display names. ([\#14464](#14464)) - Stop using deprecated `keyIds` parameter when calling `/_matrix/key/v2/server`. ([\#14490](#14490), [\#14525](#14525)) - Add new `push.enabled` config option to allow opting out of push notification calculation. ([\#14551](#14551), [\#14619](#14619)) - Advertise support for Matrix 1.5 on `/_matrix/client/versions`. ([\#14576](#14576)) - Improve opentracing and logging for to-device message handling. ([\#14598](#14598)) - Allow selecting "prejoin" events by state keys in addition to event types. ([\#14642](#14642)) Bugfixes -------- - Fix a long-standing bug where a device list update might not be sent to clients in certain circumstances. ([\#14435](#14435), [\#14592](#14592), [\#14604](#14604)) - Suppress a spurious warning when `POST /rooms/<room_id>/<membership>/`, `POST /join/<room_id_or_alias`, or the unspecced `PUT /join/<room_id_or_alias>/<txn_id>` receive an empty HTTP request body. ([\#14600](#14600)) - Return spec-compliant JSON errors when unknown endpoints are requested. ([\#14620](#14620), [\#14621](#14621)) - Update html templates to load images over HTTPS. Contributed by @ashfame. ([\#14625](#14625)) - Fix a long-standing bug where the user directory would return 1 more row than requested. ([\#14631](#14631)) - Reject invalid read receipt requests with empty room or event IDs. Contributed by Nick @ Beeper (@Fizzadar). ([\#14632](#14632)) - Fix a bug introduced in Synapse 1.67.0 where not specifying a config file or a server URL would lead to the `register_new_matrix_user` script failing. ([\#14637](#14637)) - Fix a long-standing bug where the user directory and room/user stats might be out of sync. ([\#14639](#14639), [\#14643](#14643)) - Fix a bug introduced in Synapse 1.72.0 where the background updates to add non-thread unique indexes on receipts would fail if they were previously interrupted. ([\#14650](#14650)) - Improve validation of field size limits in events. ([\#14664](#14664)) - Fix bugs introduced in Synapse 1.55.0 and 1.69.0 where application services would not be notified of events in the correct rooms, due to stale caches. ([\#14670](#14670)) Improved Documentation ---------------------- - Update worker settings for `pusher` and `federation_sender` functionality. ([\#14493](#14493)) - Add links to third party package repositories, and point to the bug which highlights Ubuntu's out-of-date packages. ([\#14517](#14517)) - Remove old, incorrect minimum postgres version note and replace with a link to the [Dependency Deprecation Policy](https://matrix-org.github.io/synapse/v1.73/deprecation_policy.html). ([\#14590](#14590)) - Add Single-Sign On setup instructions for Mastodon-based instances. ([\#14594](#14594)) - Change `turn_allow_guests` example value to lowercase `true`. ([\#14634](#14634)) Internal Changes ---------------- - Optimise push badge count calculations. Contributed by Nick @ Beeper (@Fizzadar). ([\#14255](#14255)) - Faster remote room joins: stream the un-partial-stating of rooms over replication. ([\#14473](#14473), [\#14474](#14474)) - Share the `ClientRestResource` for both workers and the main process. ([\#14528](#14528)) - Add `--editable` flag to `complement.sh` which uses an editable install of Synapse for faster turn-around times whilst developing iteratively. ([\#14548](#14548)) - Faster joins: use servers list approximation to send read receipts when in partial state instead of waiting for the full state of the room. ([\#14549](#14549)) - Modernize unit tests configuration related to workers. ([\#14568](#14568)) - Bump jsonschema from 4.17.0 to 4.17.3. ([\#14591](#14591)) - Fix Rust lint CI. ([\#14602](#14602)) - Bump JasonEtco/create-an-issue from 2.5.0 to 2.8.1. ([\#14607](#14607)) - Alter some unit test environment parameters to decrease time spent running tests. ([\#14610](#14610)) - Switch to Go recommended installation method for `gotestfmt` template in CI. ([\#14611](#14611)) - Bump phonenumbers from 8.13.0 to 8.13.1. ([\#14612](#14612)) - Bump types-setuptools from 65.5.0.3 to 65.6.0.1. ([\#14613](#14613)) - Bump twine from 4.0.1 to 4.0.2. ([\#14614](#14614)) - Bump types-requests from 2.28.11.2 to 2.28.11.5. ([\#14615](#14615)) - Bump cryptography from 38.0.3 to 38.0.4. ([\#14616](#14616)) - Remove useless cargo install with apt from Dockerfile. ([\#14636](#14636)) - Bump certifi from 2021.10.8 to 2022.12.7. ([\#14645](#14645)) - Bump flake8-bugbear from 22.10.27 to 22.12.6. ([\#14656](#14656)) - Bump packaging from 21.3 to 22.0. ([\#14657](#14657)) - Bump types-pillow from 9.3.0.1 to 9.3.0.4. ([\#14658](#14658)) - Bump serde from 1.0.148 to 1.0.150. ([\#14659](#14659)) - Bump phonenumbers from 8.13.1 to 8.13.2. ([\#14660](#14660)) - Bump authlib from 1.1.0 to 1.2.0. ([\#14661](#14661)) - Move `StateFilter` to `synapse.types`. ([\#14668](#14668)) - Improve type hints. ([\#14597](#14597), [\#14646](#14646), [\#14671](#14671))
2 parents 8de5c59 + e70f398 commit bbd5923

File tree

480 files changed

+19816
-9216
lines changed

Some content is hidden

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

480 files changed

+19816
-9216
lines changed

.ci/scripts/auditwheel_wrapper.py

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/usr/bin/env python
2+
# Copyright 2022 The Matrix.org Foundation C.I.C.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Wraps `auditwheel repair` to first check if we're repairing a potentially abi3
17+
# compatible wheel, if so rename the wheel before repairing it.
18+
19+
import argparse
20+
import os
21+
import subprocess
22+
from typing import Optional
23+
from zipfile import ZipFile
24+
25+
from packaging.tags import Tag
26+
from packaging.utils import parse_wheel_filename
27+
from packaging.version import Version
28+
29+
30+
def check_is_abi3_compatible(wheel_file: str) -> None:
31+
"""Check the contents of the built wheel for any `.so` files that are *not*
32+
abi3 compatible.
33+
"""
34+
35+
with ZipFile(wheel_file, "r") as wheel:
36+
for file in wheel.namelist():
37+
if not file.endswith(".so"):
38+
continue
39+
40+
if not file.endswith(".abi3.so"):
41+
raise Exception(f"Found non-abi3 lib: {file}")
42+
43+
44+
def cpython(wheel_file: str, name: str, version: Version, tag: Tag) -> str:
45+
"""Replaces the cpython wheel file with a ABI3 compatible wheel"""
46+
47+
if tag.abi == "abi3":
48+
# Nothing to do.
49+
return wheel_file
50+
51+
check_is_abi3_compatible(wheel_file)
52+
53+
abi3_tag = Tag(tag.interpreter, "abi3", tag.platform)
54+
55+
dirname = os.path.dirname(wheel_file)
56+
new_wheel_file = os.path.join(
57+
dirname,
58+
f"{name}-{version}-{abi3_tag}.whl",
59+
)
60+
61+
os.rename(wheel_file, new_wheel_file)
62+
63+
print("Renamed wheel to", new_wheel_file)
64+
65+
return new_wheel_file
66+
67+
68+
def main(wheel_file: str, dest_dir: str, archs: Optional[str]) -> None:
69+
"""Entry point"""
70+
71+
# Parse the wheel file name into its parts. Note that `parse_wheel_filename`
72+
# normalizes the package name (i.e. it converts matrix_synapse ->
73+
# matrix-synapse), which is not what we want.
74+
_, version, build, tags = parse_wheel_filename(os.path.basename(wheel_file))
75+
name = os.path.basename(wheel_file).split("-")[0]
76+
77+
if len(tags) != 1:
78+
# We expect only a wheel file with only a single tag
79+
raise Exception(f"Unexpectedly found multiple tags: {tags}")
80+
81+
tag = next(iter(tags))
82+
83+
if build:
84+
# We don't use build tags in Synapse
85+
raise Exception(f"Unexpected build tag: {build}")
86+
87+
# If the wheel is for cpython then convert it into an abi3 wheel.
88+
if tag.interpreter.startswith("cp"):
89+
wheel_file = cpython(wheel_file, name, version, tag)
90+
91+
# Finally, repair the wheel.
92+
if archs is not None:
93+
# If we are given archs then we are on macos and need to use
94+
# `delocate-listdeps`.
95+
subprocess.run(["delocate-listdeps", wheel_file], check=True)
96+
subprocess.run(
97+
["delocate-wheel", "--require-archs", archs, "-w", dest_dir, wheel_file],
98+
check=True,
99+
)
100+
else:
101+
subprocess.run(["auditwheel", "repair", "-w", dest_dir, wheel_file], check=True)
102+
103+
104+
if __name__ == "__main__":
105+
parser = argparse.ArgumentParser(description="Tag wheel as abi3 and repair it.")
106+
107+
parser.add_argument(
108+
"--wheel-dir",
109+
"-w",
110+
metavar="WHEEL_DIR",
111+
help="Directory to store delocated wheels",
112+
required=True,
113+
)
114+
115+
parser.add_argument(
116+
"--require-archs",
117+
metavar="archs",
118+
default=None,
119+
)
120+
121+
parser.add_argument(
122+
"wheel_file",
123+
metavar="WHEEL_FILE",
124+
)
125+
126+
args = parser.parse_args()
127+
128+
wheel_file = args.wheel_file
129+
wheel_dir = args.wheel_dir
130+
archs = args.require_archs
131+
132+
main(wheel_file, wheel_dir, archs)

.ci/scripts/calculate_jobs.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
import json
1919
import os
2020

21+
22+
def set_output(key: str, value: str):
23+
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
24+
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
25+
print(f"{key}={value}", file=f)
26+
27+
2128
IS_PR = os.environ["GITHUB_REF"].startswith("refs/pull/")
2229

2330
# First calculate the various trial jobs.
@@ -39,25 +46,25 @@
3946
"database": "sqlite",
4047
"extras": "all",
4148
}
42-
for version in ("3.8", "3.9", "3.10")
49+
for version in ("3.8", "3.9", "3.10", "3.11")
4350
)
4451

4552

4653
trial_postgres_tests = [
4754
{
4855
"python-version": "3.7",
4956
"database": "postgres",
50-
"postgres-version": "10",
57+
"postgres-version": "11",
5158
"extras": "all",
5259
}
5360
]
5461

5562
if not IS_PR:
5663
trial_postgres_tests.append(
5764
{
58-
"python-version": "3.10",
65+
"python-version": "3.11",
5966
"database": "postgres",
60-
"postgres-version": "14",
67+
"postgres-version": "15",
6168
"extras": "all",
6269
}
6370
)
@@ -81,7 +88,7 @@
8188
test_matrix = json.dumps(
8289
trial_sqlite_tests + trial_postgres_tests + trial_no_extra_tests
8390
)
84-
print(f"::set-output name=trial_test_matrix::{test_matrix}")
91+
set_output("trial_test_matrix", test_matrix)
8592

8693

8794
# First calculate the various sytest jobs.
@@ -125,4 +132,4 @@
125132
print("::endgroup::")
126133

127134
test_matrix = json.dumps(sytest_tests)
128-
print(f"::set-output name=sytest_test_matrix::{test_matrix}")
135+
set_output("sytest_test_matrix", test_matrix)

.ci/scripts/setup_complement_prerequisites.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endblock
2121

2222
block Install Complement Dependencies
2323
sudo apt-get -qq update && sudo apt-get install -qqy libolm3 libolm-dev
24-
go get -v github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@latest
24+
go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
2525
endblock
2626

2727
block Install custom gotestfmt template

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
!pyproject.toml
1010
!poetry.lock
1111
!Cargo.lock
12+
!Cargo.toml
1213
!build_rust.py
1314

1415
rust/target

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
root = true
55

66
# 4 space indentation
7-
[*.py]
7+
[*.{py,pyi}]
88
indent_style = space
99
indent_size = 4
1010
max_line_length = 88

.flake8

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
# E203: whitespace before ':' (which is contrary to pep8?)
99
# E731: do not assign a lambda expression, use a def
1010
# E501: Line too long (black enforces this for us)
11-
ignore=W503,W504,E203,E731,E501
11+
#
12+
# flake8-bugbear runs extra checks. Its error codes are described at
13+
# https://github.com/PyCQA/flake8-bugbear#list-of-warnings
14+
# B019: Use of functools.lru_cache or functools.cache on methods can lead to memory leaks
15+
# B023: Functions defined inside a loop must not use variables redefined in the loop
16+
# B024: Abstract base class with no abstract method.
17+
18+
ignore=W503,W504,E203,E731,E501,B019,B023,B024

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,36 @@ body:
7474
- Debian packages from packages.matrix.org
7575
- pip (from PyPI)
7676
- Other (please mention below)
77+
- I don't know
78+
validations:
79+
required: true
80+
- type: input
81+
id: database
82+
attributes:
83+
label: Database
84+
description: |
85+
Are you using SQLite or PostgreSQL? What's the version of your database?
86+
87+
If PostgreSQL, please also answer the following:
88+
- are you using a single PostgreSQL server
89+
or [separate servers for `main` and `state`](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#databases)?
90+
- have you previously ported from SQLite using the Synapse "portdb" script?
91+
- have you previously restored from a backup?
92+
validations:
93+
required: true
94+
- type: dropdown
95+
id: workers
96+
attributes:
97+
label: Workers
98+
description: |
99+
Are you running a single Synapse process, or are you running
100+
[2 or more workers](https://matrix-org.github.io/synapse/latest/workers.html)?
101+
options:
102+
- Single process
103+
- Multiple workers
104+
- I don't know
105+
validations:
106+
required: true
77107
- type: textarea
78108
id: platform
79109
attributes:
@@ -83,17 +113,28 @@ body:
83113
e.g. distro, hardware, if it's running in a vm/container, etc.
84114
validations:
85115
required: true
116+
- type: textarea
117+
id: config
118+
attributes:
119+
label: Configuration
120+
description: |
121+
Do you have any unusual config options turned on? If so, please provide details.
122+
123+
- Experimental or undocumented features
124+
- [Presence](https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#presence)
125+
- [Message retention](https://matrix-org.github.io/synapse/latest/message_retention_policies.html)
126+
- [Synapse modules](https://matrix-org.github.io/synapse/latest/modules/index.html)
86127
- type: textarea
87128
id: logs
88129
attributes:
89130
label: Relevant log output
90131
description: |
91132
Please copy and paste any relevant log output, ideally at INFO or DEBUG log level.
92-
This will be automatically formatted into code, so there is no need for backticks.
133+
This will be automatically formatted into code, so there is no need for backticks (`\``).
93134
94135
Please be careful to remove any personal or private data.
95136
96-
**Bug reports are usually very difficult to diagnose without logging.**
137+
**Bug reports are usually impossible to diagnose without logging.**
97138
render: shell
98139
validations:
99140
required: true

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ updates:
1515
directory: "/"
1616
schedule:
1717
interval: "weekly"
18+
19+
- package-ecosystem: "cargo"
20+
directory: "/"
21+
versioning-strategy: "lockfile-only"
22+
schedule:
23+
interval: "weekly"

.github/workflows/docker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
- name: Inspect builder
2929
run: docker buildx inspect
30-
30+
3131
- name: Log in to DockerHub
3232
uses: docker/login-action@v2
3333
with:
@@ -55,3 +55,8 @@ jobs:
5555
tags: "${{ steps.set-tag.outputs.tags }}"
5656
file: "docker/Dockerfile"
5757
platforms: linux/amd64,linux/arm64
58+
59+
# arm64 builds OOM without the git fetch setting. c.f.
60+
# https://github.com/rust-lang/cargo/issues/10583
61+
build-args: |
62+
CARGO_NET_GIT_FETCH_WITH_CLI=true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy documentation PR preview
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Prepare documentation PR preview" ]
6+
types:
7+
- completed
8+
9+
jobs:
10+
netlify:
11+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
12+
runs-on: ubuntu-latest
13+
steps:
14+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
15+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
16+
- name: 📥 Download artifact
17+
uses: dawidd6/action-download-artifact@e6e25ac3a2b93187502a8be1ef9e9603afc34925 # v2.24.2
18+
with:
19+
workflow: docs-pr.yaml
20+
run_id: ${{ github.event.workflow_run.id }}
21+
name: book
22+
path: book
23+
24+
- name: 📤 Deploy to Netlify
25+
uses: matrix-org/netlify-pr-preview@v1
26+
with:
27+
path: book
28+
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
29+
branch: ${{ github.event.workflow_run.head_branch }}
30+
revision: ${{ github.event.workflow_run.head_sha }}
31+
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
32+
site_id: ${{ secrets.NETLIFY_SITE_ID }}
33+
desc: Documentation preview
34+
deployment_env: PR Documentation Preview

0 commit comments

Comments
 (0)