Skip to content

WPB-27017 reconcile adminless groups on feature toggle - #5357

Merged
battermann merged 14 commits into
developfrom
WPB-27017-reconcile-adminless-groups
Jul 23, 2026
Merged

WPB-27017 reconcile adminless groups on feature toggle#5357
battermann merged 14 commits into
developfrom
WPB-27017-reconcile-adminless-groups

Conversation

@battermann

@battermann battermann commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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

Checklist

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

@battermann
battermann force-pushed the WPB-27017-reconcile-adminless-groups branch from d0f88fe to 82fc9a0 Compare July 22, 2026 10:15
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jul 22, 2026
@battermann
battermann force-pushed the WPB-27017-reconcile-adminless-groups branch from 82fc9a0 to 4b344ee Compare July 22, 2026 10:17
@battermann
battermann requested a review from Copilot July 22, 2026 10:17

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 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 AdminlessSetup job type and worker execution path in the background-worker, plus job scheduling/cancellation primitives in JobSubsystem.
  • Extend team feature application logic to run feature-specific post-update hooks; implement a hook for PreventAdminlessGroupsConfig that 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.

Comment thread integration/test/Test/AdminlessGroups.hs Outdated
battermann and others added 2 commits July 22, 2026 12:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@battermann
battermann marked this pull request as ready for review July 22, 2026 10:40
@battermann
battermann requested review from a team as code owners July 22, 2026 10:40

@supersven supersven 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.

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

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.

assertSuccess or assertStatus could in my opinion be useful here (and in similar cases).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread hack/helm_vars/wire-server/values.yaml.gotmpl
Comment thread libs/wire-subsystems/src/Wire/JobSubsystem/Interpreter.hs
Comment thread libs/wire-subsystems/src/Wire/JobSubsystem/Interpreter.hs
Comment thread libs/wire-subsystems/src/Wire/JobSubsystem/Migrations.hs
@battermann
battermann merged commit 8837aa0 into develop Jul 23, 2026
9 checks passed
@battermann
battermann deleted the WPB-27017-reconcile-adminless-groups branch July 23, 2026 10:19
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