From 3bdda65bc4cffe5c0c0b7db20e99c16afe929b8c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 24 Mar 2022 12:05:36 +0000 Subject: [PATCH 1/6] Hopefully fail `Initial tests passed` if they actually failed (#2298) --- .github/workflows/dendrite.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dendrite.yml b/.github/workflows/dendrite.yml index 4fcffa0bb..c1bd5a051 100644 --- a/.github/workflows/dendrite.yml +++ b/.github/workflows/dendrite.yml @@ -159,7 +159,6 @@ jobs: # Dummy step to gate other tests on without repeating the whole list initial-tests-done: name: Initial tests passed - if: ${{ !cancelled() }} # Run this even if prior jobs were skipped needs: [ lint, test, build, build_windows ] runs-on: ubuntu-latest steps: From fe5148c12da417ff9aba59a9ceb1e382d6b7507e Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 24 Mar 2022 12:14:35 +0000 Subject: [PATCH 2/6] Check for success of initial tests on GHA --- .github/workflows/dendrite.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dendrite.yml b/.github/workflows/dendrite.yml index c1bd5a051..79d8dddef 100644 --- a/.github/workflows/dendrite.yml +++ b/.github/workflows/dendrite.yml @@ -158,11 +158,15 @@ jobs: # Dummy step to gate other tests on without repeating the whole list initial-tests-done: - name: Initial tests passed - needs: [ lint, test, build, build_windows ] - runs-on: ubuntu-latest - steps: - - run: "true" + name: Initial tests passed + needs: [ lint, test, build, build_windows ] + runs-on: ubuntu-latest + if: ${{ !cancelled() }} # Run this even if prior jobs were skipped + steps: + - name: Check initial tests passed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} # run database upgrade tests upgrade_test: From 41d71a304ca169bb192337fd1c6688ca07b16543 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 24 Mar 2022 12:25:45 +0000 Subject: [PATCH 3/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3a862587..b4a9a614a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Dendrite [![Build Status](https://badge.buildkite.com/4be40938ab19f2bbc4a6c6724517353ee3ec1422e279faf374.svg?branch=master)](https://buildkite.com/matrix-dot-org/dendrite) [![Dendrite](https://img.shields.io/matrix/dendrite:matrix.org.svg?label=%23dendrite%3Amatrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#dendrite:matrix.org) [![Dendrite Dev](https://img.shields.io/matrix/dendrite-dev:matrix.org.svg?label=%23dendrite-dev%3Amatrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#dendrite-dev:matrix.org) +# Dendrite +[![Build status](https://github.com/matrix-org/dendrite/actions/workflows/dendrite.yml/badge.svg?event=push)](https://github.com/matrix-org/dendrite/actions/workflows/dendrite.yml) [![Dendrite](https://img.shields.io/matrix/dendrite:matrix.org.svg?label=%23dendrite%3Amatrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#dendrite:matrix.org) [![Dendrite Dev](https://img.shields.io/matrix/dendrite-dev:matrix.org.svg?label=%23dendrite-dev%3Amatrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#dendrite-dev:matrix.org) Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an **efficient**, **reliable** and **scalable** alternative to [Synapse](https://github.com/matrix-org/synapse): From c2a27efc365f0f68252561bd2a0404d9d64d8ff4 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 24 Mar 2022 12:40:44 +0000 Subject: [PATCH 4/6] Update `on` section of GHA workflow --- .github/workflows/dendrite.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/dendrite.yml b/.github/workflows/dendrite.yml index 79d8dddef..053b39474 100644 --- a/.github/workflows/dendrite.yml +++ b/.github/workflows/dendrite.yml @@ -2,7 +2,12 @@ name: Dendrite on: push: + branches: + - main pull_request: + release: + types: [published] + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From ad818a43707feafaba89f726c925c184cc00eeb3 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 24 Mar 2022 12:41:30 +0000 Subject: [PATCH 5/6] Update dendrite.yml --- .github/workflows/dendrite.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/dendrite.yml b/.github/workflows/dendrite.yml index 053b39474..d337865f2 100644 --- a/.github/workflows/dendrite.yml +++ b/.github/workflows/dendrite.yml @@ -7,7 +7,6 @@ on: pull_request: release: types: [published] - workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From bb31b25f1b3c7330a33b31f310aa73f99457031e Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 24 Mar 2022 21:57:00 +0800 Subject: [PATCH 6/6] fixup treat the sender_localpart as an exclusive namespace of one user (#2255) Signed-off-by: Nick Cao Co-authored-by: Neil Alexander --- setup/config/config_appservice.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup/config/config_appservice.go b/setup/config/config_appservice.go index 4f6553f10..3f4e1c917 100644 --- a/setup/config/config_appservice.go +++ b/setup/config/config_appservice.go @@ -209,13 +209,14 @@ func setupRegexps(asAPI *AppServiceAPI, derived *Derived) (err error) { for _, appservice := range derived.ApplicationServices { // The sender_localpart can be considered an exclusive regex for a single user, so let's do that // to simplify the code - var senderUserIDSlice = []string{fmt.Sprintf("@%s:%s", appservice.SenderLocalpart, asAPI.Matrix.ServerName)} - usersSlice, found := appservice.NamespaceMap["users"] + users, found := appservice.NamespaceMap["users"] if !found { - usersSlice = []ApplicationServiceNamespace{} - appservice.NamespaceMap["users"] = usersSlice + users = []ApplicationServiceNamespace{} } - appendExclusiveNamespaceRegexs(&senderUserIDSlice, usersSlice) + appservice.NamespaceMap["users"] = append(users, ApplicationServiceNamespace{ + Exclusive: true, + Regex: regexp.QuoteMeta(fmt.Sprintf("@%s:%s", appservice.SenderLocalpart, asAPI.Matrix.ServerName)), + }) for key, namespaceSlice := range appservice.NamespaceMap { switch key {