WPB-27017 reconcile adminless groups on feature toggle - #5357
Conversation
d0f88fe to
82fc9a0
Compare
82fc9a0 to
4b344ee
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces an “adminless setup” reconciliation path that runs when the preventAdminlessGroups team feature is toggled, ensuring existing team conversations are re-checked and the appropriate adminless cleanup jobs are (re)scheduled or canceled.
Changes:
- Add a new
AdminlessSetupjob type and worker execution path in the background-worker, plus job scheduling/cancellation primitives inJobSubsystem. - Extend team feature application logic to run feature-specific post-update hooks; implement a hook for
PreventAdminlessGroupsConfigthat schedules reconciliation and cancels pending jobs on disable/config changes. - Add “system” conversation events (member-update / delete / adminless-reminder) and integration tests validating reconciliation, cancellation, and notifications.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/galley/src/Galley/API/Teams/Features.hs | Adds feature post-update hook (afterFeatureSet) and wires preventAdminlessGroups toggles to job scheduling/cancellation. |
| services/background-worker/src/Wire/BackgroundWorker/Workers.hs | Routes the new AdminlessSetup payload type to its worker and adds a payload type name. |
| services/background-worker/src/Wire/AdminlessJobsWorker.hs | Implements runAdminlessSetupJob to reconcile team conversations and enqueue follow-up adminless jobs. |
| libs/wire-subsystems/test/unit/Wire/ConversationSubsystem/InterpreterSpec.hs | Updates mock JobSubsystem interpreter to handle new job actions. |
| libs/wire-subsystems/src/Wire/JobSubsystem/Migrations.hs | Ensures an index exists to support team-scoped cancellation queries over adminless jobs. |
| libs/wire-subsystems/src/Wire/JobSubsystem/Interpreter.hs | Implements scheduling of setup jobs and team-scoped cancellation via Arbiter operations/queries. |
| libs/wire-subsystems/src/Wire/JobSubsystem.hs | Extends the JobSubsystem effect with setup scheduling and team cancellation actions. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Update.hs | Adds setupAdminlessGroupsCleanup and emits system events when no origin user exists; refactors adminless scheduling helpers. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Notify.hs | Exposes a pushSystemEvent helper to emit system events via NotificationSubsystem. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem/Interpreter.hs | Wires new SetupAdminlessGroupsCleanup action to the update logic. |
| libs/wire-subsystems/src/Wire/ConversationSubsystem.hs | Adds SetupAdminlessGroupsCleanup to the ConversationSubsystem effect. |
| libs/wire-api/test/unit/Test/Wire/API/Roundtrip/Aeson.hs | Adds roundtrip coverage for AdminlessSetupJob and system event types. |
| libs/wire-api/test/golden/testObject_ConversationsJobPayload_AdminlessSetup_1.json | Golden JSON for the new conversations job payload variant. |
| libs/wire-api/test/golden/testObject_AdminlessSetupJob_2.json | Golden JSON for setup job payload including orig_user_id. |
| libs/wire-api/test/golden/testObject_AdminlessSetupJob_1.json | Golden JSON for setup job payload without orig_user_id. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Manual/AdminlessJobs.hs | Adds manual golden objects for AdminlessSetupJob and payload. |
| libs/wire-api/test/golden/Test/Wire/API/Golden/Manual.hs | Registers new golden test groups for setup job/payload. |
| libs/wire-api/src/Wire/API/Jobs.hs | Defines AdminlessSetupJob and adds AdminlessSetup to ConversationsJobPayload. |
| libs/wire-api/src/Wire/API/Event/Conversation.hs | Introduces SystemEvent + SystemEventType and schema/JSON support. |
| integration/test/Testlib/Cannon.hs | Exports awaitNMatchesResultFor for use in new integration tests. |
| integration/test/Test/AdminlessGroups.hs | Adds integration coverage for setup-on-enable, cancellation-on-disable, and rescheduling on config change; adds test helpers. |
| integration/test/Notifications.hs | Updates matchers to recognize the new system event notification types. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
supersven
left a comment
There was a problem hiding this comment.
I think this could work 👍
I've added some comments that might be worth to be reviewed.
| -- The feature is disabled, so leaving the conversation must not schedule a | ||
| -- deletion job. Enabling it afterwards exercises the team reconciliation job. | ||
| bindResponse (removeMember alice conv alice) $ \resp -> do | ||
| resp.status `shouldMatchInt` 200 |
There was a problem hiding this comment.
assertSuccess or assertStatus could in my opinion be useful here (and in similar cases).
There was a problem hiding this comment.
Yes, I will change it if there are other changes, but I think it is not worth to go through a whole CI cycle just for this.
https://wearezeta.atlassian.net/browse/WPB-27017
Checklist
changelog.d