Skip to content

WPB-24072: Move operation to ConversationSubsystem - #5126

Merged
blackheaven merged 39 commits into
developfrom
gdifolco/WPB-23789-mass-move-conv-sub
Apr 28, 2026
Merged

WPB-24072: Move operation to ConversationSubsystem#5126
blackheaven merged 39 commits into
developfrom
gdifolco/WPB-23789-mass-move-conv-sub

Conversation

@blackheaven

@blackheaven blackheaven commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-24072

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@blackheaven
blackheaven marked this pull request as ready for review March 18, 2026 13:41
@blackheaven
blackheaven requested review from a team as code owners March 18, 2026 13:41
@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch from 2e747fc to 5cbcf0d Compare March 19, 2026 18:04
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Mar 19, 2026
@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch 8 times, most recently from edd315b to 77e5669 Compare March 24, 2026 14:28

@battermann battermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to add a changelog?

Comment thread hack/helm_vars/wire-federation-v0/values.yaml.gotmpl
Comment thread charts/wire-server/values.yaml Outdated
Comment thread charts/wire-server/templates/background-worker/configmap.yaml Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem/Federation.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem/Interpreter.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem.hs
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem.hs
Comment thread charts/wire-server/values.yaml Outdated
@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch from 7da6fbc to 65d3410 Compare April 1, 2026 15:04
@blackheaven
blackheaven requested a review from battermann April 1, 2026 15:04
@blackheaven

Copy link
Copy Markdown
Contributor Author

Are you going to add a changelog?

Yes, as soon as we'ill get to a stable version.

@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch from 65d3410 to 39271bc Compare April 1, 2026 15:32
@blackheaven

Copy link
Copy Markdown
Contributor Author

@battermann I have refactored helm charts, let me know if you had this in mind

Comment thread changelog.d/5-internal/WPB-23789 Outdated
@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch 2 times, most recently from c50731b to 6364aeb Compare April 17, 2026 15:16
@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch from 6364aeb to 3b4878b Compare April 17, 2026 16:29
@blackheaven

Copy link
Copy Markdown
Contributor Author

@akshaymankar @battermann I have removed helm stuff, can you have a look, please?

@blackheaven
blackheaven force-pushed the gdifolco/WPB-23789-mass-move-conv-sub branch from b400cdb to 9055634 Compare April 20, 2026 18:35
Comment thread changelog.d/5-internal/WPB-23789 Outdated
Comment thread charts/wire-server/templates/_helpers.tpl Outdated
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem/Interpreter.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem.hs
Comment thread libs/wire-subsystems/src/Wire/UserClientIndexStore.hs Outdated
Comment thread libs/wire-subsystems/src/Wire/UserClientIndexStore.hs Outdated
Comment thread services/background-worker/src/Wire/BackgroundWorker/Env.hs Outdated
Comment thread services/brig/src/Brig/CanonicalInterpreter.hs Outdated
@blackheaven
blackheaven requested a review from battermann April 21, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/galley into libs/wire-subsystems under Wire.ConversationSubsystem.* and Wire.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-subsystems using 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.

Comment thread changelog.d/5-internal/WPB-23789 Outdated
Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs
Comment thread libs/wire-subsystems/src/Wire/UserClientIndexStore.hs Outdated
@battermann battermann changed the title WPB-23789: Move operation to ConversationSubsystem WPB-24072: Move operation to ConversationSubsystem Apr 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs
Comment thread libs/wire-subsystems/src/Wire/TeamSubsystem/GalleyAPI.hs
Comment thread services/background-worker/test/Test/Wire/Util.hs

@battermann battermann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few unresolved issued found by Copilot. Given these will be resolved I approve this PR, proforma.

@akshaymankar akshaymankar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved based on approval from @battermann

@blackheaven
blackheaven merged commit a2aa8c4 into develop Apr 28, 2026
10 checks passed
@blackheaven
blackheaven deleted the gdifolco/WPB-23789-mass-move-conv-sub branch April 28, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants