Skip to content

Commit 0cac774

Browse files
committed
Merge branch 'develop' into call-toasts
2 parents 40581be + 546083b commit 0cac774

882 files changed

Lines changed: 43259 additions & 25736 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.

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
/pnpm-lock.yaml @element-hq/element-web-team
55

66
/apps/web/src/SecurityManager.ts @element-hq/element-crypto-web-reviewers
7-
/apps/web/test/SecurityManager-test.ts @element-hq/element-crypto-web-reviewers
7+
/apps/web/test/unit-tests/SecurityManager-test.ts @element-hq/element-crypto-web-reviewers
88
/apps/web/src/async-components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
9+
/apps/web/test/unit-tests/async-components/dialogs/security/ @element-hq/element-crypto-web-reviewers
910
/apps/web/src/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
10-
/apps/web/test/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
11+
/apps/web/test/unit-tests/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
1112
/apps/web/src/stores/SetupEncryptionStore.ts @element-hq/element-crypto-web-reviewers
12-
/apps/web/test/stores/SetupEncryptionStore-test.ts @element-hq/element-crypto-web-reviewers
13+
/apps/web/test/unit-tests/stores/SetupEncryptionStore-test.ts @element-hq/element-crypto-web-reviewers
1314
/apps/web/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx @element-hq/element-crypto-web-reviewers
1415
/apps/web/src/components/views/settings/encryption/ @element-hq/element-crypto-web-reviewers
1516
/apps/web/test/unit-tests/components/views/settings/encryption/ @element-hq/element-crypto-web-reviewers

.github/actions/download-verify-element-tarball/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
using: composite
1212
steps:
1313
- name: Download release tarball
14-
uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1
14+
uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # v1
1515
with:
1616
tag: ${{ inputs.tag }}
1717
fileName: element-*.tar.gz*
@@ -31,7 +31,9 @@ runs:
3131

3232
- name: Move webapp to out-file-path
3333
shell: bash
34-
run: mv ${{ runner.temp }}/download-verify-element-tarball/webapp ${{ inputs.out-file-path }}
34+
run: mv ${{ runner.temp }}/download-verify-element-tarball/webapp "$OUT_PATH"
35+
env:
36+
OUT_PATH: ${{ inputs.out-file-path }}
3537

3638
- name: Clean up temp directory
3739
shell: bash
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Setup playwright
2+
description: Installs playwright browsers and sets up a cache
3+
inputs:
4+
needs-webkit:
5+
description: Whether to install the additional dependencies for webkit
6+
required: false
7+
default: "false"
8+
write-cache:
9+
description: Whether to write the cache back
10+
required: true
11+
runs:
12+
using: composite
13+
steps:
14+
- name: Calculate cache key
15+
id: key
16+
run: |
17+
PW_VERSION=$(pnpm --silent -- playwright --version | awk '{print $2}')
18+
echo "key=${PREFIX}-playwright-${PW_VERSION}" >> $GITHUB_OUTPUT
19+
shell: bash
20+
env:
21+
PREFIX: ${{ runner.os }}-${{ runner.arch }}
22+
23+
- name: Cache playwright binaries
24+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
25+
if: inputs.write-cache == 'true'
26+
id: cache
27+
with:
28+
path: ~/.cache/ms-playwright
29+
key: ${{ steps.key.outputs.key }}
30+
31+
# When running in merge queue only restore the cache, never write it
32+
- name: Restore playwright binaries cache
33+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
34+
if: inputs.write-cache != 'true'
35+
id: cache-restore
36+
with:
37+
path: ~/.cache/ms-playwright
38+
key: ${{ steps.key.outputs.key }}
39+
40+
- name: Install Playwright browsers
41+
if: (steps.cache.outputs.cache-hit || steps.cache-restore.outputs.cache-hit) != 'true'
42+
shell: bash
43+
run: pnpm playwright install --with-deps
44+
45+
# Some WebKit dependencies seem to lay outside the cache and will need to be installed separately
46+
- name: Install system dependencies for WebKit
47+
if: inputs.needs-webkit == 'true' && (steps.cache.outputs.cache-hit || steps.cache-restore.outputs.cache-hit) == 'true'
48+
shell: bash
49+
run: pnpm playwright install-deps webkit

.github/renovate.json

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,45 @@
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
33
"extends": ["github>matrix-org/renovate-config-element-web"],
44
"postUpdateOptions": ["pnpmDedupe"],
5+
"stopUpdatingLabel": "X-Blocked",
6+
"packageRules": [
7+
{
8+
"description": "Group all testcontainers docker digests",
9+
"groupName": "testcontainers docker digests",
10+
"groupSlug": "testcontainers-docker",
11+
"matchDepTypes": ["testcontainers-docker"],
12+
"matchPackageNames": ["*"]
13+
},
14+
{
15+
"description": "Separate updates to overrides from other groups",
16+
"matchDepTypes": ["pnpm.overrides"],
17+
"groupSlug": null
18+
},
19+
{
20+
"description": "Disable any major updates to overrides as this almost always is wrong",
21+
"matchDepTypes": ["pnpm.overrides"],
22+
"matchUpdateTypes": ["major"],
23+
"enabled": false
24+
}
25+
],
526
"customManagers": [
627
{
28+
"description": "Update testcontainers docker digests",
729
"customType": "regex",
830
"datasourceTemplate": "docker",
931
"versioningTemplate": "loose",
10-
"description": "Update testcontainers docker digests",
1132
"managerFilePatterns": ["**/testcontainers/*.ts"],
12-
"matchStrings": ["\\s+\"(?<depName>[^@]+):(?<currentValue>[^@]+)@(?<currentDigest>sha256:[a-f0-9]+)\""]
33+
"matchStrings": ["\\s+\"(?<depName>[^@]+):(?<currentValue>[^@]+)@(?<currentDigest>sha256:[a-f0-9]+)\""],
34+
"depTypeTemplate": "testcontainers-docker"
35+
},
36+
{
37+
"description": "Update element-desktop hakDependencies",
38+
"customType": "jsonata",
39+
"managerFilePatterns": ["/(^|/)package\\.json$/"],
40+
"fileFormat": "json",
41+
"matchStrings": ["hakDependencies.$each(function($v, $k) { { 'packageName': $k, 'currentValue': $v } })"],
42+
"datasourceTemplate": "npm",
43+
"depTypeTemplate": "hak"
1344
}
1445
]
1546
}

.github/workflows/build-and-test.yaml

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ on:
1818
push:
1919
# We do not build on push to develop as the merge_group check handles that
2020
branches: [staging, master]
21-
repository_dispatch:
22-
types: [element-web-notify]
2321

2422
# support triggering from other workflows
2523
workflow_call:
@@ -56,6 +54,8 @@ jobs:
5654
outputs:
5755
num-runners: ${{ env.NUM_RUNNERS }}
5856
runners-matrix: ${{ steps.runner-vars.outputs.matrix }}
57+
# Skip pull_request runs on renovate PRs to speed up CI time, delegating to the full run in merge queue
58+
skip: ${{ inputs.skip || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
5959
steps:
6060
- name: Checkout code
6161
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -64,7 +64,7 @@ jobs:
6464
persist-credentials: false
6565

6666
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
67-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
67+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
6868
with:
6969
cache: "pnpm"
7070
node-version: "lts/*"
@@ -86,15 +86,15 @@ jobs:
8686
run: VERSION=$(scripts/get-version-from-git.sh) pnpm run build
8787

8888
- name: Upload Artifact
89-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
89+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
9090
with:
9191
name: webapp
9292
path: apps/web/webapp
9393
retention-days: 1
9494

9595
- name: Calculate runner variables
9696
id: runner-vars
97-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
97+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
9898
with:
9999
script: |
100100
const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
@@ -104,7 +104,7 @@ jobs:
104104
playwright_ew:
105105
name: "Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build_ew.outputs.num-runners }}"
106106
needs: build_ew
107-
if: inputs.skip != true
107+
if: needs.build_ew.outputs.skip == 'false'
108108
runs-on: ubuntu-24.04
109109
permissions:
110110
actions: read
@@ -146,7 +146,7 @@ jobs:
146146
path: apps/web/webapp
147147

148148
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
149-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
149+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
150150
with:
151151
cache: "pnpm"
152152
cache-dependency-path: pnpm-lock.yaml
@@ -155,33 +155,17 @@ jobs:
155155
- name: Install dependencies
156156
run: pnpm install --frozen-lockfile
157157

158-
- name: Get installed Playwright version
159-
id: playwright
160-
run: echo "version=$(pnpm --silent -- playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT
161-
162-
- name: Cache playwright binaries
163-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
164-
id: playwright-cache
158+
- name: Setup playwright
159+
uses: ./.github/actions/setup-playwright
165160
with:
166-
path: ~/.cache/ms-playwright
167-
key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ steps.playwright.outputs.version }}
168-
169-
- name: Install Playwright browsers
170-
if: steps.playwright-cache.outputs.cache-hit != 'true'
171-
working-directory: apps/web
172-
run: pnpm playwright install --with-deps --no-shell
173-
174-
- name: Install system dependencies for WebKit
175-
# Some WebKit dependencies seem to lay outside the cache and will need to be installed separately
176-
if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
177-
working-directory: apps/web
178-
run: pnpm playwright install-deps webkit
161+
needs-webkit: ${{ matrix.project == 'WebKit' }}
162+
write-cache: ${{ github.event_name != 'merge_group' }}
179163

180164
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
181165
- name: Run Playwright tests
182166
working-directory: apps/web
183167
run: |
184-
pnpm playwright test \
168+
pnpm test:playwright \
185169
--shard "$SHARD" \
186170
--project="${{ matrix.project }}" \
187171
${{ (github.event_name == 'pull_request' && matrix.runAllTests == false ) && '--grep-invert @mergequeue' || '' }}
@@ -190,7 +174,7 @@ jobs:
190174

191175
- name: Upload blob report to GitHub Actions Artifacts
192176
if: always()
193-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
177+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
194178
with:
195179
name: blob-report-${{ matrix.project }}-${{ matrix.runner }}
196180
path: apps/web/blob-report
@@ -200,28 +184,30 @@ jobs:
200184
downstream-modules:
201185
name: Downstream Playwright tests [element-modules]
202186
needs: build_ew
203-
if: inputs.skip != true && github.event_name == 'merge_group'
187+
if: needs.build_ew.outputs.skip == 'false' && github.event_name == 'merge_group'
204188
uses: element-hq/element-modules/.github/workflows/reusable-playwright-tests.yml@main # zizmor: ignore[unpinned-uses]
205189
with:
206190
webapp-artifact: webapp
191+
reporter: blob
207192

208193
prepare_ed:
209194
name: "Prepare Element Desktop"
210195
uses: ./.github/workflows/build_desktop_prepare.yaml
211196
needs: build_ew
212-
if: inputs.skip != true
197+
if: needs.build_ew.outputs.skip == 'false'
213198
permissions:
214199
contents: read
215200
with:
216201
config: ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'element.io/nightly' || 'element.io/release' }}
217-
version: ${{ (github.event.pull_request.base.ref || github.ref_name) == 'develop' && 'develop' || '' }}
202+
version: ${{ case((github.event.pull_request.base.ref || github.ref_name) == 'develop' || github.event_name == 'merge_group', 'develop', '') }}
218203
webapp-artifact: webapp
219204

220205
build_ed_windows:
221206
needs: prepare_ed
222207
name: "Desktop Windows"
223208
uses: ./.github/workflows/build_desktop_windows.yaml
224-
if: inputs.skip != true
209+
# Skip Windows builds on PRs, as the Linux amd64 build is enough of a smoke test and includes the screenshot tests
210+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests')
225211
strategy:
226212
matrix:
227213
arch: [x64, ia32, arm64]
@@ -233,17 +219,19 @@ jobs:
233219
needs: prepare_ed
234220
name: "Desktop Linux"
235221
uses: ./.github/workflows/build_desktop_linux.yaml
236-
if: inputs.skip != true
237222
strategy:
238223
matrix:
239224
sqlcipher: [system, static]
240225
arch: [amd64, arm64]
241226
runAllTests:
242227
- ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests') }}
243-
# We ship static sqlcipher builds, so delegate testing the system builds to the merge queue
244228
exclude:
229+
# We ship static sqlcipher builds, so delegate testing the system builds to the merge queue
245230
- runAllTests: false
246231
sqlcipher: system
232+
# Additionally skip arm64 system builds on PRs, as the amd64 test is enough for a smoke test and includes the screenshot tests
233+
- runAllTests: false
234+
arch: arm64
247235
with:
248236
sqlcipher: ${{ matrix.sqlcipher }}
249237
arch: ${{ matrix.arch }}
@@ -253,49 +241,53 @@ jobs:
253241
needs: prepare_ed
254242
name: "Desktop macOS"
255243
uses: ./.github/workflows/build_desktop_macos.yaml
256-
if: inputs.skip != true
244+
# Skip macOS builds on PRs, as the Linux amd64 build is enough of a smoke test and includes the screenshot tests
245+
# and we have a very low limit of concurrent macos runners (5) across the Github org.
246+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'X-Run-All-Tests')
257247
with:
258248
blob_report: true
259249

260250
complete:
261251
name: end-to-end-tests
262252
needs:
253+
- build_ew
263254
- playwright_ew
264255
- downstream-modules
256+
- prepare_ed
265257
- build_ed_windows
266258
- build_ed_linux
267259
- build_ed_macos
268260
if: always()
269261
runs-on: ubuntu-24.04
270262
steps:
271263
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
272-
if: inputs.skip != true
264+
if: needs.build_ew.outputs.skip == 'false'
273265
with:
274266
persist-credentials: false
275267
repository: element-hq/element-web
276268

277269
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
278-
if: inputs.skip != true
279-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
280-
if: inputs.skip != true
270+
if: needs.build_ew.outputs.skip == 'false'
271+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
272+
if: needs.build_ew.outputs.skip == 'false'
281273
with:
282274
cache: "pnpm"
283275
node-version: "lts/*"
284276

285277
- name: Install dependencies
286-
if: inputs.skip != true
278+
if: needs.build_ew.outputs.skip == 'false'
287279
run: pnpm install --frozen-lockfile
288280

289281
- name: Download blob reports from GitHub Actions Artifacts
290-
if: inputs.skip != true
282+
if: needs.build_ew.outputs.skip == 'false'
291283
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
292284
with:
293285
pattern: blob-report-*
294286
path: all-blob-reports
295287
merge-multiple: true
296288

297289
- name: Merge into HTML Report
298-
if: inputs.skip != true
290+
if: needs.build_ew.outputs.skip == 'false'
299291
run: |
300292
pnpm playwright merge-reports \
301293
--config=playwright-merge.config.ts \
@@ -307,8 +299,8 @@ jobs:
307299

308300
# Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
309301
- name: Upload HTML report
310-
if: always() && inputs.skip != true
311-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
302+
if: always() && needs.build_ew.outputs.skip == 'false'
303+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
312304
with:
313305
name: html-report
314306
path: playwright-report

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
persist-credentials: false
4949

5050
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
51-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
51+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
5252
with:
5353
# Disable cache on Windows as it is slower than not caching
5454
# https://github.com/actions/setup-node/issues/975
@@ -69,7 +69,7 @@ jobs:
6969
run: VERSION=$(scripts/get-version-from-git.sh) pnpm run build
7070

7171
- name: Upload Artifact
72-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
72+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
7373
with:
7474
name: webapp-${{ matrix.image }}
7575
path: apps/web/webapp

0 commit comments

Comments
 (0)