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

Commit 79f8161

Browse files
Merge branch 'develop' into feature/obvious-data-change/16221
2 parents 58033ae + ad2d3a3 commit 79f8161

File tree

1,316 files changed

+89771
-44115
lines changed

Some content is hidden

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

1,316 files changed

+89771
-44115
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ insert_final_newline = true
2121
indent_style = space
2222
indent_size = 4
2323
trim_trailing_whitespace = true
24+
25+
[*.{yml,yaml}]
26+
indent_size = 2

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
src/component-index.js
21
test/end-to-end-tests/node_modules/
32
test/end-to-end-tests/element/
43
test/end-to-end-tests/synapse/
54
test/end-to-end-tests/lib/
5+
# Legacy skinning file that some people might still have
6+
src/component-index.js

.eslintrc.js

Lines changed: 113 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
module.exports = {
2-
plugins: ["matrix-org"],
2+
plugins: [
3+
"matrix-org",
4+
],
35
extends: [
46
"plugin:matrix-org/babel",
57
"plugin:matrix-org/react",
8+
"plugin:matrix-org/a11y",
69
],
710
env: {
811
browser: true,
@@ -36,33 +39,119 @@ module.exports = {
3639
"Use Media helper instead to centralise access for customisation.",
3740
),
3841
],
42+
43+
// Ban matrix-js-sdk/src imports in favour of matrix-js-sdk/src/matrix imports to prevent unleashing hell.
44+
"no-restricted-imports": ["error", {
45+
"paths": [{
46+
"name": "matrix-js-sdk",
47+
"message": "Please use matrix-js-sdk/src/matrix instead",
48+
}, {
49+
"name": "matrix-js-sdk/",
50+
"message": "Please use matrix-js-sdk/src/matrix instead",
51+
}, {
52+
"name": "matrix-js-sdk/src",
53+
"message": "Please use matrix-js-sdk/src/matrix instead",
54+
}, {
55+
"name": "matrix-js-sdk/src/",
56+
"message": "Please use matrix-js-sdk/src/matrix instead",
57+
}, {
58+
"name": "matrix-js-sdk/src/index",
59+
"message": "Please use matrix-js-sdk/src/matrix instead",
60+
}, {
61+
"name": "matrix-react-sdk",
62+
"message": "Please use matrix-react-sdk/src/index instead",
63+
}, {
64+
"name": "matrix-react-sdk/",
65+
"message": "Please use matrix-react-sdk/src/index instead",
66+
}],
67+
"patterns": [{
68+
"group": ["matrix-js-sdk/lib", "matrix-js-sdk/lib/", "matrix-js-sdk/lib/**"],
69+
"message": "Please use matrix-js-sdk/src/* instead",
70+
}],
71+
}],
72+
73+
// There are too many a11y violations to fix at once
74+
// Turn violated rules off until they are fixed
75+
"jsx-a11y/alt-text": "off",
76+
"jsx-a11y/aria-activedescendant-has-tabindex": "off",
77+
"jsx-a11y/click-events-have-key-events": "off",
78+
"jsx-a11y/interactive-supports-focus": "off",
79+
"jsx-a11y/label-has-associated-control": "off",
80+
"jsx-a11y/media-has-caption": "off",
81+
"jsx-a11y/mouse-events-have-key-events": "off",
82+
"jsx-a11y/no-autofocus": "off",
83+
"jsx-a11y/no-noninteractive-element-interactions": "off",
84+
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
85+
"jsx-a11y/no-noninteractive-tabindex": "off",
86+
"jsx-a11y/no-static-element-interactions": "off",
87+
"jsx-a11y/role-supports-aria-props": "off",
88+
"jsx-a11y/tabindex-no-positive": "off",
3989
},
40-
overrides: [{
41-
files: [
42-
"src/**/*.{ts,tsx}",
43-
"test/**/*.{ts,tsx}",
44-
],
45-
extends: [
46-
"plugin:matrix-org/typescript",
47-
"plugin:matrix-org/react",
48-
],
49-
rules: {
50-
// Things we do that break the ideal style
51-
"prefer-promise-reject-errors": "off",
52-
"quotes": "off",
53-
"no-extra-boolean-cast": "off",
90+
overrides: [
91+
{
92+
files: [
93+
"src/**/*.{ts,tsx}",
94+
"test/**/*.{ts,tsx}",
95+
"cypress/**/*.ts",
96+
],
97+
extends: [
98+
"plugin:matrix-org/typescript",
99+
"plugin:matrix-org/react",
100+
],
101+
rules: {
102+
// Things we do that break the ideal style
103+
"prefer-promise-reject-errors": "off",
104+
"quotes": "off",
105+
"no-extra-boolean-cast": "off",
54106

55-
// Remove Babel things manually due to override limitations
56-
"@babel/no-invalid-this": ["off"],
107+
// Remove Babel things manually due to override limitations
108+
"@babel/no-invalid-this": ["off"],
57109

58-
// We're okay being explicit at the moment
59-
"@typescript-eslint/no-empty-interface": "off",
60-
// We disable this while we're transitioning
61-
"@typescript-eslint/no-explicit-any": "off",
62-
// We'd rather not do this but we do
63-
"@typescript-eslint/ban-ts-comment": "off",
110+
// We're okay being explicit at the moment
111+
"@typescript-eslint/no-empty-interface": "off",
112+
// We disable this while we're transitioning
113+
"@typescript-eslint/no-explicit-any": "off",
114+
// We'd rather not do this but we do
115+
"@typescript-eslint/ban-ts-comment": "off",
116+
},
64117
},
65-
}],
118+
// temporary override for offending icon require files
119+
{
120+
files: [
121+
"src/SdkConfig.ts",
122+
"src/components/structures/FileDropTarget.tsx",
123+
"src/components/structures/RoomStatusBar.tsx",
124+
"src/components/structures/UserMenu.tsx",
125+
"src/components/views/avatars/WidgetAvatar.tsx",
126+
"src/components/views/dialogs/AddExistingToSpaceDialog.tsx",
127+
"src/components/views/dialogs/ForwardDialog.tsx",
128+
"src/components/views/dialogs/InviteDialog.tsx",
129+
"src/components/views/dialogs/ModalWidgetDialog.tsx",
130+
"src/components/views/dialogs/UploadConfirmDialog.tsx",
131+
"src/components/views/dialogs/security/SetupEncryptionDialog.tsx",
132+
"src/components/views/elements/AddressTile.tsx",
133+
"src/components/views/elements/AppWarning.tsx",
134+
"src/components/views/elements/SSOButtons.tsx",
135+
"src/components/views/messages/MAudioBody.tsx",
136+
"src/components/views/messages/MImageBody.tsx",
137+
"src/components/views/messages/MFileBody.tsx",
138+
"src/components/views/messages/MStickerBody.tsx",
139+
"src/components/views/messages/MVideoBody.tsx",
140+
"src/components/views/messages/MVoiceMessageBody.tsx",
141+
"src/components/views/right_panel/EncryptionPanel.tsx",
142+
"src/components/views/rooms/EntityTile.tsx",
143+
"src/components/views/rooms/LinkPreviewGroup.tsx",
144+
"src/components/views/rooms/MemberList.tsx",
145+
"src/components/views/rooms/MessageComposer.tsx",
146+
"src/components/views/rooms/ReplyPreview.tsx",
147+
"src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx",
148+
"src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx"
149+
],
150+
rules: {
151+
"@typescript-eslint/no-var-requires": "off",
152+
},
153+
}
154+
],
66155
settings: {
67156
react: {
68157
version: "detect",

.github/codecov.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
codecov:
2+
allow_coverage_offsets: True
3+
coverage:
4+
status:
5+
project: off
6+
patch: off
7+
comment:
8+
layout: "diff, files"
9+
behavior: default
10+
require_changes: false
11+
require_base: no
12+
require_head: no

.github/workflows/develop.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 integration tests.
4+
name: Element Web - Build and Test
5+
on:
6+
pull_request: { }
7+
push:
8+
branches: [ develop, master ]
9+
repository_dispatch:
10+
types: [ upstream-sdk-notify ]
11+
env:
12+
# These must be set for fetchdep.sh to get the right branch
13+
REPOSITORY: ${{ github.repository }}
14+
PR_NUMBER: ${{ github.event.pull_request.number }}
15+
jobs:
16+
build:
17+
name: "Build Element-Web"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- uses: actions/setup-node@v3
23+
with:
24+
cache: 'yarn'
25+
26+
- name: Fetch layered build
27+
id: layered_build
28+
run: |
29+
scripts/ci/layered.sh
30+
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
31+
REACT_SHA=$(git rev-parse --short=12 HEAD)
32+
VECTOR_SHA=$(git -C element-web rev-parse --short=12 HEAD)
33+
echo "::set-output name=VERSION::$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA"
34+
35+
- name: Copy config
36+
run: cp element.io/develop/config.json config.json
37+
working-directory: ./element-web
38+
39+
- name: Build
40+
env:
41+
CI_PACKAGE: true
42+
VERSION: "${{ steps.layered_build.outputs.VERSION }}"
43+
run: yarn build
44+
working-directory: ./element-web
45+
46+
- name: Upload Artifact
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: previewbuild
50+
path: element-web/webapp
51+
# We'll only use this in a triggered job, then we're done with it
52+
retention-days: 1
53+
54+
cypress:
55+
name: "Cypress End to End Tests"
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v2
60+
61+
- name: Download build
62+
uses: actions/download-artifact@v3
63+
with:
64+
name: previewbuild
65+
path: webapp
66+
67+
- name: Run Cypress tests
68+
uses: cypress-io/github-action@v2
69+
with:
70+
# The built in Electron runner seems to grind to a halt trying
71+
# to run the tests, so use chrome.
72+
browser: chrome
73+
start: npx serve -p 8080 webapp
74+
record: true
75+
env:
76+
# pass the Dashboard record key as an environment variable
77+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
78+
# pass GitHub token to allow accurately detecting a build vs a re-run build
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Upload Artifact
82+
if: failure()
83+
uses: actions/upload-artifact@v2
84+
with:
85+
name: cypress-results
86+
path: |
87+
cypress/screenshots
88+
cypress/videos
89+
cypress/synapselogs
90+
91+
app-tests:
92+
name: Element Web Integration Tests
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v2
96+
97+
- uses: actions/setup-node@v3
98+
with:
99+
cache: 'yarn'
100+
101+
- name: Run tests
102+
run: "./scripts/ci/app-tests.sh"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: End-to-end Tests
2+
on:
3+
# These tests won't work for non-develop branches at the moment as they
4+
# won't pull in the right versions of other repos, so they're only enabled
5+
# on develop.
6+
push:
7+
branches: [ develop ]
8+
pull_request:
9+
branches: [ develop ]
10+
repository_dispatch:
11+
types: [ upstream-sdk-notify ]
12+
env:
13+
# These must be set for fetchdep.sh to get the right branch
14+
REPOSITORY: ${{ github.repository }}
15+
PR_NUMBER: ${{ github.event.pull_request.number }}
16+
jobs:
17+
end-to-end:
18+
runs-on: ubuntu-latest
19+
container: vectorim/element-web-ci-e2etests-env:latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- uses: actions/setup-node@v3
25+
with:
26+
cache: 'yarn'
27+
28+
- name: Prepare End-to-End tests
29+
run: ./scripts/ci/prepare-end-to-end-tests.sh
30+
31+
- name: Run End-to-End tests
32+
run: ./scripts/ci/run-end-to-end-tests.sh
33+
34+
- name: Archive logs
35+
uses: actions/upload-artifact@v2
36+
if: ${{ always() }}
37+
with:
38+
path: |
39+
test/end-to-end-tests/logs/**/*
40+
test/end-to-end-tests/synapse/installations/consent/homeserver.log
41+
retention-days: 14
42+
43+
- name: Download previous benchmark data
44+
uses: actions/cache@v1
45+
with:
46+
path: ./cache
47+
key: ${{ runner.os }}-benchmark
48+
49+
- name: Store benchmark result
50+
uses: matrix-org/github-action-benchmark@jsperfentry-1
51+
with:
52+
tool: 'jsperformanceentry'
53+
output-file-path: test/end-to-end-tests/performance-entries.json
54+
fail-on-alert: false
55+
comment-on-alert: false
56+
# Only temporary to monitor where failures occur
57+
alert-comment-cc-users: '@gsouquet'
58+
github-token: ${{ secrets.DEPLOY_GH_PAGES }}
59+
auto-push: ${{ github.ref == 'refs/heads/develop' }}

0 commit comments

Comments
 (0)