Skip to content

Commit c1abab6

Browse files
authored
Merge branch 'develop' into more-correctness
2 parents c801ea5 + 34cfa51 commit c1abab6

File tree

141 files changed

+9533
-4351
lines changed

Some content is hidden

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

141 files changed

+9533
-4351
lines changed

.editorconfig

+3
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

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module.exports = {
3131
"no-async-promise-executor": "off",
3232
// We use a `logger` intermediary module
3333
"no-console": "error",
34+
35+
// restrict EventEmitters to force callers to use TypedEventEmitter
36+
"no-restricted-imports": ["error", "events"],
3437
},
3538
overrides: [{
3639
files: [

.git-blame-ignore-revs

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Minor white-space adjustments
2+
1d1d59c75744e1f6a2be1cb3e0d1bd9ded5f8025
3+
# Import ordering and spacing: eslint-plugin-import
4+
80aaa6c32b50601f82e0c991c24e5a4590f39463
5+
# Minor white-space adjustment
6+
8fb036ba2d01fab66dc4373802ccf19b5cac8541
7+
# Minor white-space adjustment
8+
b63de6a902a9e1f8ffd7697dea33820fc04f028e
9+
3ca84cfc491b0987eec1f13f13cae58d2032bf54
10+
# Conform to new typescript eslint rules
11+
a87858840b57514603f63e2abbbda4f107f05a77
12+
5cf6684129a921295f5593173f16f192336fe0a2
13+
# Comply with new member-delimiter-style rule
14+
b2ad957d298720d3e026b6bd91be0c403338361a
15+
# Fix semicolons in TS files
16+
e2ec8952e38b8fea3f0ccaa09ecb42feeba0d923
17+
# Migrate to `eslint-plugin-matrix-org`
18+
# and `babel/...` to `@babel/...` migration
19+
09fac77ce0d9bcf6637088c29afab84084f0e739
20+
102704e91a70643bcc09721e14b0d909f0ef55c6
21+
# Eslint formatting
22+
cec00cd303787fa9008b6c48826e75ed438036fa
23+
# Minor eslint changes
24+
68bb8182e4e62d8f450f80c408c4b231b8725f1b
25+
c979ff6696e30ab8983ac416a3590996d84d3560
26+
f4a7395e3a3751a1a8e92dd302c49175a3296ad2
27+
# eslint --fix for dangley commas on function calls
28+
423175f5397910b0afe3112d6fb18283fc7d27d4
29+
# eslint ---fix for prefer-const
30+
7bca05af644e8b997dae81e568a3913d8f18d7ca
31+
# Fix linting on tests
32+
cee7f7a280a8c20bafc21c0a2911f60851f7a7ca
33+
# eslint --fix
34+
0fa9f7c6098822db1ae214f352fd1fe5c248b02c
35+
# eslint --fix for lots of white-space
36+
5abf6b9f208801c5022a47023150b5846cb0b309
37+
# eslint --fix
38+
7ed65407e6cdf292ce3cf659310c68d19dcd52b2
39+
# Switch to ESLint from JSHint (Google eslint rules as a base)
40+
e057956ede9ad1a931ff8050c411aca7907e0394
41+
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Notify Downstream Projects
2+
on:
3+
push:
4+
branches: [ develop ]
5+
jobs:
6+
notify-matrix-react-sdk:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Notify matrix-react-sdk repo that a new SDK build is on develop so it can CI against it
10+
uses: peter-evans/repository-dispatch@v1
11+
with:
12+
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
13+
repository: vector-im/element-web
14+
event-type: upstream-sdk-notify

.github/workflows/preview_changelog.yaml

-12
This file was deleted.

.github/workflows/pull_request.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request
2+
on:
3+
pull_request_target:
4+
types: [ opened, edited, labeled, unlabeled ]
5+
jobs:
6+
changelog:
7+
name: Preview Changelog
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: matrix-org/allchange@main
11+
with:
12+
ghToken: ${{ secrets.GITHUB_TOKEN }}
13+
14+
enforce-label:
15+
name: Enforce Labels
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: read
19+
steps:
20+
- uses: yogevbd/[email protected]
21+
with:
22+
REQUIRED_LABELS_ANY: "T-Defect,T-Deprecation,T-Enhancement,T-Task"
23+
BANNED_LABELS: "X-Blocked"
24+
BANNED_LABELS_DESCRIPTION: "Preventing merge whilst PR is marked blocked!"

.github/workflows/sonarqube.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: SonarQube
2+
on:
3+
workflow_run:
4+
workflows: [ "Tests" ]
5+
types:
6+
- completed
7+
jobs:
8+
sonarqube:
9+
name: SonarQube
10+
runs-on: ubuntu-latest
11+
if: github.event.workflow_run.conclusion == 'success'
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
repository: ${{ github.event.workflow_run.head_repository.full_name }}
16+
ref: ${{ github.event.workflow_run.head_branch }} # checkout commit that triggered this workflow
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
18+
19+
# fetch develop so that Sonar can identify new issues in PR builds
20+
- name: Fetch develop
21+
if: "github.event.workflow_run.head_branch != 'develop'"
22+
run: git rev-parse HEAD && git fetch origin develop:develop && git status && git rev-parse HEAD
23+
24+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
25+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
26+
- name: Download Coverage Report
27+
uses: actions/[email protected]
28+
with:
29+
script: |
30+
const artifacts = await github.actions.listWorkflowRunArtifacts({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
run_id: ${{ github.event.workflow_run.id }},
34+
});
35+
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
36+
return artifact.name == "coverage"
37+
})[0];
38+
const download = await github.actions.downloadArtifact({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
artifact_id: matchArtifact.id,
42+
archive_format: 'zip',
43+
});
44+
const fs = require('fs');
45+
fs.writeFileSync('${{github.workspace}}/coverage.zip', Buffer.from(download.data));
46+
47+
- name: Extract Coverage Report
48+
run: unzip -d coverage coverage.zip && rm coverage.zip
49+
50+
- name: Read version
51+
id: version
52+
uses: WyriHaximus/github-action-get-previous-tag@v1
53+
54+
- name: SonarCloud Scan
55+
uses: SonarSource/sonarcloud-github-action@master
56+
with:
57+
args: >
58+
-Dsonar.projectVersion=${{ steps.version.outputs.tag }}
59+
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
60+
-Dsonar.pullrequest.key=${{ github.event.workflow_run.pull_requests[0].number }}
61+
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.pull_requests[0].head.ref }}
62+
-Dsonar.pullrequest.base=${{ github.event.workflow_run.pull_requests[0].base.ref }}
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
65+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/static_analysis.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Static Analysis
2+
on:
3+
pull_request: { }
4+
push:
5+
branches: [ develop, master ]
6+
jobs:
7+
ts_lint:
8+
name: "Typescript Syntax Check"
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- uses: actions/setup-node@v3
14+
with:
15+
cache: 'yarn'
16+
17+
- name: Install Deps
18+
run: "yarn install"
19+
20+
- name: Typecheck
21+
run: "yarn run lint:types"
22+
23+
js_lint:
24+
name: "ESLint"
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- uses: actions/setup-node@v3
30+
with:
31+
cache: 'yarn'
32+
33+
- name: Install Deps
34+
run: "yarn install"
35+
36+
- name: Run Linter
37+
run: "yarn run lint:js"
38+
39+
docs:
40+
name: "JSDoc Checker"
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v2
44+
45+
- uses: actions/setup-node@v3
46+
with:
47+
cache: 'yarn'
48+
49+
- name: Install Deps
50+
run: "yarn install"
51+
52+
- name: Generate Docs
53+
run: "yarn run gendoc"

.github/workflows/tests.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tests
2+
on:
3+
pull_request: { }
4+
push:
5+
branches: [ develop, main, master ]
6+
jobs:
7+
jest:
8+
name: Jest
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Yarn cache
15+
uses: actions/setup-node@v3
16+
with:
17+
cache: 'yarn'
18+
19+
- name: Install dependencies
20+
run: "yarn install"
21+
22+
- name: Build
23+
run: "yarn build"
24+
25+
- name: Run tests with coverage
26+
run: "yarn coverage --ci"
27+
28+
- name: Upload Artifact
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: coverage
32+
path: |
33+
coverage
34+
!coverage/lcov-report
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Upgrade Dependencies
2+
on:
3+
workflow_dispatch: { }
4+
workflow_call:
5+
secrets:
6+
ELEMENT_BOT_TOKEN:
7+
required: true
8+
jobs:
9+
upgrade:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: actions/setup-node@v3
15+
with:
16+
cache: 'yarn'
17+
18+
- name: Upgrade
19+
run: yarn upgrade && yarn install
20+
21+
- name: Create Pull Request
22+
id: cpr
23+
uses: peter-evans/create-pull-request@v4
24+
with:
25+
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
26+
branch: actions/upgrade-deps
27+
delete-branch: true
28+
title: Upgrade dependencies
29+
labels: |
30+
Dependencies
31+
T-Task
32+
33+
- name: Enable automerge
34+
uses: peter-evans/enable-pull-request-automerge@v2
35+
if: steps.cpr.outputs.pull-request-operation == 'created'
36+
with:
37+
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
38+
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}

0 commit comments

Comments
 (0)