Skip to content

Commit ee15b18

Browse files
committed
Merge tag 'v18.1.0' into sc
* Convert `getLocalAliases` to a stable API call ([\matrix-org#2402](matrix-org#2402)). * Fix request, crypto, and bs58 imports ([\matrix-org#2414](matrix-org#2414)). Fixes matrix-org#2415. * Update relations after every decryption attempt ([\matrix-org#2387](matrix-org#2387)). Fixes element-hq/element-web#22258. Contributed by @weeman1337. * Fix degraded mode for the IDBStore and test it ([\matrix-org#2400](matrix-org#2400)). Fixes matrix-org/element-web-rageshakes#13170. * Don't cancel SAS verifications if `ready` is received after `start` ([\matrix-org#2250](matrix-org#2250)). * Prevent overlapping sync accumulator persists ([\matrix-org#2392](matrix-org#2392)). Fixes vector-im/element-web#21541. * Fix behaviour of isRelation with relation m.replace for state events ([\matrix-org#2389](matrix-org#2389)). Fixes element-hq/element-web#22280. * Fixes matrix-org#2384 ([\matrix-org#2385](matrix-org#2385)). Fixes undefined/matrix-js-sdk#2384. Contributed by @schmop. * Ensure rooms are recalculated on re-invites ([\matrix-org#2374](matrix-org#2374)). Fixes element-hq/element-web#22106.
2 parents 4a5ee08 + bf30c15 commit ee15b18

Some content is hidden

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

46 files changed

+2142
-2630
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ module.exports = {
5252
"@typescript-eslint/no-explicit-any": "off",
5353
// We'd rather not do this but we do
5454
"@typescript-eslint/ban-ts-comment": "off",
55+
// We're okay with assertion errors when we ask for them
56+
"@typescript-eslint/no-non-null-assertion": "off",
5557

5658
"quotes": "off",
5759
// We use a `logger` intermediary module

.github/workflows/jsdoc.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release Process
2+
on:
3+
release:
4+
types: [ published ]
5+
concurrency: ${{ github.workflow }}-${{ github.ref }}
6+
jobs:
7+
jsdoc:
8+
name: Publish Documentation
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: 🧮 Checkout code
12+
uses: actions/checkout@v3
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 --pure-lockfile"
21+
22+
- name: 📖 Generate JSDoc
23+
run: "yarn gendoc"
24+
25+
- name: 📋 Copy to temp
26+
run: |
27+
ls -lah
28+
tag="${{ github.ref_name }}"
29+
version="${tag#v}"
30+
echo "VERSION=$version" >> $GITHUB_ENV
31+
cp -a "./.jsdoc/matrix-js-sdk/$version" $RUNNER_TEMP
32+
33+
- name: 🧮 Checkout gh-pages
34+
uses: actions/checkout@v3
35+
with:
36+
ref: gh-pages
37+
38+
- name: 🔪 Prepare
39+
run: |
40+
cp -a "$RUNNER_TEMP/$VERSION" .
41+
42+
# Add the new directory to the index if it isn't there already
43+
if ! grep -q "Version $VERSION" index.html; then
44+
perl -i -pe 'BEGIN {$rel=shift} $_ =~ /^<\/ul>/ && print
45+
"<li><a href=\"${rel}/index.html\">Version ${rel}</a></li>\n"' "$VERSION" index.html
46+
fi
47+
48+
- name: 🚀 Deploy
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
keep_files: true
53+
publish_dir: .

.github/workflows/pr_details.yml

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
# 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
62
name: PR Details
73
on:
84
workflow_call:
@@ -18,13 +14,16 @@ on:
1814
outputs:
1915
pr_id:
2016
description: The ID of the PR found
21-
value: ${{ jobs.prdetails.outputs.pr_id }}
17+
value: ${{ fromJSON(jobs.prdetails.outputs.result).number }}
2218
head_branch:
2319
description: The head branch of the PR found
24-
value: ${{ jobs.prdetails.outputs.head_branch }}
20+
value: ${{ fromJSON(jobs.prdetails.outputs.result).head.ref }}
2521
base_branch:
2622
description: The base branch of the PR found
27-
value: ${{ jobs.prdetails.outputs.base_branch }}
23+
value: ${{ fromJSON(jobs.prdetails.outputs.result).base.ref }}
24+
data:
25+
description: The JSON data of the pull request API object
26+
value: ${{ jobs.prdetails.outputs.result }})
2827

2928
jobs:
3029
prdetails:
@@ -33,27 +32,18 @@ jobs:
3332
steps:
3433
- name: "🔍 Read PR details"
3534
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"
35+
uses: actions/github-script@v5
36+
with:
37+
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
38+
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
39+
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
40+
script: |
41+
const [owner, repo] = "${{ github.repository }}".split("/");
42+
const response = await github.rest.pulls.list({
43+
head: "${{ inputs.owner }}:${{ inputs.branch }}",
44+
owner,
45+
repo,
46+
});
47+
return response.data[0];
5648
outputs:
57-
pr_id: ${{ steps.details.outputs.prnumber }}
58-
head_branch: ${{ steps.details.outputs.headref }}
59-
base_branch: ${{ steps.details.outputs.baseref }}
49+
result: ${{ steps.details.outputs.result }}

.github/workflows/pull_request.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: Pull Request
22
on:
33
pull_request_target:
44
types: [ opened, edited, labeled, unlabeled, synchronize ]
5-
concurrency:
6-
group: ${{ github.workflow }}-${{ github.ref }}
7-
cancel-in-progress: true
5+
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.head.ref }}
86
jobs:
97
changelog:
108
name: Preview Changelog
@@ -21,7 +19,7 @@ jobs:
2119
permissions:
2220
pull-requests: read
2321
steps:
24-
- uses: yogevbd/enforce-label-action@2.1.0
22+
- uses: yogevbd/enforce-label-action@2.2.2
2523
with:
2624
REQUIRED_LABELS_ANY: "T-Defect,T-Deprecation,T-Enhancement,T-Task"
2725
BANNED_LABELS: "X-Blocked"

.github/workflows/sonarcloud.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Must only be called from a workflow_run in the context of the upstream repo
12
name: SonarCloud
23
on:
34
workflow_call:
@@ -35,13 +36,6 @@ on:
3536
type: string
3637
required: false
3738
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"
4539
secrets:
4640
SONAR_TOKEN:
4741
required: true
@@ -57,13 +51,20 @@ jobs:
5751
ref: ${{ inputs.head_branch }} # checkout commit that triggered this workflow
5852
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
5953

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
54+
# Fetch base branch from the upstream repo so that Sonar can identify new code in PR builds
55+
- name: "📕 Fetch upstream base branch"
56+
# workflow_call retains the github context of the caller, so `repository` will be upstream always due
57+
# to it running on `workflow_run` which is called from the context of the target repo and not the fork.
58+
if: inputs.base_branch
59+
run: |
60+
git remote add upstream https://github.com/${{ github.repository }}
61+
git rev-parse HEAD
62+
git fetch upstream ${{ inputs.base_branch }}:${{ inputs.base_branch }}
63+
git status
64+
git rev-parse HEAD
6465
6566
# 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+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this alternative:
6768
- name: "📥 Download Coverage Report"
6869
uses: dawidd6/action-download-artifact@v2
6970
if: inputs.coverage_workflow_name

.github/workflows/sonarqube.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types:
66
- completed
77
concurrency:
8-
group: ${{ github.workflow }}-${{ github.ref }}
8+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
99
cancel-in-progress: true
1010
jobs:
1111
prdetails:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: "yarn build"
2727

2828
- name: Run tests with coverage
29-
run: "yarn coverage --ci"
29+
run: "yarn coverage --ci --reporters github-actions"
3030

3131
- name: Upload Artifact
3232
uses: actions/upload-artifact@v2

.istanbul.yml

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

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Changes in [18.1.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v18.1.0) (2022-06-07)
2+
==================================================================================================
3+
4+
## ✨ Features
5+
* Convert `getLocalAliases` to a stable API call ([\#2402](https://github.com/matrix-org/matrix-js-sdk/pull/2402)).
6+
7+
## 🐛 Bug Fixes
8+
* Fix request, crypto, and bs58 imports ([\#2414](https://github.com/matrix-org/matrix-js-sdk/pull/2414)). Fixes #2415.
9+
* Update relations after every decryption attempt ([\#2387](https://github.com/matrix-org/matrix-js-sdk/pull/2387)). Fixes vector-im/element-web#22258. Contributed by @weeman1337.
10+
* Fix degraded mode for the IDBStore and test it ([\#2400](https://github.com/matrix-org/matrix-js-sdk/pull/2400)). Fixes matrix-org/element-web-rageshakes#13170.
11+
* Don't cancel SAS verifications if `ready` is received after `start` ([\#2250](https://github.com/matrix-org/matrix-js-sdk/pull/2250)).
12+
* Prevent overlapping sync accumulator persists ([\#2392](https://github.com/matrix-org/matrix-js-sdk/pull/2392)). Fixes vector-im/element-web#21541.
13+
* Fix behaviour of isRelation with relation m.replace for state events ([\#2389](https://github.com/matrix-org/matrix-js-sdk/pull/2389)). Fixes vector-im/element-web#22280.
14+
* Fixes #2384 ([\#2385](https://github.com/matrix-org/matrix-js-sdk/pull/2385)). Fixes undefined/matrix-js-sdk#2384. Contributed by @schmop.
15+
* Ensure rooms are recalculated on re-invites ([\#2374](https://github.com/matrix-org/matrix-js-sdk/pull/2374)). Fixes vector-im/element-web#22106.
16+
117
Changes in [18.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v18.0.0) (2022-05-24)
218
==================================================================================================
319

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ Merge Strategy
249249

250250
The preferred method for merging pull requests is squash merging to keep the
251251
commit history trim, but it is up to the discretion of the team member merging
252-
the change. When stacking pull requests, you may wish to do the following:
252+
the change. We do not support rebase merges due to `allchange` being unable to
253+
handle them. When merging make sure to leave the default commit title, or
254+
at least leave the PR number at the end in brackets like by default.
255+
When stacking pull requests, you may wish to do the following:
253256

254257
1. Branch from develop to your branch (branch1), push commits onto it and open a pull request
255258
2. Branch from your base branch (branch1) to your work branch (branch2), push commits and open a pull request configuring the base to be branch1, saying in the description that it is based on your other PR.

0 commit comments

Comments
 (0)