Skip to content

WPB-5989 polysemy create client subsystem (part 2)#5156

Merged
battermann merged 19 commits intodevelopfrom
WPB-5989-polysemy-create-client-subsystem-part-2
Apr 1, 2026
Merged

WPB-5989 polysemy create client subsystem (part 2)#5156
battermann merged 19 commits intodevelopfrom
WPB-5989-polysemy-create-client-subsystem-part-2

Conversation

@battermann
Copy link
Copy Markdown
Contributor

@battermann battermann commented Mar 26, 2026

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

In this PR, 4 more operations have been moved to the ClientSubsystem, and unit tests have been added.

The other operations will be move in subsequent PRs.

Checklist

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

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Mar 26, 2026
@battermann battermann force-pushed the WPB-5989-polysemy-create-client-subsystem-part-2 branch from 44f5d77 to 486566c Compare March 27, 2026 16:20
@battermann battermann marked this pull request as ready for review March 31, 2026 09:16
@battermann battermann requested review from a team as code owners March 31, 2026 09:16
@battermann battermann requested a review from Copilot March 31, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 continues the WPB-5989 migration by moving more client-management behavior behind the Polysemy ClientSubsystem, updating Brig API handlers to call the subsystem, and centralizing a Client -> PubClient conversion helper in wire-api.

Changes:

  • Route more Brig public/internal client endpoints through Wire.ClientSubsystem (update/remove/legal hold request + DPoP access token naming).
  • Add new ClientSubsystem actions and implement them in the interpreter; expand unit tests accordingly.
  • Introduce Wire.API.User.Client.toPubClient and remove duplicate local helpers; drop an unused Brig.Data.Client module.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/brig/test/integration/Federation/End2end.hs Switch expected client list conversion to shared toPubClient.
services/brig/src/Brig/Data/Client.hs Remove unused/empty module.
services/brig/src/Brig/API/Public.hs Route update/delete client + public lookups via ClientSubsystem; rename access-token handler.
services/brig/src/Brig/API/Internal.hs Route legal-hold internal handlers via ClientSubsystem.
services/brig/src/Brig/API/Client.hs Remove migrated client management exports; keep DPoP access-token logic + prekey endpoints.
services/brig/brig.cabal Drop Brig.Data.Client from build.
libs/wire-subsystems/test/unit/Wire/Util.hs Add generators/fixtures for prekeys used by new ClientSubsystem tests.
libs/wire-subsystems/test/unit/Wire/MockInterpreters/ClientStore.hs Remove local toPubClient helper (but see review comments).
libs/wire-subsystems/test/unit/Wire/ClientSubsystem/InterpreterSpec.hs Add/expand property tests for add/remove/update + legal-hold flows.
libs/wire-subsystems/src/Wire/ClientSubsystem/Interpreter.hs Implement RemoveClient, RemoveLegalHoldClient, PublishLegalHoldClientRequested, UpdateClient.
libs/wire-subsystems/src/Wire/ClientSubsystem.hs Add new effect constructors for client removal/legal-hold/update.
libs/wire-subsystems/src/Wire/ClientStore/Cassandra.hs Inline PubClient construction and remove redundant helper.
libs/wire-api/src/Wire/API/UserEvent.hs Derive Show for EventType.
libs/wire-api/src/Wire/API/User/Client.hs Add shared toPubClient helper.
changelog.d/5-internal/WPB-5989 Update changelog entry with additional PR reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@blackheaven blackheaven left a comment

Choose a reason for hiding this comment

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

I'm not sure how it interacts with Galley's Client code, have you had a look for duplication?

@battermann
Copy link
Copy Markdown
Contributor Author

I'm not sure how it interacts with Galley's Client code, have you had a look for duplication?

This is just a refactoring and the intention is not to merge brig's and galley's Client types and code. We can't have galley use the ClientSubsystem easily. Not yet. But I hope soon.

@battermann battermann merged commit bdd2471 into develop Apr 1, 2026
9 checks passed
@battermann battermann deleted the WPB-5989-polysemy-create-client-subsystem-part-2 branch April 1, 2026 07:24
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.

4 participants