Skip to content

Commit c05c429

Browse files
t3chguygithub-merge-queue[bot]github-merge-queuerenovate[bot]florianduros
authored
Absorb the matrix-react-sdk repository (element-hq#28192)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com> Co-authored-by: github-merge-queue <github-merge-queue@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Florian Duros <florian.duros@ormaz.fr> Co-authored-by: Kim Brose <kim.brose@nordeck.net> Co-authored-by: Florian Duros <florianduros@element.io> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: dbkr <986903+dbkr@users.noreply.github.com> Co-authored-by: ElementRobot <releases@riot.im> Co-authored-by: dbkr <dbkr@users.noreply.github.com> Co-authored-by: David Baker <dbkr@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: David Langley <davidl@element.io> Co-authored-by: Michael Weimann <michaelw@matrix.org> Co-authored-by: Timshel <Timshel@users.noreply.github.com> Co-authored-by: Sahil Silare <32628578+sahil9001@users.noreply.github.com> Co-authored-by: Will Hunt <will@half-shot.uk> Co-authored-by: Hubert Chathi <hubert@uhoreg.ca> Co-authored-by: Andrew Ferrazzutti <andrewf@element.io> Co-authored-by: Robin <robin@robin.town> Co-authored-by: Tulir Asokan <tulir@maunium.net>
1 parent 2b99496 commit c05c429

File tree

3,280 files changed

+586608
-896
lines changed

Some content is hidden

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

3,280 files changed

+586608
-896
lines changed

.editorconfig

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1+
# Copyright 2024 New Vector Ltd.
12
# Copyright 2017 Aviral Dasgupta
23
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
4+
# SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
5+
# Please see LICENSE files in the repository root for full details.
146

157
root = true
168

@@ -27,3 +19,6 @@ indent_size = 4
2719

2820
[package.json]
2921
indent_size = 2
22+
23+
[*.tsx.snap]
24+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
src/vector/modernizr.js
2+
test/end-to-end-tests/node_modules/
3+
test/end-to-end-tests/element/
4+
test/end-to-end-tests/synapse/
5+
test/end-to-end-tests/lib/
26
# Legacy skinning file that some people might still have
37
src/component-index.js
48
# Auto-generated file

.eslintrc-module_system.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,12 @@ module.exports = {
4545
name: "matrix-js-sdk/src/index",
4646
message: "Please use matrix-js-sdk/src/matrix instead",
4747
},
48-
{
49-
name: "matrix-react-sdk",
50-
message: "Please use matrix-react-sdk/src/index instead",
51-
},
52-
{
53-
name: "matrix-react-sdk/",
54-
message: "Please use matrix-react-sdk/src/index instead",
55-
},
5648
],
5749
patterns: [
5850
{
5951
group: ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"],
6052
message: "Please use matrix-js-sdk/src/* instead",
6153
},
62-
{
63-
group: ["matrix-react-sdk/lib", "matrix-react-sdk/lib/", "matrix-react-sdk/lib/**"],
64-
message: "Please use matrix-react-sdk/src/* instead",
65-
},
6654
],
6755
},
6856
],

.eslintrc.js

Lines changed: 253 additions & 60 deletions
Large diffs are not rendered by default.

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# prettier
2+
526645c79160ab1ad4b4c3845de27d51263a405e
23
7921a6cbf86b035d2b0c1daecb4c24beaf5a5abc

.github/CODEOWNERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,17 @@
22
/.github/workflows/** @element-hq/element-web-team
33
/package.json @element-hq/element-web-team
44
/yarn.lock @element-hq/element-web-team
5+
6+
/src/SecurityManager.ts @element-hq/element-crypto-web-reviewers
7+
/test/SecurityManager-test.ts @element-hq/element-crypto-web-reviewers
8+
/src/async-components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
9+
/src/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
10+
/test/components/views/dialogs/security/ @element-hq/element-crypto-web-reviewers
11+
/src/stores/SetupEncryptionStore.ts @element-hq/element-crypto-web-reviewers
12+
/test/stores/SetupEncryptionStore-test.ts @element-hq/element-crypto-web-reviewers
13+
14+
# Ignore translations as those will be updated by GHA for Localazy download
515
/src/i18n/strings
16+
# Ignore the synapse plugin as this is updated by GHA for docker image updating
17+
/playwright/plugins/homeserver/synapse/index.ts
18+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
- [ ] Tests written for new code (and old code if feasible).
66
- [ ] New or updated `public`/`exported` symbols have accurate [TSDoc](https://tsdoc.org/) documentation.
77
- [ ] Linter and other CI checks pass.
8-
- [ ] Sign-off given on the changes (see [CONTRIBUTING.md](https://github.com/element-hq/element-web/blob/develop/CONTRIBUTING.md)).
8+
- [ ] I have licensed the changes to Element by completing the [Contributor License Agreement (CLA)](https://cla-assistant.io/element-hq/element-web)

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
_extends: element-hq/matrix-react-sdk
1+
_extends: matrix-org/matrix-js-sdk
22
version-resolver:
33
default: patch

.github/workflows/docs.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ jobs:
3030
with:
3131
path: element-web
3232

33-
- name: Fetch matrix-react-sdk
34-
uses: actions/checkout@v4
35-
with:
36-
repository: element-hq/matrix-react-sdk
37-
path: matrix-react-sdk
38-
3933
- name: Fetch matrix-js-sdk
4034
uses: actions/checkout@v4
4135
with:
@@ -52,7 +46,7 @@ jobs:
5246
working-directory: element-web
5347
run: |
5448
yarn install --frozen-lockfile
55-
yarn ts-node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-react-sdk ../matrix-js-sdk > docs/automations.md
49+
yarn ts-node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md
5650
echo "- [Automations](automations.md)" >> docs/SUMMARY.md
5751
5852
- name: Setup mdBook
@@ -74,9 +68,6 @@ jobs:
7468
mv element-web/docs/lib docs/
7569
mv element-web/docs "docs/Element Web"
7670
77-
mv matrix-react-sdk/README.md matrix-react-sdk/docs/
78-
mv matrix-react-sdk/docs "docs/Matrix React SDK"
79-
8071
mv matrix-js-sdk/README.md matrix-js-sdk/docs/
8172
mv matrix-js-sdk/docs "docs/Matrix JS SDK"
8273
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Triggers after the playwright tests have finished,
2+
# taking the artifact and uploading it to Netlify for easier viewing
3+
name: Upload End to End Test report to Netlify
4+
on:
5+
workflow_run:
6+
workflows: ["End to End Tests"]
7+
types:
8+
- completed
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
12+
cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }}
13+
14+
jobs:
15+
report:
16+
if: github.event.workflow_run.conclusion != 'cancelled'
17+
name: Report results
18+
runs-on: ubuntu-22.04
19+
environment: Netlify
20+
permissions:
21+
statuses: write
22+
deployments: write
23+
steps:
24+
- name: Download HTML report
25+
uses: actions/download-artifact@v4
26+
with:
27+
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
28+
run-id: ${{ github.event.workflow_run.id }}
29+
name: html-report
30+
path: playwright-report
31+
32+
- name: 📤 Deploy to Netlify
33+
uses: matrix-org/netlify-pr-preview@v3
34+
with:
35+
path: playwright-report
36+
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
37+
branch: ${{ github.event.workflow_run.head_branch }}
38+
revision: ${{ github.event.workflow_run.head_sha }}
39+
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
40+
site_id: ${{ vars.NETLIFY_SITE_ID }}
41+
desc: Playwright Report
42+
deployment_env: EndToEndTests
43+
prefix: "e2e-"
Lines changed: 176 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,190 @@
1-
# Triggers after the "Downstream artifacts" build has finished, to run the
2-
# matrix-react-sdk playwright tests (with access to repo secrets)
3-
4-
name: matrix-react-sdk End to End Tests
1+
# Produce a build of element-web with this version of react-sdk
2+
# and any matching branches of element-web and js-sdk, output it
3+
# as an artifact and run end-to-end tests.
4+
name: End to End Tests
55
on:
6+
pull_request: {}
67
merge_group:
78
types: [checks_requested]
8-
pull_request: {}
99
push:
1010
branches: [develop, master]
11+
repository_dispatch:
12+
types: [element-web-notify]
13+
14+
# support triggering from other workflows
15+
workflow_call:
16+
inputs:
17+
skip:
18+
type: boolean
19+
required: false
20+
default: false
21+
description: "A boolean to skip the playwright check itself while still creating the passing check. Useful when only running in Merge Queues."
22+
23+
matrix-js-sdk-sha:
24+
type: string
25+
required: false
26+
description: "The Git SHA of matrix-js-sdk to build against. By default, will use a matching branch name if it exists, or develop."
1127

1228
concurrency:
13-
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
14-
cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }}
29+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
30+
cancel-in-progress: true
31+
32+
env:
33+
# fetchdep.sh needs to know our PR number
34+
PR_NUMBER: ${{ github.event.pull_request.number }}
1535

1636
jobs:
37+
build:
38+
name: "Build Element-Web"
39+
runs-on: ubuntu-22.04
40+
if: inputs.skip != true
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
with:
45+
repository: element-hq/element-web
46+
47+
- uses: actions/setup-node@v4
48+
with:
49+
cache: "yarn"
50+
node-version: "lts/*"
51+
52+
- name: Fetch layered build
53+
id: layered_build
54+
env:
55+
# tell layered.sh to check out the right sha of the JS-SDK & EW, if they were given one
56+
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
57+
run: |
58+
scripts/layered.sh
59+
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
60+
VECTOR_SHA=$(git rev-parse --short=12 HEAD)
61+
echo "VERSION=$VECTOR_SHA--js-$JSSDK_SHA" >> $GITHUB_OUTPUT
62+
63+
- name: Copy config
64+
run: cp element.io/develop/config.json config.json
65+
66+
- name: Build
67+
env:
68+
CI_PACKAGE: true
69+
VERSION: "${{ steps.layered_build.outputs.VERSION }}"
70+
run: |
71+
yarn build
72+
echo $VERSION > webapp/version
73+
74+
- name: Upload Artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: webapp
78+
path: webapp
79+
retention-days: 1
80+
1781
playwright:
18-
name: Playwright
19-
uses: element-hq/matrix-react-sdk/.github/workflows/end-to-end-tests.yaml@develop
82+
name: "Run Tests ${{ matrix.runner }}/${{ strategy.job-total }}"
83+
needs: build
84+
if: inputs.skip != true
85+
runs-on: ubuntu-22.04
2086
permissions:
2187
actions: read
2288
issues: read
2389
pull-requests: read
24-
with:
25-
element-web-sha: ${{ github.sha }}
26-
react-sdk-repository: element-hq/matrix-react-sdk
27-
# We only want to run the playwright tests on merge queue to prevent regressions
28-
# from creeping in. They take a long time to run and consume multiple concurrent runners.
29-
skip: ${{ github.event_name != 'merge_group' }}
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
# Run multiple instances in parallel to speed up the tests
94+
runner: [1, 2, 3, 4, 5, 6]
95+
steps:
96+
- uses: actions/checkout@v4
97+
with:
98+
persist-credentials: false
99+
repository: element-hq/element-web
100+
101+
- name: 📥 Download artifact
102+
uses: actions/download-artifact@v4
103+
with:
104+
name: webapp
105+
path: webapp
106+
107+
- uses: actions/setup-node@v4
108+
with:
109+
cache: "yarn"
110+
cache-dependency-path: yarn.lock
111+
node-version: "lts/*"
112+
113+
- name: Install dependencies
114+
run: yarn install --frozen-lockfile
115+
116+
- name: Get installed Playwright version
117+
id: playwright
118+
run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[].name')" >> $GITHUB_OUTPUT
119+
120+
- name: Cache playwright binaries
121+
uses: actions/cache@v4
122+
id: playwright-cache
123+
with:
124+
path: |
125+
~/.cache/ms-playwright
126+
key: ${{ runner.os }}-playwright-${{ steps.playwright.outputs.version }}
127+
128+
- name: Install Playwright browsers
129+
if: steps.playwright-cache.outputs.cache-hit != 'true'
130+
run: yarn playwright install --with-deps
131+
132+
- name: Run Playwright tests
133+
run: yarn playwright test --shard ${{ matrix.runner }}/${{ strategy.job-total }}
134+
135+
- name: Upload blob report to GitHub Actions Artifacts
136+
if: always()
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: all-blob-reports-${{ matrix.runner }}
140+
path: blob-report
141+
retention-days: 1
142+
143+
complete:
144+
name: end-to-end-tests
145+
needs: playwright
146+
if: always()
147+
runs-on: ubuntu-22.04
148+
steps:
149+
- uses: actions/checkout@v4
150+
if: inputs.skip != true
151+
with:
152+
persist-credentials: false
153+
repository: element-hq/element-web
154+
155+
- uses: actions/setup-node@v4
156+
if: inputs.skip != true
157+
with:
158+
cache: "yarn"
159+
node-version: "lts/*"
160+
161+
- name: Install dependencies
162+
if: inputs.skip != true
163+
run: yarn install --frozen-lockfile
164+
165+
- name: Download blob reports from GitHub Actions Artifacts
166+
if: inputs.skip != true
167+
uses: actions/download-artifact@v4
168+
with:
169+
pattern: all-blob-reports-*
170+
path: all-blob-reports
171+
merge-multiple: true
172+
173+
- name: Merge into HTML Report
174+
if: inputs.skip != true
175+
run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts,./playwright/stale-screenshot-reporter.ts ./all-blob-reports
176+
env:
177+
# Only pass creds to the flaky-reporter on main branch runs
178+
GITHUB_TOKEN: ${{ github.ref_name == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
179+
180+
# Upload the HTML report even if one of our reporters fails, this can happen when stale screenshots are detected
181+
- name: Upload HTML report
182+
if: always() && inputs.skip != true
183+
uses: actions/upload-artifact@v4
184+
with:
185+
name: html-report
186+
path: playwright-report
187+
retention-days: 14
188+
189+
- if: needs.playwright.result != 'skipped' && needs.playwright.result != 'success'
190+
run: exit 1

0 commit comments

Comments
 (0)