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

Commit 797fece

Browse files
author
Germain Souquet
committed
Merge branch 'develop' into gsouquet/new-search-ordering
2 parents 92d2a48 + b5ac949 commit 797fece

File tree

226 files changed

+8744
-10276
lines changed

Some content is hidden

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

226 files changed

+8744
-10276
lines changed

.github/codecov.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
branches: [ develop, master ]
99
repository_dispatch:
1010
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 }}
1115
jobs:
1216
build:
1317
name: "Build Element-Web"
1418
runs-on: ubuntu-latest
15-
env:
16-
# This must be set for fetchdep.sh to get the right branch
17-
PR_NUMBER: ${{github.event.number}}
1819
steps:
1920
- uses: actions/checkout@v2
2021

@@ -90,9 +91,6 @@ jobs:
9091
app-tests:
9192
name: Element Web Integration Tests
9293
runs-on: ubuntu-latest
93-
env:
94-
# This must be set for fetchdep.sh to get the right branch
95-
PR_NUMBER: ${{github.event.number}}
9694
steps:
9795
- uses: actions/checkout@v2
9896

.github/workflows/end-to-end-tests.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ on:
99
branches: [ develop ]
1010
repository_dispatch:
1111
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 }}
1216
jobs:
1317
end-to-end:
1418
runs-on: ubuntu-latest
15-
env:
16-
# This must be set for fetchdep.sh to get the right branch
17-
PR_NUMBER: ${{github.event.number}}
1819
container: vectorim/element-web-ci-e2etests-env:latest
1920
steps:
2021
- name: Checkout code

.github/workflows/netlify.yaml

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,40 @@ jobs:
2525
echo "PR number: $pr_number"
2626
echo "::set-output name=prnumber::$pr_number"
2727
28-
- name: Create Deployment ID
29-
uses: altinukshini/deployment-action@v1.2.6
28+
- name: Create Deployment
29+
uses: bobheadxi/deployments@v1
3030
id: deployment
3131
with:
32-
token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
33-
pr: true
34-
pr_id: ${{ steps.readctx.outputs.prnumber }}
35-
transient_environment: true
36-
environment: Netlify
37-
initial_status: in_progress
32+
step: start
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
env: Netlify
3835
ref: ${{ github.event.workflow_run.head_sha }}
36+
desc: |
37+
Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
38+
Exercise caution. Use test accounts.
3939
40-
# There's a 'download artifact' action but it hasn't been updated for the
40+
# There's a 'download artifact' action, but it hasn't been updated for the
4141
# workflow_run action (https://github.com/actions/download-artifact/issues/60)
4242
# so instead we get this mess:
4343
- name: 'Download artifact'
4444
uses: actions/[email protected]
4545
with:
4646
script: |
47-
var artifacts = await github.actions.listWorkflowRunArtifacts({
48-
owner: context.repo.owner,
49-
repo: context.repo.repo,
50-
run_id: ${{github.event.workflow_run.id }},
47+
const artifacts = await github.actions.listWorkflowRunArtifacts({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
run_id: ${{ github.event.workflow_run.id }},
5151
});
52-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
53-
return artifact.name == "previewbuild"
52+
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
53+
return artifact.name == "previewbuild"
5454
})[0];
55-
var download = await github.actions.downloadArtifact({
56-
owner: context.repo.owner,
57-
repo: context.repo.repo,
58-
artifact_id: matchArtifact.id,
59-
archive_format: 'zip',
55+
const download = await github.actions.downloadArtifact({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
artifact_id: matchArtifact.id,
59+
archive_format: 'zip',
6060
});
61-
var fs = require('fs');
61+
const fs = require('fs');
6262
fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
6363
6464
- name: Extract Artifacts
@@ -79,25 +79,17 @@ jobs:
7979
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
8080
timeout-minutes: 1
8181

82-
- name: Update deployment status (success)
83-
if: success()
84-
uses: altinukshini/[email protected]
82+
- name: Update deployment status
83+
uses: bobheadxi/deployments@v1
84+
if: always()
8585
with:
86-
token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
87-
environment_url: ${{ steps.netlify.outputs.deploy-url }}
88-
state: "success"
86+
step: finish
87+
override: false
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
status: ${{ job.status }}
90+
env: ${{ steps.deployment.outputs.env }}
8991
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
90-
pr: true
91-
pr_id: ${{ steps.readctx.outputs.prnumber }}
92-
description: |
92+
env_url: ${{ steps.netlify.outputs.deploy-url }}
93+
desc: |
9394
Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
9495
Exercise caution. Use test accounts.
95-
- name: Update deployment status (failure)
96-
if: failure()
97-
uses: altinukshini/[email protected]
98-
with:
99-
token: "${{ secrets.ELEMENT_BOT_TOKEN }}"
100-
state: "failure"
101-
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
102-
pr: true
103-
pr_id: ${{ steps.readctx.outputs.prnumber }}

.github/workflows/preview_changelog.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/pull_request.yaml

Lines changed: 24 additions & 0 deletions
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-Enhancement,T-Task"
23+
BANNED_LABELS: "X-Blocked"
24+
BANNED_LABELS_DESCRIPTION: "Preventing merge whilst PR is marked blocked!"

.github/workflows/sonarqube.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
17+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
18+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
19+
- name: Download Coverage Report
20+
uses: actions/[email protected]
21+
with:
22+
script: |
23+
const artifacts = await github.actions.listWorkflowRunArtifacts({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
run_id: ${{ github.event.workflow_run.id }},
27+
});
28+
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
29+
return artifact.name == "coverage"
30+
})[0];
31+
const download = await github.actions.downloadArtifact({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
artifact_id: matchArtifact.id,
35+
archive_format: 'zip',
36+
});
37+
const fs = require('fs');
38+
fs.writeFileSync('${{github.workspace}}/coverage.zip', Buffer.from(download.data));
39+
40+
- name: Extract Coverage Report
41+
run: unzip -d coverage coverage.zip && rm coverage.zip
42+
43+
- name: SonarCloud Scan
44+
uses: SonarSource/sonarcloud-github-action@master
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
47+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/static_analysis.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
branches: [ develop, master ]
66
repository_dispatch:
77
types: [ upstream-sdk-notify ]
8+
env:
9+
# These must be set for fetchdep.sh to get the right branch
10+
REPOSITORY: ${{ github.repository }}
11+
PR_NUMBER: ${{ github.event.pull_request.number }}
812
jobs:
913
ts_lint:
1014
name: "Typescript Syntax Check"
1115
runs-on: ubuntu-latest
12-
env:
13-
# This must be set for fetchdep.sh to get the right branch
14-
PR_NUMBER: ${{github.event.number}}
1516
steps:
1617
- uses: actions/checkout@v2
1718

@@ -37,11 +38,32 @@ jobs:
3738
run: "yarn run lint:types"
3839

3940
i18n_lint:
40-
name: "i18n Diff Check"
41+
name: "i18n Check"
4142
runs-on: ubuntu-latest
43+
permissions:
44+
pull-requests: read
4245
steps:
4346
- uses: actions/checkout@v2
4447

48+
- name: "Get modified files"
49+
id: changed_files
50+
if: github.event_name == 'pull_request' && github.actor != 'RiotTranslateBot'
51+
uses: tj-actions/changed-files@v19
52+
with:
53+
files: |
54+
src/i18n/strings/*
55+
files_ignore: |
56+
src/i18n/strings/en_EN.json
57+
58+
- name: "Assert only en_EN was modified"
59+
if: |
60+
github.event_name == 'pull_request' &&
61+
github.actor != 'RiotTranslateBot' &&
62+
steps.changed_files.outputs.any_modified == 'true'
63+
run: |
64+
echo "You can only modify en_EN.json, do not touch any of the other i18n files as Weblate will be confused"
65+
exit 1
66+
4567
- uses: actions/setup-node@v3
4668
with:
4769
cache: 'yarn'

.github/workflows/tests.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ on:
55
branches: [ develop, master ]
66
repository_dispatch:
77
types: [ upstream-sdk-notify ]
8+
env:
9+
# These must be set for fetchdep.sh to get the right branch
10+
REPOSITORY: ${{ github.repository }}
11+
PR_NUMBER: ${{ github.event.pull_request.number }}
812
jobs:
913
jest:
10-
name: Jest with Codecov
14+
name: Jest
1115
runs-on: ubuntu-latest
12-
env:
13-
# This must be set for fetchdep.sh to get the right branch
14-
PR_NUMBER: ${{github.event.number}}
1516
steps:
1617
- name: Checkout code
1718
uses: actions/checkout@v2
18-
with:
19-
# If this is a pull request, make sure we check out its head rather than the
20-
# automatically generated merge commit, so that the coverage diff excludes
21-
# unrelated changes in the base branch
22-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
2319

2420
- name: Yarn cache
2521
uses: actions/setup-node@v3
@@ -30,11 +26,12 @@ jobs:
3026
run: "./scripts/ci/install-deps.sh --ignore-scripts"
3127

3228
- name: Run tests with coverage
33-
run: "yarn coverage"
29+
run: "yarn coverage --ci"
3430

35-
- name: Upload coverage
36-
uses: codecov/codecov-action@v2
31+
- name: Upload Artifact
32+
uses: actions/upload-artifact@v2
3733
with:
38-
fail_ci_if_error: false
39-
verbose: true
40-
override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
34+
name: coverage
35+
path: |
36+
coverage
37+
!coverage/lcov-report
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Upgrade Dependencies
2+
on:
3+
workflow_dispatch: { }
4+
jobs:
5+
upgrade:
6+
uses: matrix-org/matrix-js-sdk/.github/workflows/upgrade_dependencies.yml@develop
7+
secrets:
8+
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
[![npm](https://img.shields.io/npm/v/matrix-react-sdk)](https://www.npmjs.com/package/matrix-react-sdk)
2+
![Tests](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/tests.yml/badge.svg)
3+
![Static Analysis](https://github.com/matrix-org/matrix-react-sdk/actions/workflows/static_analysis.yaml/badge.svg)
4+
[![Weblate](https://translate.element.io/widgets/element-web/-/matrix-react-sdk/svg-badge.svg)](https://translate.element.io/engage/element-web/)
5+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=matrix-react-sdk&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=matrix-react-sdk)
6+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=matrix-react-sdk&metric=coverage)](https://sonarcloud.io/summary/new_code?id=matrix-react-sdk)
7+
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=matrix-react-sdk&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=matrix-react-sdk)
8+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=matrix-react-sdk&metric=bugs)](https://sonarcloud.io/summary/new_code?id=matrix-react-sdk)
9+
110
matrix-react-sdk
211
================
312

0 commit comments

Comments
 (0)