-
Notifications
You must be signed in to change notification settings - Fork 332
[WPB-28089] Treat team collaborators like team members in contact search (second attempt). #5488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fisx
wants to merge
13
commits into
develop
Choose a base branch
from
WPB-28089-treat-team-collaborators-like-team-members-in-contact-search-_second-attempt_
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+604
−169
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4c2fcc8
Changelog.
fisx ea1f73f
Failing integration test.
fisx affd45a
Include team collaborators in contact search.
fisx 33d49e2
Implement TeamCollaboratorsSubsystem interpreter with BrigAPIAccess.
fisx c85344c
Remove stray TODO.
fisx c0525b6
Remove bogus TODO.
fisx 0a7ee78
Make BrigAPIAccess.Local interpreter fall back on RPC.
fisx 15964d7
Test users collaborating with more than one team.
fisx 2b0c8f1
make sanitize-pr
fisx 590d8df
Fix brig-index: do not bump index version in failure case.
fisx 0bfdbe6
Add release notes on required postgres setup steps.
fisx 6a744ef
Update libs/wire-subsystems/src/Wire/BrigAPIAccess/Local.hs
fisx c620820
Update libs/wire-subsystems/test/unit/Wire/MockInterpreters/BrigAPIAc…
fisx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
....d/0-release-notes/WPB-28089-treat-team-collaborators-like-team-members-in-contact-search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| `GET /contacts/search` returns apps (and regular users) that collaborate with the searcher's team. | ||
|
|
||
| This means that `brig-index-migrate-data` now requires you to | ||
| configure the `elasticsearch-index` chart's postgres setup, and have a | ||
| postgres instance reachable with that setup, eg., like this: | ||
|
|
||
| ``` | ||
| # in charts/elasticsearch-index/values.yaml | ||
| postgresql: | ||
| host: postgresql # DNS name without protocol | ||
| port: "5432" | ||
| user: wire-server | ||
| dbname: wire-server | ||
| postgresqlPool: | ||
| size: 100 | ||
| acquisitionTimeout: 10s | ||
| idlenessTimeout: 10m | ||
|
|
||
| postgresMigration: | ||
| user: cassandra | ||
| ``` | ||
|
|
||
| [More | ||
| info](https://docs.wire.com/latest/developer/reference/config-options.html?h=config#configure-postgresql) |
1 change: 1 addition & 0 deletions
1
...og.d/1-api-changes/WPB-28089-treat-team-collaborators-like-team-members-in-contact-search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Treat team collaborators like team members in contact search. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| -- This file is part of the Wire Server implementation. | ||
| -- | ||
| -- Copyright (C) 2026 Wire Swiss GmbH <opensource@wire.com> | ||
| -- | ||
| -- This program is free software: you can redistribute it and/or modify it under | ||
| -- the terms of the GNU Affero General Public License as published by the Free | ||
| -- Software Foundation, either version 3 of the License, or (at your option) any | ||
| -- later version. | ||
| -- | ||
| -- This program is distributed in the hope that it will be useful, but WITHOUT | ||
| -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| -- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
| -- details. | ||
| -- | ||
| -- You should have received a copy of the GNU Affero General Public License along | ||
| -- with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
|
||
| -- | Interprets 'BrigAPIAccess' from within brig itself, by calling into the local | ||
| -- subsystems directly instead of round-tripping over HTTP to itself (as | ||
| -- 'Wire.BrigAPIAccess.Rpc.interpretBrigAccess' does for every other service). | ||
| -- | ||
| -- Only the operations needed by code shared with other services (e.g. | ||
| -- 'Wire.TeamCollaboratorsSubsystem') are implemented locally. Everything else | ||
| -- falls back to the RPC handler, pointed at brig itself: correct, but a wasteful | ||
| -- round-trip through our own listen socket, so it logs a warning and should be | ||
| -- given a local implementation once something actually relies on it. | ||
| module Wire.BrigAPIAccess.Local where | ||
|
|
||
| import Imports | ||
| import Polysemy | ||
| import Polysemy.Error (Error) | ||
| import Polysemy.Input (runInputConst) | ||
| import Polysemy.TinyLog (TinyLog) | ||
| import Polysemy.TinyLog qualified as Log | ||
| import System.Logger.Message qualified as Log | ||
| import Util.Options (Endpoint) | ||
| import Wire.BrigAPIAccess | ||
| import Wire.BrigAPIAccess.Rpc (brigAccessRpcHandler) | ||
| import Wire.ParseException (ParseException) | ||
| import Wire.Rpc (Rpc) | ||
| import Wire.RpcException (RpcException) | ||
| import Wire.UserSubsystem (UserSubsystem) | ||
| import Wire.UserSubsystem qualified as UserSubsystem | ||
|
|
||
| -- | The 'Endpoint' is brig's own; it is only used for the operations that have | ||
| -- no local implementation yet. | ||
| interpretBrigAPIAccessLocally :: | ||
| forall r. | ||
| ( Member TinyLog r, | ||
| Member Rpc r, | ||
| Member (Error ParseException) r, | ||
| Member (Error RpcException) r | ||
| ) => | ||
| Endpoint -> | ||
| InterpreterFor UserSubsystem r -> | ||
| InterpreterFor BrigAPIAccess r | ||
| interpretBrigAPIAccessLocally selfEndpoint runUser = interpret $ \case | ||
| UpdateSearchIndex uid -> runUser (UserSubsystem.internalUpdateSearchIndex uid) | ||
| other -> selfRpc other | ||
| where | ||
| selfRpc :: forall m x. BrigAPIAccess m x -> Sem r x | ||
| selfRpc action = do | ||
| Log.warn $ | ||
| Log.msg (Log.val "BrigAPIAccess.Local: no local implementation, calling brig over HTTP") | ||
| runInputConst selfEndpoint (brigAccessRpcHandler action) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need to convince Akshay