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

Commit ca3beec

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feature/improved-call-view
Signed-off-by: Šimon Brandner <[email protected]>
2 parents 301289f + 319ed3a commit ca3beec

File tree

473 files changed

+15672
-6909
lines changed

Some content is hidden

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

473 files changed

+15672
-6909
lines changed

.eslintrc.js

+92-23
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,36 @@ module.exports = {
4040
),
4141
],
4242

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+
4373
// There are too many a11y violations to fix at once
4474
// Turn violated rules off until they are fixed
4575
"jsx-a11y/alt-text": "off",
@@ -57,32 +87,71 @@ module.exports = {
5787
"jsx-a11y/role-supports-aria-props": "off",
5888
"jsx-a11y/tabindex-no-positive": "off",
5989
},
60-
overrides: [{
61-
files: [
62-
"src/**/*.{ts,tsx}",
63-
"test/**/*.{ts,tsx}",
64-
],
65-
extends: [
66-
"plugin:matrix-org/typescript",
67-
"plugin:matrix-org/react",
68-
],
69-
rules: {
70-
// Things we do that break the ideal style
71-
"prefer-promise-reject-errors": "off",
72-
"quotes": "off",
73-
"no-extra-boolean-cast": "off",
90+
overrides: [
91+
{
92+
files: [
93+
"src/**/*.{ts,tsx}",
94+
"test/**/*.{ts,tsx}",
95+
],
96+
extends: [
97+
"plugin:matrix-org/typescript",
98+
"plugin:matrix-org/react",
99+
],
100+
rules: {
101+
// Things we do that break the ideal style
102+
"prefer-promise-reject-errors": "off",
103+
"quotes": "off",
104+
"no-extra-boolean-cast": "off",
74105

75-
// Remove Babel things manually due to override limitations
76-
"@babel/no-invalid-this": ["off"],
106+
// Remove Babel things manually due to override limitations
107+
"@babel/no-invalid-this": ["off"],
77108

78-
// We're okay being explicit at the moment
79-
"@typescript-eslint/no-empty-interface": "off",
80-
// We disable this while we're transitioning
81-
"@typescript-eslint/no-explicit-any": "off",
82-
// We'd rather not do this but we do
83-
"@typescript-eslint/ban-ts-comment": "off",
109+
// We're okay being explicit at the moment
110+
"@typescript-eslint/no-empty-interface": "off",
111+
// We disable this while we're transitioning
112+
"@typescript-eslint/no-explicit-any": "off",
113+
// We'd rather not do this but we do
114+
"@typescript-eslint/ban-ts-comment": "off",
115+
},
84116
},
85-
}],
117+
// temporary override for offending icon require files
118+
{
119+
files: [
120+
"src/SdkConfig.ts",
121+
"src/components/structures/FileDropTarget.tsx",
122+
"src/components/structures/RoomStatusBar.tsx",
123+
"src/components/structures/UserMenu.tsx",
124+
"src/components/views/avatars/WidgetAvatar.tsx",
125+
"src/components/views/dialogs/AddExistingToSpaceDialog.tsx",
126+
"src/components/views/dialogs/CreateSpaceFromCommunityDialog.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+
],
86155
settings: {
87156
react: {
88157
version: "detect",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Move pull requests asking for review to the relevant project
2+
on:
3+
pull_request_target:
4+
types: [review_requested]
5+
6+
jobs:
7+
add_design_pr_to_project:
8+
name: Move PRs asking for design review to the design board
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: octokit/[email protected]
12+
id: find_team_members
13+
with:
14+
headers: '{"GraphQL-Features": "projects_next_graphql"}'
15+
query: |
16+
query find_team_members($team: String!) {
17+
organization(login: "matrix-org") {
18+
team(slug: $team) {
19+
members {
20+
nodes {
21+
login
22+
}
23+
}
24+
}
25+
}
26+
}
27+
team: ${{ env.TEAM }}
28+
env:
29+
TEAM: "design"
30+
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
31+
- id: any_matching_reviewers
32+
run: |
33+
# Fetch requested reviewers, and people who are on the team
34+
echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
35+
echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
36+
jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
37+
jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
38+
39+
# Fetch requested team reviewers, and the name of the team
40+
echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
41+
jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
42+
echo '${{ env.TEAM }}' | tee /tmp/team.txt
43+
44+
# If either a reviewer matches a team member, or a team matches our team, say "true"
45+
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
46+
echo "::set-output name=match::true"
47+
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
48+
echo "::set-output name=match::true"
49+
else
50+
echo "::set-output name=match::false"
51+
fi
52+
env:
53+
TEAM: "design"
54+
- uses: octokit/[email protected]
55+
id: add_to_project
56+
if: steps.any_matching_reviewers.outputs.match == 'true'
57+
with:
58+
headers: '{"GraphQL-Features": "projects_next_graphql"}'
59+
query: |
60+
mutation add_to_project($projectid:ID!, $contentid:ID!) {
61+
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
62+
projectNextItem {
63+
id
64+
}
65+
}
66+
}
67+
projectid: ${{ env.PROJECT_ID }}
68+
contentid: ${{ github.event.pull_request.node_id }}
69+
env:
70+
PROJECT_ID: "PN_kwDOAM0swc0sUA"
71+
TEAM: "design"
72+
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
73+
74+
add_product_pr_to_project:
75+
name: Move PRs asking for design review to the design board
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: octokit/[email protected]
79+
id: find_team_members
80+
with:
81+
headers: '{"GraphQL-Features": "projects_next_graphql"}'
82+
query: |
83+
query find_team_members($team: String!) {
84+
organization(login: "matrix-org") {
85+
team(slug: $team) {
86+
members {
87+
nodes {
88+
login
89+
}
90+
}
91+
}
92+
}
93+
}
94+
team: ${{ env.TEAM }}
95+
env:
96+
TEAM: "product"
97+
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
98+
- id: any_matching_reviewers
99+
run: |
100+
# Fetch requested reviewers, and people who are on the team
101+
echo '${{ tojson(fromjson(steps.find_team_members.outputs.data).organization.team.members.nodes[*].login) }}' | tee /tmp/team_members.json
102+
echo '${{ tojson(github.event.pull_request.requested_reviewers[*].login) }}' | tee /tmp/reviewers.json
103+
jq --raw-output .[] < /tmp/team_members.json | sort | tee /tmp/team_members.txt
104+
jq --raw-output .[] < /tmp/reviewers.json | sort | tee /tmp/reviewers.txt
105+
106+
# Fetch requested team reviewers, and the name of the team
107+
echo '${{ tojson(github.event.pull_request.requested_teams[*].slug) }}' | tee /tmp/team_reviewers.json
108+
jq --raw-output .[] < /tmp/team_reviewers.json | sort | tee /tmp/team_reviewers.txt
109+
echo '${{ env.TEAM }}' | tee /tmp/team.txt
110+
111+
# If either a reviewer matches a team member, or a team matches our team, say "true"
112+
if [ $(join /tmp/team_members.txt /tmp/reviewers.txt | wc -l) != 0 ]; then
113+
echo "::set-output name=match::true"
114+
elif [ $(join /tmp/team.txt /tmp/team_reviewers.txt | wc -l) != 0 ]; then
115+
echo "::set-output name=match::true"
116+
else
117+
echo "::set-output name=match::false"
118+
fi
119+
env:
120+
TEAM: "product"
121+
- uses: octokit/[email protected]
122+
id: add_to_project
123+
if: steps.any_matching_reviewers.outputs.match == 'true'
124+
with:
125+
headers: '{"GraphQL-Features": "projects_next_graphql"}'
126+
query: |
127+
mutation add_to_project($projectid:ID!, $contentid:ID!) {
128+
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
129+
projectNextItem {
130+
id
131+
}
132+
}
133+
}
134+
projectid: ${{ env.PROJECT_ID }}
135+
contentid: ${{ github.event.pull_request.node_id }}
136+
env:
137+
PROJECT_ID: "PN_kwDOAM0swc4AAg6N"
138+
TEAM: "product"
139+
GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}

0 commit comments

Comments
 (0)