Skip to content

Commit 4a5ee08

Browse files
committed
Merge tag 'v18.0.0' into sc
* Implement changes to MSC2285 (private read receipts) ([\matrix-org#2221](matrix-org#2221)). * Add support for HTML renderings of room topics ([\matrix-org#2272](matrix-org#2272)). * Add stopClient parameter to MatrixClient::logout ([\matrix-org#2367](matrix-org#2367)). * registration: add function to re-request email token ([\matrix-org#2357](matrix-org#2357)). * Remove hacky custom status feature ([\matrix-org#2350](matrix-org#2350)). * Remove default push rule override for MSC1930 ([\matrix-org#2376](matrix-org#2376)). Fixes element-hq/element-web#15439. * Tweak thread creation & event adding to fix bugs around relations ([\matrix-org#2369](matrix-org#2369)). Fixes element-hq/element-web#22162 and element-hq/element-web#22180. * Prune both clear & wire content on redaction ([\matrix-org#2346](matrix-org#2346)). Fixes element-hq/element-web#21929. * MSC3786: Add a default push rule to ignore `m.room.server_acl` events ([\matrix-org#2333](matrix-org#2333)). Fixes element-hq/element-web#20788.
2 parents a7e6126 + 58a5742 commit 4a5ee08

Some content is hidden

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

70 files changed

+1811
-817
lines changed

.github/workflows/notify-downstream.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@ name: Notify Downstream Projects
22
on:
33
push:
44
branches: [ develop ]
5+
concurrency: ${{ github.workflow }}-${{ github.ref }}
56
jobs:
6-
notify-matrix-react-sdk:
7+
notify-downstream:
8+
continue-on-error: true
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- repo: vector-im/element-web
14+
event: element-web-notify
15+
- repo: matrix-org/matrix-react-sdk
16+
event: upstream-sdk-notify
17+
718
runs-on: ubuntu-latest
819
steps:
920
- name: Notify matrix-react-sdk repo that a new SDK build is on develop so it can CI against it
1021
uses: peter-evans/repository-dispatch@v1
1122
with:
1223
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
13-
repository: vector-im/element-web
14-
event-type: upstream-sdk-notify
24+
repository: ${{ matrix.repo }}
25+
event-type: ${{ matrix.event }}

.github/workflows/pr_details.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Find details about the PR associated with this ref
2+
# Outputs:
3+
# prnumber: the ID number of the associated PR
4+
# headref: the name of the head branch of the PR
5+
# baseref: the name of the base branch of the PR
6+
name: PR Details
7+
on:
8+
workflow_call:
9+
inputs:
10+
owner:
11+
type: string
12+
required: true
13+
description: The github username of the owner of the head branch
14+
branch:
15+
type: string
16+
required: true
17+
description: The name of the head branch
18+
outputs:
19+
pr_id:
20+
description: The ID of the PR found
21+
value: ${{ jobs.prdetails.outputs.pr_id }}
22+
head_branch:
23+
description: The head branch of the PR found
24+
value: ${{ jobs.prdetails.outputs.head_branch }}
25+
base_branch:
26+
description: The base branch of the PR found
27+
value: ${{ jobs.prdetails.outputs.base_branch }}
28+
29+
jobs:
30+
prdetails:
31+
name: Find PR Details
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: "🔍 Read PR details"
35+
id: details
36+
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
37+
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
38+
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
39+
run: |
40+
head_branch='${{ inputs.owner }}:${{ inputs.branch }}'
41+
echo "Head branch: $head_branch"
42+
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
43+
pr_data=$(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri")
44+
45+
pr_number=$(jq -r '.[] | .number' <<< "$pr_data")
46+
echo "PR number: $pr_number"
47+
echo "::set-output name=prnumber::$pr_number"
48+
49+
head_ref=$(jq -r '.[] | .head.ref' <<< "$pr_data")
50+
echo "Head ref: $head_ref"
51+
echo "::set-output name=headref::$head_ref"
52+
53+
base_ref=$(jq -r '.[] | .base.ref' <<< "$pr_data")
54+
echo "Base ref: $base_ref"
55+
echo "::set-output name=baseref::$base_ref"
56+
outputs:
57+
pr_id: ${{ steps.details.outputs.prnumber }}
58+
head_branch: ${{ steps.details.outputs.headref }}
59+
base_branch: ${{ steps.details.outputs.baseref }}

.github/workflows/pull_request.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Pull Request
22
on:
33
pull_request_target:
4-
types: [ opened, edited, labeled, unlabeled ]
4+
types: [ opened, edited, labeled, unlabeled, synchronize ]
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
58
jobs:
69
changelog:
710
name: Preview Changelog
11+
if: github.event.action != 'synchronize'
812
runs-on: ubuntu-latest
913
steps:
1014
- uses: matrix-org/allchange@main

.github/workflows/sonarcloud.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: SonarCloud
2+
on:
3+
workflow_call:
4+
inputs:
5+
repo:
6+
type: string
7+
required: true
8+
description: The full name of the repo in org/repo format
9+
head_branch:
10+
type: string
11+
required: true
12+
description: The name of the head branch
13+
# We cannot use ${{ github.sha }} here as for pull requests it'll be a simulated merge commit instead
14+
revision:
15+
type: string
16+
required: true
17+
description: The git revision with which this sonar run should be associated
18+
19+
# Coverage specific parameters, assumes coverage reports live in a /coverage/ directory
20+
coverage_workflow_name:
21+
type: string
22+
required: false
23+
description: The name of the workflow which uploaded the `coverage` artifact, if any
24+
coverage_run_id:
25+
type: string
26+
required: false
27+
description: The run_id of the workflow which upload the coverage relevant to this run
28+
29+
# PR specific parameters
30+
pr_id:
31+
type: string
32+
required: false
33+
description: The ID number of the PR if this workflow is being triggered due to one
34+
base_branch:
35+
type: string
36+
required: false
37+
description: The base branch of the PR if this workflow is being triggered due to one
38+
39+
# Org specific parameters
40+
main_branch:
41+
type: string
42+
required: false
43+
description: The default branch of the repository
44+
default: "develop"
45+
secrets:
46+
SONAR_TOKEN:
47+
required: true
48+
jobs:
49+
analysis:
50+
name: Analysis
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: "🧮 Checkout code"
54+
uses: actions/checkout@v3
55+
with:
56+
repository: ${{ inputs.repo }}
57+
ref: ${{ inputs.head_branch }} # checkout commit that triggered this workflow
58+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
59+
60+
# Fetch develop so that Sonar can identify new issues in PR builds
61+
- name: "📕 Fetch ${{ inputs.main_branch }}"
62+
if: inputs.head_branch != inputs.main_branch
63+
run: git rev-parse HEAD && git fetch origin ${{ inputs.main_branch }}:${{ inputs.main_branch }} && git status && git rev-parse HEAD
64+
65+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
66+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
67+
- name: "📥 Download Coverage Report"
68+
uses: dawidd6/action-download-artifact@v2
69+
if: inputs.coverage_workflow_name
70+
with:
71+
workflow: ${{ inputs.coverage_workflow_name }}
72+
run_id: ${{ inputs.coverage_run_id }}
73+
name: coverage
74+
path: coverage
75+
76+
- name: "🔍 Read package.json version"
77+
id: version
78+
uses: martinbeentjes/npm-get-version-action@main
79+
80+
- name: "🩻 SonarCloud Scan"
81+
uses: SonarSource/sonarcloud-github-action@master
82+
with:
83+
args: >
84+
-Dsonar.projectVersion=${{ steps.version.outputs.current-version }}
85+
-Dsonar.scm.revision=${{ inputs.revision }}
86+
-Dsonar.pullrequest.key=${{ inputs.pr_id }}
87+
-Dsonar.pullrequest.branch=${{ inputs.pr_id && inputs.head_branch }}
88+
-Dsonar.pullrequest.base=${{ inputs.pr_id && inputs.base_branch }}
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
91+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonarqube.yml

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,34 @@ on:
44
workflows: [ "Tests" ]
55
types:
66
- completed
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
710
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));
11+
prdetails:
12+
name: ℹ️ PR Details
13+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
14+
uses: matrix-org/matrix-js-sdk/.github/workflows/pr_details.yml@develop
15+
with:
16+
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
17+
branch: ${{ github.event.workflow_run.head_branch }}
3918

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 }}
19+
sonarqube:
20+
name: 🩻 SonarQube
21+
needs: prdetails
22+
# Only wait for prdetails if it isn't skipped
23+
if: |
24+
always() &&
25+
(needs.prdetails.result == 'success' || needs.prdetails.result == 'skipped') &&
26+
github.event.workflow_run.conclusion == 'success'
27+
uses: matrix-org/matrix-js-sdk/.github/workflows/sonarcloud.yml@develop
28+
with:
29+
repo: ${{ github.event.workflow_run.head_repository.full_name }}
30+
pr_id: ${{ needs.prdetails.outputs.pr_id }}
31+
head_branch: ${{ needs.prdetails.outputs.head_branch || github.event.workflow_run.head_branch }}
32+
base_branch: ${{ needs.prdetails.outputs.base_branch }}
33+
revision: ${{ github.event.workflow_run.head_sha }}
34+
coverage_workflow_name: tests.yml
35+
coverage_run_id: ${{ github.event.workflow_run.id }}
36+
secrets:
37+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/static_analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request: { }
44
push:
55
branches: [ develop, master ]
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
69
jobs:
710
ts_lint:
811
name: "Typescript Syntax Check"

.github/workflows/tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: Tests
22
on:
33
pull_request: { }
44
push:
5-
branches: [ develop, main, master ]
5+
branches: [ develop, master ]
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
69
jobs:
710
jest:
811
name: Jest
Lines changed: 38 additions & 0 deletions
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 }}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Changes in [18.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v18.0.0) (2022-05-24)
2+
==================================================================================================
3+
4+
## 🚨 BREAKING CHANGES (to experimental methods)
5+
* Implement changes to MSC2285 (private read receipts) ([\#2221](https://github.com/matrix-org/matrix-js-sdk/pull/2221)).
6+
7+
## ✨ Features
8+
* Add support for HTML renderings of room topics ([\#2272](https://github.com/matrix-org/matrix-js-sdk/pull/2272)).
9+
* Add stopClient parameter to MatrixClient::logout ([\#2367](https://github.com/matrix-org/matrix-js-sdk/pull/2367)).
10+
* registration: add function to re-request email token ([\#2357](https://github.com/matrix-org/matrix-js-sdk/pull/2357)).
11+
* Remove hacky custom status feature ([\#2350](https://github.com/matrix-org/matrix-js-sdk/pull/2350)).
12+
13+
## 🐛 Bug Fixes
14+
* Remove default push rule override for MSC1930 ([\#2376](https://github.com/matrix-org/matrix-js-sdk/pull/2376)). Fixes vector-im/element-web#15439.
15+
* Tweak thread creation & event adding to fix bugs around relations ([\#2369](https://github.com/matrix-org/matrix-js-sdk/pull/2369)). Fixes vector-im/element-web#22162 and vector-im/element-web#22180.
16+
* Prune both clear & wire content on redaction ([\#2346](https://github.com/matrix-org/matrix-js-sdk/pull/2346)). Fixes vector-im/element-web#21929.
17+
* MSC3786: Add a default push rule to ignore `m.room.server_acl` events ([\#2333](https://github.com/matrix-org/matrix-js-sdk/pull/2333)). Fixes vector-im/element-web#20788.
18+
119
Changes in [17.2.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v17.2.0) (2022-05-10)
220
==================================================================================================
321

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-js-sdk",
3-
"version": "17.2.0",
3+
"version": "18.0.0",
44
"description": "Matrix Client-Server SDK for Javascript",
55
"engines": {
66
"node": ">=12.9.0"

sonar-project.properties

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
sonar.projectKey=matrix-js-sdk
22
sonar.organization=matrix-org
33

4-
# This is the name and version displayed in the SonarCloud UI.
5-
#sonar.projectName=matrix-js-sdk
6-
#sonar.projectVersion=1.0
7-
8-
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
9-
#sonar.sources=.
10-
114
# Encoding of the source code. Default is default system encoding
125
#sonar.sourceEncoding=UTF-8
136

@@ -17,5 +10,7 @@ sonar.exclusions=docs,examples,git-hooks
1710

1811
sonar.typescript.tsconfigPath=./tsconfig.json
1912
sonar.javascript.lcov.reportPaths=coverage/lcov.info
20-
sonar.coverage.exclusions=spec/*.ts
13+
sonar.coverage.exclusions=spec/**/*
2114
sonar.testExecutionReportPaths=coverage/test-report.xml
15+
16+
sonar.lang.patterns.ts=**/*.ts,**/*.tsx

0 commit comments

Comments
 (0)