WPB-24072: Move operation to ConversationSubsystem - #5126
Conversation
2e747fc to
5cbcf0d
Compare
edd315b to
77e5669
Compare
battermann
left a comment
There was a problem hiding this comment.
Are you going to add a changelog?
7da6fbc to
65d3410
Compare
Yes, as soon as we'ill get to a stable version. |
65d3410 to
39271bc
Compare
|
@battermann I have refactored helm charts, let me know if you had this in mind |
c50731b to
6364aeb
Compare
6364aeb to
3b4878b
Compare
|
@akshaymankar @battermann I have removed helm stuff, can you have a look, please? |
b400cdb to
9055634
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates a large portion of Galley’s conversation-related logic into the shared wire-subsystems ConversationSubsystem, and updates service wiring + tests accordingly (including federation and legal-hold touchpoints).
Changes:
- Move conversation handlers/mapping/MLS/message/action logic from
services/galleyintolibs/wire-subsystemsunderWire.ConversationSubsystem.*andWire.StoredConversation. - Update Galley/background-worker/Brig wiring to provide new inputs/errors/config required by the subsystem interpreters.
- Migrate/remove Galley unit test suite and re-home relevant tests under
wire-subsystemsusing Hspec.
Reviewed changes
Copilot reviewed 109 out of 109 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| services/galley/test/unit/Run.hs | Removes Galley unit test runner (suite deleted). |
| services/galley/test/integration/API/Util.hs | Updates remote conversation view type usage in test helpers. |
| services/galley/test/integration/API/Teams/LegalHold/DisabledByDefault.hs | Adapts fanout limit accessor to new options helper. |
| services/galley/test/integration/API/Teams/LegalHold.hs | Adapts fanout limit accessor to new options helper. |
| services/galley/test/integration/API/Teams.hs | Adapts fanout limit accessor to new options helper. |
| services/galley/test/integration/API/Federation.hs | Updates federation response type constructor names. |
| services/galley/test/integration/API.hs | Updates mock federation responses + removes old mapping import. |
| services/galley/src/Galley/Env.hs | Switches fanout limit calculation to shared FeatureFlags.currentFanoutLimit; exports currentFanoutLimitOpts. |
| services/galley/src/Galley/App.hs | Wires new ConversationSubsystem inputs/errors; centralizes conversationCodeURI validation; updates fanout limit usage. |
| services/galley/src/Galley/API/Teams/Features/Get.hs | Deletes Galley feature-get module (moved into FeaturesConfigSubsystem). |
| services/galley/src/Galley/API/Teams/Features.hs | Re-points team feature operations to TeamSubsystem/FeaturesConfigSubsystem helpers. |
| services/galley/src/Galley/API/Public/Team.hs | Switches public API wiring to use ConversationSubsystem. |
| services/galley/src/Galley/API/Public/Messaging.hs | Switches public API wiring to use ConversationSubsystem. |
| services/galley/src/Galley/API/Public/MLS.hs | Switches public API wiring to use ConversationSubsystem. |
| services/galley/src/Galley/API/Public/LegalHold.hs | Switches getUserStatus usage to TeamSubsystem. |
| services/galley/src/Galley/API/Public/Feature.hs | Updates feature API wiring to use FeaturesConfigSubsystem and proxy-based feature checks. |
| services/galley/src/Galley/API/Public/Conversation.hs | Re-wires conversation endpoints to ConversationSubsystem handlers (qualified/unqualified adapters). |
| services/galley/src/Galley/API/Public/Bot.hs | Switches bot conversation handler to ConversationSubsystem + FeaturesConfigSubsystem guard. |
| services/galley/src/Galley/API/Mapping.hs | Deletes Galley mapping module (moved to Wire.StoredConversation). |
| services/galley/src/Galley/API/LegalHold/Team.hs | Adds ensureReAuthorised helper (moved from conversation util). |
| services/galley/src/Galley/API/LegalHold/Get.hs | Deletes Galley LH get module (moved to TeamSubsystem interpreter). |
| services/galley/src/Galley/API/Federation.hs | Re-wires federation server to ConversationSubsystem federation handlers and adds legacy adapter. |
| services/galley/src/Galley/API/Create.hs | Deletes Galley create handlers (moved to Wire.ConversationSubsystem.Create). |
| services/galley/galley.cabal | Removes many Galley exposed modules and deletes the galley-tests test-suite stanza. |
| services/galley/default.nix | Removes no-longer-needed deps and test deps due to deleted Galley test suite. |
| services/brig/src/Brig/CanonicalInterpreter.hs | Adds mapping for ErrorS 'TeamNotFound/'TeamMemberNotFound and Wai.Error into Brig’s canonical interpreter stack. |
| services/background-worker/test/Test/Wire/Util.hs | Extends test env to include new Galley settings fields + rate-limit env. |
| services/background-worker/test/Test/Wire/BackendNotificationPusherSpec.hs | Extends test env to include new Galley settings fields + rate-limit env. |
| services/background-worker/src/Wire/BackgroundWorker/Jobs/Registry.hs | Updates interpreter stack wiring for ConversationSubsystem, federation subsystem, rate-limit/hash-password, conv code store; adjusts error mapping. |
| services/background-worker/src/Wire/BackgroundWorker/Env.hs | Extends Env with Galley settings needed by background-worker interpreters and initializes them. |
| libs/wire-subsystems/wire-subsystems.cabal | Exposes many new ConversationSubsystem modules; adds specs for moved tests. |
| libs/wire-subsystems/test/unit/Wire/UserGroupSubsystem/InterpreterSpec.hs | Adjusts test error plumbing to include static team errors and wraps into local error sum. |
| libs/wire-subsystems/test/unit/Wire/TeamInvitationSubsystem/InterpreterSpec.hs | Adjusts test error plumbing to include static team errors and wraps into local error sum. |
| libs/wire-subsystems/test/unit/Wire/StoredConversationSpec.hs | Migrates old mapping tests from Tasty to Hspec; targets Wire.StoredConversation mapping fns. |
| libs/wire-subsystems/test/unit/Wire/ScimSubsystem/InterpreterSpec.hs | Updates to use the new wrapped local error runner from UserGroupSubsystem tests. |
| libs/wire-subsystems/test/unit/Wire/SAMLEmailSubsystem/InterpreterSpec.hs | Adds handling for static team errors in interpreter stack. |
| libs/wire-subsystems/test/unit/Wire/MockInterpreters/GalleyAPIAccess.hs | Adds unimplemented stubs for new LH status RPC operations. |
| libs/wire-subsystems/test/unit/Wire/MockInterpreters/ConversationSubsystem.hs | Updates mock interpreter to new internal constructors (interpretH/pureT). |
| libs/wire-subsystems/test/unit/Wire/MiniBackend.hs | Extends mini backend effect stack/config to include ConversationSubsystem and static team errors. |
| libs/wire-subsystems/test/unit/Wire/MeetingsSubsystem/InterpreterSpec.hs | Adds static team errors to test stack and updates FeaturesConfigSubsystem mock API surface. |
| libs/wire-subsystems/test/unit/Wire/ConversationSubsystem/One2OneSpec.hs | Migrates one-to-one tests from Tasty to Hspec under new module name. |
| libs/wire-subsystems/test/unit/Wire/ConversationSubsystem/MessageSpec.hs | Migrates message tests from Tasty to Hspec; targets Wire.ConversationSubsystem.Message. |
| libs/wire-subsystems/src/Wire/UserClientIndexStore.hs | Adds higher-level helper functions for client listing/removal with federation queue notifications. |
| libs/wire-subsystems/src/Wire/TeamSubsystem/Interpreter.hs | Extends TeamSubsystem interpreter with LH status endpoints, fanout helpers, and team assertions. |
| libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs | Extends TeamSubsystem GalleyAPI interpreter to cover LH status endpoints and team checks. |
| libs/wire-subsystems/src/Wire/TeamSubsystem.hs | Adds shared helpers (permission checks, consent checks, assertions) and new TeamSubsystem operations. |
| libs/wire-subsystems/src/Wire/TeamInvitationSubsystem/Interpreter.hs | Updates comment reference for duplication location after migration. |
| libs/wire-subsystems/src/Wire/StoredConversation.hs | Adds conversation mapping/view functions previously in Galley (ownConversationView, remote/local views, conversion). |
| libs/wire-subsystems/src/Wire/Options/Galley.hs | Exports GuestLinkTTLSeconds/default + adds conversationCodeURISettings helper. |
| libs/wire-subsystems/src/Wire/NotificationSubsystem/Interpreter.hs | Switches default fanout limit source to Wire.API.Team.FeatureFlags.defaultFanoutLimit. |
| libs/wire-subsystems/src/Wire/MeetingsSubsystem/Interpreter.hs | Switches to internal create-group-conversation constructor name. |
| libs/wire-subsystems/src/Wire/GalleyAPIAccess/Rpc.hs | Adds RPC endpoints for LH status queries; updates comments to new handler locations. |
| libs/wire-subsystems/src/Wire/GalleyAPIAccess.hs | Extends GalleyAPIAccess effect with LH status operations. |
| libs/wire-subsystems/src/Wire/FeaturesConfigSubsystem/Interpreter.hs | Moves previously-Galley feature-get logic (incl 2FA guard) into subsystem interpreter. |
| libs/wire-subsystems/src/Wire/FeaturesConfigSubsystem.hs | Extends effect API to include guard/feature-enabled/user queries/internal fetch. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Util.hs | Removes moved helpers and introduces throwWhenMemberNotFound + uses TeamSubsystem consent helpers. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/One2One.hs | Renames internal upsert function to internalUpsertOne2OneConversation. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Message.hs | Renames module and introduces IntraListing input; refactors dependencies to new subsystem layout. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Welcome.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Util.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/SubConversation.hs | Updates imports/constraints to new MLS module structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Reset.hs | Renames module and updates imports/constraints to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Removal.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Proposal.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Propagate.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/OutOfSync.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/One2One.hs | Updates remote conversation view type to RemoteConversationView. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Migration.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Message.hs | Refactors MLS message handling around explicit EnableOutOfSyncCheck argument and new module structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Keys.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/IncomingMessage.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/GroupInfoCheck.hs | Updates to use getFeatureForTeam from FeaturesConfigSubsystem. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/GroupInfo.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Enabled.hs | Minor simplification of inputs isJust. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Conversation.hs | Renames module into ConversationSubsystem namespace. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Commit/InternalCommit.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Commit/ExternalCommit.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/Commit/Core.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS/CheckClients.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/MLS.hs | Narrows module surface to MLS public keys and uses new MLS enabled helper. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/LegalholdConflicts.hs | Renames module and switches inputs from Opts to FeatureFlags. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Internal.hs | Renames/exports internalGetClientIds helper. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Federation.hs | Moves federation handlers into ConversationSubsystem namespace; updates response/view types. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/CreateInternal.hs | Updates imports to use TeamSubsystem permission helpers. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Create.hs | New module implementing conversation creation handlers within ConversationSubsystem. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Clients.hs | Moves rmClient logic to ConversationSubsystem namespace and adjusts MLS removal call site. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Action/Reset.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Action/Notify.hs | Refactors to call notifyConversationActionImpl and updates required effects. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Action/Leave.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Action/Kick.hs | Renames module and updates imports to new subsystem structure. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Action.hs | Renames module and updates imports; uses TeamSubsystem LH helpers. |
| libs/wire-subsystems/src/Wire/ConversationStore/Cassandra.hs | Updates comment references after migration. |
| libs/wire-subsystems/src/Wire/BrigAPIAccess.hs | Adds ensureConnectedToLocals helper previously in conversation util. |
| libs/wire-subsystems/src/Wire/BackgroundJobsRunner/Interpreter.hs | Adjusts import to avoid name clash with getConversation. |
| libs/wire-subsystems/default.nix | Adds new deps (comonad, kan-extensions) required by moved modules. |
| libs/wire-api/src/Wire/API/Team/LegalHold.hs | Adds UserLegalHoldStatusEntry schema for bulk LH status endpoint. |
| libs/wire-api/src/Wire/API/Team/FeatureFlags.hs | Adds defaultFanoutLimit + currentFanoutLimit helpers. |
| libs/wire-api/src/Wire/API/Routes/Internal/Galley.hs | Adds internal routes for LH status (single and bulk). |
| libs/wire-api-federation/test/Test/Wire/API/Federation/Golden/GetOne2OneConversationResponse.hs | Updates golden test types to RemoteConversationView. |
| libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs | Renames remote conversation view types and response wrappers. |
| changelog.d/5-internal/WPB-23789 | Adds changelog entry describing ConversationSubsystem migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 109 out of 109 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
battermann
left a comment
There was a problem hiding this comment.
There are still a few unresolved issued found by Copilot. Given these will be resolved I approve this PR, proforma.
akshaymankar
left a comment
There was a problem hiding this comment.
Approved based on approval from @battermann
https://wearezeta.atlassian.net/browse/WPB-24072
Checklist
changelog.d