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

Commit a18c401

Browse files
author
David Robertson
committed
Merge branch 'develop' into dependabot/pip/flake8-bugbear-22.9.23
2 parents 6105308 + 04d7f56 commit a18c401

Some content is hidden

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

66 files changed

+896
-373
lines changed

.ci/scripts/calculate_jobs.py

Lines changed: 9 additions & 2 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.
@@ -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)

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
esac
5555
5656
# finally, set the 'branch-version' var.
57-
echo "::set-output name=branch-version::$branch"
57+
echo "branch-version=$branch" >> "$GITHUB_OUTPUT"
5858
5959
# Deploy to the target directory.
6060
- name: Deploy to gh pages

.github/workflows/release-artifacts.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v3
2929
- uses: actions/setup-python@v4
30+
with:
31+
python-version: '3.x'
3032
- id: set-distros
3133
run: |
3234
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
3335
dists='["debian:sid"]'
3436
if [[ $GITHUB_REF == refs/tags/* ]]; then
3537
dists=$(scripts-dev/build_debian_packages.py --show-dists-json)
3638
fi
37-
echo "::set-output name=distros::$dists"
39+
echo "distros=$dists" >> "$GITHUB_OUTPUT"
3840
# map the step outputs to job outputs
3941
outputs:
4042
distros: ${{ steps.set-distros.outputs.distros }}
@@ -70,6 +72,8 @@ jobs:
7072
7173
- name: Set up python
7274
uses: actions/setup-python@v4
75+
with:
76+
python-version: '3.x'
7377

7478
- name: Build the packages
7579
# see https://github.com/docker/build-push-action/issues/252
@@ -91,18 +95,27 @@ jobs:
9195
path: debs/*
9296

9397
build-wheels:
94-
name: Build wheels on ${{ matrix.os }}
98+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
9599
runs-on: ${{ matrix.os }}
96100
strategy:
97101
matrix:
98102
os: [ubuntu-20.04, macos-10.15]
103+
arch: [x86_64, aarch64]
104+
# is_pr is a flag used to exclude certain jobs from the matrix on PRs.
105+
# It is not read by the rest of the workflow.
99106
is_pr:
100107
- ${{ startsWith(github.ref, 'refs/pull/') }}
101108

102109
exclude:
103110
# Don't build macos wheels on PR CI.
104111
- is_pr: true
105112
os: "macos-10.15"
113+
# Don't build aarch64 wheels on mac.
114+
- os: "macos-10.15"
115+
arch: aarch64
116+
# Don't build aarch64 wheels on PR CI.
117+
- is_pr: true
118+
arch: aarch64
106119

107120
steps:
108121
- uses: actions/checkout@v3
@@ -116,18 +129,29 @@ jobs:
116129
- name: Install cibuildwheel
117130
run: python -m pip install cibuildwheel==2.9.0 poetry==1.2.0
118131

119-
# Only build a single wheel in CI.
120-
- name: Set env vars.
121-
run: |
122-
echo "CIBW_BUILD="cp37-manylinux_x86_64"" >> $GITHUB_ENV
132+
- name: Set up QEMU to emulate aarch64
133+
if: matrix.arch == 'aarch64'
134+
uses: docker/setup-qemu-action@v2
135+
with:
136+
platforms: arm64
137+
138+
- name: Build aarch64 wheels
139+
if: matrix.arch == 'aarch64'
140+
run: echo 'CIBW_ARCHS_LINUX=aarch64' >> $GITHUB_ENV
141+
142+
- name: Only build a single wheel on PR
123143
if: startsWith(github.ref, 'refs/pull/')
144+
run: echo "CIBW_BUILD="cp37-manylinux_${{ matrix.arch }}"" >> $GITHUB_ENV
124145

125146
- name: Build wheels
126147
run: python -m cibuildwheel --output-dir wheelhouse
127148
env:
128149
# Skip testing for platforms which various libraries don't have wheels
129150
# for, and so need extra build deps.
130151
CIBW_TEST_SKIP: pp39-* *i686* *musl* pp37-macosx*
152+
# Fix Rust OOM errors on emulated aarch64: https://github.com/rust-lang/cargo/issues/10583
153+
CARGO_NET_GIT_FETCH_WITH_CLI: true
154+
CIBW_ENVIRONMENT_PASS_LINUX: CARGO_NET_GIT_FETCH_WITH_CLI
131155

132156
- uses: actions/upload-artifact@v3
133157
with:

.github/workflows/triage-incoming.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,11 @@ on:
55
types: [ opened ]
66

77
jobs:
8-
add_new_issues:
9-
name: Add new issues to the triage board
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: octokit/[email protected]
13-
id: add_to_project
14-
with:
15-
headers: '{"GraphQL-Features": "projects_next_graphql"}'
16-
query: |
17-
mutation add_to_project($projectid:ID!,$contentid:ID!) {
18-
addProjectV2ItemById(input: {projectId: $projectid contentId: $contentid}) {
19-
item {
20-
id
21-
}
22-
}
23-
}
24-
projectid: ${{ env.PROJECT_ID }}
25-
contentid: ${{ github.event.issue.node_id }}
26-
env:
27-
PROJECT_ID: "PVT_kwDOAIB0Bs4AFDdZ"
28-
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
8+
triage:
9+
uses: matrix-org/backend-meta/.github/workflows/triage-incoming.yml@v1
10+
with:
11+
project_id: 'PVT_kwDOAIB0Bs4AFDdZ'
12+
content_id: ${{ github.event.issue.node_id }}
13+
secrets:
14+
github_access_token: ${{ secrets.ELEMENT_BOT_TOKEN }}
15+

changelog.d/10015.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Prevent device names from appearing in device list updates when `allow_device_name_lookup_over_federation` is `false`.

changelog.d/14018.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support for redirecting to an implementation of a [MSC3886](https://github.com/matrix-org/matrix-spec-proposals/pull/3886) HTTP rendezvous service.

changelog.d/14126.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Faster joins: prioritise the server we joined by when restarting a partial join resync.

changelog.d/14145.doc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Clarify comment on event contexts.
2+

changelog.d/14161.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in 1.30.0 where purging and rejoining a room without restarting in-between would result in a broken room.

changelog.d/14164.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug introduced in 1.30.0 where purging and rejoining a room without restarting in-between would result in a broken room.

changelog.d/14195.docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix pre-startup logging being lost when using the `Dockerfile-workers` image.

changelog.d/14198.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable url previews when testing with complement.

changelog.d/14206.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump pygithub from 1.55 to 1.56.

changelog.d/14207.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump twisted from 22.4.0 to 22.8.0.

changelog.d/14208.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump types-setuptools from 65.4.0.0 to 65.5.0.1.

changelog.d/14212.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Build and publish binary wheels for `aarch64` platforms.

changelog.d/14214.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When authenticating batched events, check for auth events in batch as well as DB.

changelog.d/14215.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix [MSC3030](https://github.com/matrix-org/matrix-spec-proposals/pull/3030) `/timestamp_to_event` endpoint returning potentially inaccurate closest events with `outliers` present.

changelog.d/14216.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update CI config to avoid GitHub Actions deprecation warnings.

changelog.d/14217.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update dependency requirements to allow building with poetry-core 1.3.2.

changelog.d/14221.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename the `cache_memory` extra to `cache-memory`, for compatability with poetry-core 1.3.0 and [PEP 685](https://peps.python.org/pep-0685/). From-source installations using this extra will need to install using the new name.

changelog.d/14222.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support for thread-specific notifications & receipts ([MSC3771](https://github.com/matrix-org/matrix-spec-proposals/pull/3771) and [MSC3773](https://github.com/matrix-org/matrix-spec-proposals/pull/3773)).

changelog.d/14224.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update CI config to avoid GitHub Actions deprecation warnings.

changelog.d/14227.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Specify dev-dependencies using lower bounds, to reduce the likelihood of a dependabot merge conflict. The lockfile continues to pin to specific versions.

changelog.d/14230.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Switch to using the `matrix-org/backend-meta` version of `triage-incoming` for new issues in CI.

docker/complement/conf/workers-shared-extra.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ trusted_key_servers: []
1212
enable_registration: true
1313
enable_registration_without_verification: true
1414
bcrypt_rounds: 4
15+
url_preview_enabled: true
16+
url_preview_ip_range_blacklist: []
1517

1618
## Registration ##
1719

docker/configure_workers_and_start.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,24 +230,19 @@
230230

231231
# Utility functions
232232
def log(txt: str) -> None:
233-
"""Log something to the stdout.
234-
235-
Args:
236-
txt: The text to log.
237-
"""
238233
print(txt)
239234

240235

241236
def error(txt: str) -> NoReturn:
242-
"""Log something and exit with an error code.
243-
244-
Args:
245-
txt: The text to log in error.
246-
"""
247-
log(txt)
237+
print(txt, file=sys.stderr)
248238
sys.exit(2)
249239

250240

241+
def flush_buffers() -> None:
242+
sys.stdout.flush()
243+
sys.stderr.flush()
244+
245+
251246
def convert(src: str, dst: str, **template_vars: object) -> None:
252247
"""Generate a file from a template
253248
@@ -328,7 +323,7 @@ def generate_base_homeserver_config() -> None:
328323
# start.py already does this for us, so just call that.
329324
# note that this script is copied in in the official, monolith dockerfile
330325
os.environ["SYNAPSE_HTTP_PORT"] = str(MAIN_PROCESS_HTTP_LISTENER_PORT)
331-
subprocess.check_output(["/usr/local/bin/python", "/start.py", "migrate_config"])
326+
subprocess.run(["/usr/local/bin/python", "/start.py", "migrate_config"], check=True)
332327

333328

334329
def generate_worker_files(
@@ -642,6 +637,7 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
642637
# Start supervisord, which will start Synapse, all of the configured worker
643638
# processes, redis, nginx etc. according to the config we created above.
644639
log("Starting supervisord")
640+
flush_buffers()
645641
os.execle(
646642
"/usr/local/bin/supervisord",
647643
"supervisord",

docker/start.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@
1313

1414
# Utility functions
1515
def log(txt: str) -> None:
16-
print(txt, file=sys.stderr)
16+
print(txt)
1717

1818

1919
def error(txt: str) -> NoReturn:
20-
log(txt)
20+
print(txt, file=sys.stderr)
2121
sys.exit(2)
2222

2323

24+
def flush_buffers() -> None:
25+
sys.stdout.flush()
26+
sys.stderr.flush()
27+
28+
2429
def convert(src: str, dst: str, environ: Mapping[str, object]) -> None:
2530
"""Generate a file from a template
2631
@@ -131,10 +136,10 @@ def generate_config_from_template(
131136

132137
if ownership is not None:
133138
log(f"Setting ownership on /data to {ownership}")
134-
subprocess.check_output(["chown", "-R", ownership, "/data"])
139+
subprocess.run(["chown", "-R", ownership, "/data"], check=True)
135140
args = ["gosu", ownership] + args
136141

137-
subprocess.check_output(args)
142+
subprocess.run(args, check=True)
138143

139144

140145
def run_generate_config(environ: Mapping[str, str], ownership: Optional[str]) -> None:
@@ -158,7 +163,7 @@ def run_generate_config(environ: Mapping[str, str], ownership: Optional[str]) ->
158163
if ownership is not None:
159164
# make sure that synapse has perms to write to the data dir.
160165
log(f"Setting ownership on {data_dir} to {ownership}")
161-
subprocess.check_output(["chown", ownership, data_dir])
166+
subprocess.run(["chown", ownership, data_dir], check=True)
162167

163168
# create a suitable log config from our template
164169
log_config_file = "%s/%s.log.config" % (config_dir, server_name)
@@ -185,6 +190,7 @@ def run_generate_config(environ: Mapping[str, str], ownership: Optional[str]) ->
185190
"--open-private-ports",
186191
]
187192
# log("running %s" % (args, ))
193+
flush_buffers()
188194
os.execv(sys.executable, args)
189195

190196

@@ -267,8 +273,10 @@ def main(args: List[str], environ: MutableMapping[str, str]) -> None:
267273
args = [sys.executable] + args
268274
if ownership is not None:
269275
args = ["gosu", ownership] + args
276+
flush_buffers()
270277
os.execve("/usr/sbin/gosu", args, environ)
271278
else:
279+
flush_buffers()
272280
os.execve(sys.executable, args, environ)
273281

274282

0 commit comments

Comments
 (0)