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

Commit 9de3991

Browse files
committed
Merge tag 'v1.32.0' into babolivier/dinsic_1.41.0
Synapse 1.32.0 (2021-04-20) =========================== **Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+. This release removes the deprecated `GET /_synapse/admin/v1/users/<user_id>` admin API. Please use the [v2 API](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.rst#query-user-account) instead, which has improved capabilities. This release requires Application Services to use type `m.login.application_service` when registering users via the `/_matrix/client/r0/register` endpoint to comply with the spec. Please ensure your Application Services are up to date. Bugfixes -------- - Fix the log lines of nested logging contexts. Broke in 1.32.0rc1. ([\#9829](matrix-org/synapse#9829)) Synapse 1.32.0rc1 (2021-04-13) ============================== Features -------- - Add a Synapse module for routing presence updates between users. ([\#9491](matrix-org/synapse#9491)) - Add an admin API to manage ratelimit for a specific user. ([\#9648](matrix-org/synapse#9648)) - Include request information in structured logging output. ([\#9654](matrix-org/synapse#9654)) - Add `order_by` to the admin API `GET /_synapse/admin/v2/users`. Contributed by @dklimpel. ([\#9691](matrix-org/synapse#9691)) - Replace the `room_invite_state_types` configuration setting with `room_prejoin_state`. ([\#9700](matrix-org/synapse#9700)) - Add experimental support for [MSC3083](matrix-org/matrix-spec-proposals#3083): restricting room access via group membership. ([\#9717](matrix-org/synapse#9717), [\#9735](matrix-org/synapse#9735)) - Update experimental support for Spaces: include `m.room.create` in the room state sent with room-invites. ([\#9710](matrix-org/synapse#9710)) - Synapse now requires Python 3.6 or later. It also requires Postgres 9.6 or later or SQLite 3.22 or later. ([\#9766](matrix-org/synapse#9766)) Bugfixes -------- - Prevent `synapse_forward_extremities` and `synapse_excess_extremity_events` Prometheus metrics from initially reporting zero-values after startup. ([\#8926](matrix-org/synapse#8926)) - Fix recently added ratelimits to correctly honour the application service `rate_limited` flag. ([\#9711](matrix-org/synapse#9711)) - Fix longstanding bug which caused `duplicate key value violates unique constraint "remote_media_cache_thumbnails_media_origin_media_id_thumbna_key"` errors. ([\#9725](matrix-org/synapse#9725)) - Fix bug where sharded federation senders could get stuck repeatedly querying the DB in a loop, using lots of CPU. ([\#9770](matrix-org/synapse#9770)) - Fix duplicate logging of exceptions thrown during federation transaction processing. ([\#9780](matrix-org/synapse#9780)) Updates to the Docker image --------------------------- - Move opencontainers labels to the final Docker image such that users can inspect them. ([\#9765](matrix-org/synapse#9765)) Improved Documentation ---------------------- - Make the `allowed_local_3pids` regex example in the sample config stricter. ([\#9719](matrix-org/synapse#9719)) Deprecations and Removals ------------------------- - Remove old admin API `GET /_synapse/admin/v1/users/<user_id>`. ([\#9401](matrix-org/synapse#9401)) - Make `/_matrix/client/r0/register` expect a type of `m.login.application_service` when an Application Service registers a user, to align with [the relevant spec](https://spec.matrix.org/unstable/application-service-api/#server-admin-style-permissions). ([\#9548](matrix-org/synapse#9548)) Internal Changes ---------------- - Replace deprecated `imp` module with successor `importlib`. Contributed by Cristina Muñoz. ([\#9718](matrix-org/synapse#9718)) - Experiment with GitHub Actions for CI. ([\#9661](matrix-org/synapse#9661)) - Introduce flake8-bugbear to the test suite and fix some of its lint violations. ([\#9682](matrix-org/synapse#9682)) - Update `scripts-dev/complement.sh` to use a local checkout of Complement, allow running a subset of tests and have it use Synapse's Complement test blacklist. ([\#9685](matrix-org/synapse#9685)) - Improve Jaeger tracing for `to_device` messages. ([\#9686](matrix-org/synapse#9686)) - Add release helper script for automating part of the Synapse release process. ([\#9713](matrix-org/synapse#9713)) - Add type hints to expiring cache. ([\#9730](matrix-org/synapse#9730)) - Convert various testcases to `HomeserverTestCase`. ([\#9736](matrix-org/synapse#9736)) - Start linting mypy with `no_implicit_optional`. ([\#9742](matrix-org/synapse#9742)) - Add missing type hints to federation handler and server. ([\#9743](matrix-org/synapse#9743)) - Check that a `ConfigError` is raised, rather than simply `Exception`, when appropriate in homeserver config file generation tests. ([\#9753](matrix-org/synapse#9753)) - Fix incompatibility with `tox` 2.5. ([\#9769](matrix-org/synapse#9769)) - Enable Complement tests for [MSC2946](matrix-org/matrix-spec-proposals#2946): Spaces Summary API. ([\#9771](matrix-org/synapse#9771)) - Use mock from the standard library instead of a separate package. ([\#9772](matrix-org/synapse#9772)) - Update Black configuration to target Python 3.6. ([\#9781](matrix-org/synapse#9781)) - Add option to skip unit tests when building Debian packages. ([\#9793](matrix-org/synapse#9793))
2 parents 9691665 + 438a859 commit 9de3991

File tree

207 files changed

+4909
-1563
lines changed

Some content is hidden

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

207 files changed

+4909
-1563
lines changed

.buildkite/scripts/test_old_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# this script is run by buildkite in a plain `xenial` container; it installs the
3+
# this script is run by buildkite in a plain `bionic` container; it installs the
44
# minimal requirements for tox and hands over to the py3-old tox environment.
55

66
set -ex

.github/workflows/tests.yml

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: ["develop", "release-*"]
6+
pull_request:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
toxenv:
14+
- "check-sampleconfig"
15+
- "check_codestyle"
16+
- "check_isort"
17+
- "mypy"
18+
- "packaging"
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-python@v2
23+
- run: pip install tox
24+
- run: tox -e ${{ matrix.toxenv }}
25+
26+
lint-crlf:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Check line endings
31+
run: scripts-dev/check_line_terminators.sh
32+
33+
lint-newsfile:
34+
if: ${{ github.base_ref == 'develop' || contains(github.base_ref, 'release-') }}
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-python@v2
39+
- run: pip install tox
40+
- name: Patch Buildkite-specific test script
41+
run: |
42+
sed -i -e 's/\$BUILDKITE_PULL_REQUEST/${{ github.event.number }}/' \
43+
scripts-dev/check-newsfragment
44+
- run: scripts-dev/check-newsfragment
45+
46+
lint-sdist:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: actions/setup-python@v2
51+
with:
52+
python-version: "3.x"
53+
- run: pip install wheel
54+
- run: python setup.py sdist bdist_wheel
55+
- uses: actions/upload-artifact@v2
56+
with:
57+
name: Python Distributions
58+
path: dist/*
59+
60+
# Dummy step to gate other tests on without repeating the whole list
61+
linting-done:
62+
if: ${{ always() }} # Run this even if prior jobs were skipped
63+
needs: [lint, lint-crlf, lint-newsfile, lint-sdist]
64+
runs-on: ubuntu-latest
65+
steps:
66+
- run: "true"
67+
68+
trial:
69+
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
70+
needs: linting-done
71+
runs-on: ubuntu-latest
72+
strategy:
73+
matrix:
74+
python-version: ["3.6", "3.7", "3.8", "3.9"]
75+
database: ["sqlite"]
76+
include:
77+
# Newest Python without optional deps
78+
- python-version: "3.9"
79+
toxenv: "py-noextras,combine"
80+
81+
# Oldest Python with PostgreSQL
82+
- python-version: "3.6"
83+
database: "postgres"
84+
postgres-version: "9.6"
85+
86+
# Newest Python with PostgreSQL
87+
- python-version: "3.9"
88+
database: "postgres"
89+
postgres-version: "13"
90+
91+
steps:
92+
- uses: actions/checkout@v2
93+
- run: sudo apt-get -qq install xmlsec1
94+
- name: Set up PostgreSQL ${{ matrix.postgres-version }}
95+
if: ${{ matrix.postgres-version }}
96+
run: |
97+
docker run -d -p 5432:5432 \
98+
-e POSTGRES_PASSWORD=postgres \
99+
-e POSTGRES_INITDB_ARGS="--lc-collate C --lc-ctype C --encoding UTF8" \
100+
postgres:${{ matrix.postgres-version }}
101+
- uses: actions/setup-python@v2
102+
with:
103+
python-version: ${{ matrix.python-version }}
104+
- run: pip install tox
105+
- name: Await PostgreSQL
106+
if: ${{ matrix.postgres-version }}
107+
timeout-minutes: 2
108+
run: until pg_isready -h localhost; do sleep 1; done
109+
- run: tox -e py,combine
110+
env:
111+
TRIAL_FLAGS: "--jobs=2"
112+
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
113+
SYNAPSE_POSTGRES_HOST: localhost
114+
SYNAPSE_POSTGRES_USER: postgres
115+
SYNAPSE_POSTGRES_PASSWORD: postgres
116+
- name: Dump logs
117+
# Note: Dumps to workflow logs instead of using actions/upload-artifact
118+
# This keeps logs colocated with failing jobs
119+
# It also ignores find's exit code; this is a best effort affair
120+
run: >-
121+
find _trial_temp -name '*.log'
122+
-exec echo "::group::{}" \;
123+
-exec cat {} \;
124+
-exec echo "::endgroup::" \;
125+
|| true
126+
127+
trial-olddeps:
128+
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
129+
needs: linting-done
130+
runs-on: ubuntu-latest
131+
steps:
132+
- uses: actions/checkout@v2
133+
- name: Test with old deps
134+
uses: docker://ubuntu:bionic # For old python and sqlite
135+
with:
136+
workdir: /github/workspace
137+
entrypoint: .buildkite/scripts/test_old_deps.sh
138+
env:
139+
TRIAL_FLAGS: "--jobs=2"
140+
- name: Dump logs
141+
# Note: Dumps to workflow logs instead of using actions/upload-artifact
142+
# This keeps logs colocated with failing jobs
143+
# It also ignores find's exit code; this is a best effort affair
144+
run: >-
145+
find _trial_temp -name '*.log'
146+
-exec echo "::group::{}" \;
147+
-exec cat {} \;
148+
-exec echo "::endgroup::" \;
149+
|| true
150+
151+
trial-pypy:
152+
# Very slow; only run if the branch name includes 'pypy'
153+
if: ${{ contains(github.ref, 'pypy') && !failure() }}
154+
needs: linting-done
155+
runs-on: ubuntu-latest
156+
strategy:
157+
matrix:
158+
python-version: ["pypy-3.6"]
159+
160+
steps:
161+
- uses: actions/checkout@v2
162+
- run: sudo apt-get -qq install xmlsec1 libxml2-dev libxslt-dev
163+
- uses: actions/setup-python@v2
164+
with:
165+
python-version: ${{ matrix.python-version }}
166+
- run: pip install tox
167+
- run: tox -e py,combine
168+
env:
169+
TRIAL_FLAGS: "--jobs=2"
170+
- name: Dump logs
171+
# Note: Dumps to workflow logs instead of using actions/upload-artifact
172+
# This keeps logs colocated with failing jobs
173+
# It also ignores find's exit code; this is a best effort affair
174+
run: >-
175+
find _trial_temp -name '*.log'
176+
-exec echo "::group::{}" \;
177+
-exec cat {} \;
178+
-exec echo "::endgroup::" \;
179+
|| true
180+
181+
sytest:
182+
if: ${{ !failure() }}
183+
needs: linting-done
184+
runs-on: ubuntu-latest
185+
container:
186+
image: matrixdotorg/sytest-synapse:${{ matrix.sytest-tag }}
187+
volumes:
188+
- ${{ github.workspace }}:/src
189+
env:
190+
BUILDKITE_BRANCH: ${{ github.head_ref }}
191+
POSTGRES: ${{ matrix.postgres && 1}}
192+
MULTI_POSTGRES: ${{ (matrix.postgres == 'multi-postgres') && 1}}
193+
WORKERS: ${{ matrix.workers && 1 }}
194+
REDIS: ${{ matrix.redis && 1 }}
195+
BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
196+
197+
strategy:
198+
fail-fast: false
199+
matrix:
200+
include:
201+
- sytest-tag: bionic
202+
203+
- sytest-tag: bionic
204+
postgres: postgres
205+
206+
- sytest-tag: testing
207+
postgres: postgres
208+
209+
- sytest-tag: bionic
210+
postgres: multi-postgres
211+
workers: workers
212+
213+
- sytest-tag: buster
214+
postgres: multi-postgres
215+
workers: workers
216+
217+
- sytest-tag: buster
218+
postgres: postgres
219+
workers: workers
220+
redis: redis
221+
222+
steps:
223+
- uses: actions/checkout@v2
224+
- name: Prepare test blacklist
225+
run: cat sytest-blacklist .buildkite/worker-blacklist > synapse-blacklist-with-workers
226+
- name: Run SyTest
227+
run: /bootstrap.sh synapse
228+
working-directory: /src
229+
- name: Dump results.tap
230+
if: ${{ always() }}
231+
run: cat /logs/results.tap
232+
- name: Upload SyTest logs
233+
uses: actions/upload-artifact@v2
234+
if: ${{ always() }}
235+
with:
236+
name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }})
237+
path: |
238+
/logs/results.tap
239+
/logs/**/*.log*
240+
241+
portdb:
242+
if: ${{ !failure() }} # Allow previous steps to be skipped, but not fail
243+
needs: linting-done
244+
runs-on: ubuntu-latest
245+
strategy:
246+
matrix:
247+
include:
248+
- python-version: "3.6"
249+
postgres-version: "9.6"
250+
251+
- python-version: "3.9"
252+
postgres-version: "13"
253+
254+
services:
255+
postgres:
256+
image: postgres:${{ matrix.postgres-version }}
257+
ports:
258+
- 5432:5432
259+
env:
260+
POSTGRES_PASSWORD: "postgres"
261+
POSTGRES_INITDB_ARGS: "--lc-collate C --lc-ctype C --encoding UTF8"
262+
options: >-
263+
--health-cmd pg_isready
264+
--health-interval 10s
265+
--health-timeout 5s
266+
--health-retries 5
267+
268+
steps:
269+
- uses: actions/checkout@v2
270+
- run: sudo apt-get -qq install xmlsec1
271+
- uses: actions/setup-python@v2
272+
with:
273+
python-version: ${{ matrix.python-version }}
274+
- name: Patch Buildkite-specific test scripts
275+
run: |
276+
sed -i -e 's/host="postgres"/host="localhost"/' .buildkite/scripts/create_postgres_db.py
277+
sed -i -e 's/host: postgres/host: localhost/' .buildkite/postgres-config.yaml
278+
sed -i -e 's|/src/||' .buildkite/{sqlite,postgres}-config.yaml
279+
sed -i -e 's/\$TOP/\$GITHUB_WORKSPACE/' .coveragerc
280+
- run: .buildkite/scripts/test_synapse_port_db.sh
281+
282+
complement:
283+
if: ${{ !failure() }}
284+
needs: linting-done
285+
runs-on: ubuntu-latest
286+
container:
287+
# https://github.com/matrix-org/complement/blob/master/dockerfiles/ComplementCIBuildkite.Dockerfile
288+
image: matrixdotorg/complement:latest
289+
env:
290+
CI: true
291+
ports:
292+
- 8448:8448
293+
volumes:
294+
- /var/run/docker.sock:/var/run/docker.sock
295+
296+
steps:
297+
- name: Run actions/checkout@v2 for synapse
298+
uses: actions/checkout@v2
299+
with:
300+
path: synapse
301+
302+
- name: Run actions/checkout@v2 for complement
303+
uses: actions/checkout@v2
304+
with:
305+
repository: "matrix-org/complement"
306+
path: complement
307+
308+
# Build initial Synapse image
309+
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
310+
working-directory: synapse
311+
312+
# Build a ready-to-run Synapse image based on the initial image above.
313+
# This new image includes a config file, keys for signing and TLS, and
314+
# other settings to make it suitable for testing under Complement.
315+
- run: docker build -t complement-synapse -f Synapse.Dockerfile .
316+
working-directory: complement/dockerfiles
317+
318+
# Run Complement
319+
- run: go test -v -tags synapse_blacklist ./tests
320+
env:
321+
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
322+
working-directory: complement

0 commit comments

Comments
 (0)