Skip to content

WPB-25328 autopromotion for adminless groups - #5256

Merged
battermann merged 10 commits into
developfrom
WPB-25328-backend-autopromotion-for-adminless-groups
Jun 11, 2026
Merged

WPB-25328 autopromotion for adminless groups#5256
battermann merged 10 commits into
developfrom
WPB-25328-backend-autopromotion-for-adminless-groups

Conversation

@battermann

@battermann battermann commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

Checklist

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

@battermann battermann changed the title Wpb 25328 backend autopromotion for adminless groups WPB-25328 autopromotion for adminless groups Jun 9, 2026
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Jun 9, 2026
@battermann
battermann marked this pull request as ready for review June 10, 2026 15:46
@battermann
battermann requested review from a team as code owners June 10, 2026 15:46
@battermann
battermann requested a review from Copilot June 10, 2026 15:46

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

Implements “Prevent adminless groups” autopromotion behavior so that when a team conversation would become adminless (e.g., last admin leaves or is removed via team-member deletion), eligible members can be promoted automatically depending on the configured promotion strategy.

Changes:

  • Adds a pure selection helper (selectAutopromotionCandidate) and unit tests for strategy-based autopromotion candidate selection.
  • Extends the conversation removal flow (removeMemberQualified / guardPreventAdminlessGroups) to trigger autopromotion for legacy responses, and introduces a ConversationSubsystem operation to clean a user out of all team conversations while applying the guard.
  • Updates Galley API call sites and integration tests to cover autopromotion on v15 leave and on team member deletion / user deletion.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/galley/src/Galley/API/Teams.hs Routes team-member deletion cleanup through ConversationSubsystem (deleteUserFromTeamConversations).
services/galley/src/Galley/API/Public/Conversation.hs Adapts remove-member endpoints to updated removeMemberQualified conn-id shape (Maybe ConnId).
services/galley/src/Galley/API/LegalHold.hs Switches policy-conflict removals to use removeMemberQualified.
libs/wire-subsystems/wire-subsystems.cabal Registers new AdminlessGroups module and its unit spec in cabal.
libs/wire-subsystems/test/unit/Wire/ConversationSubsystem/InterpreterSpec.hs Extends interpreter spec error stack for new error paths involved in removal/autopromotion.
libs/wire-subsystems/test/unit/Wire/ConversationSubsystem/AdminlessGroupsSpec.hs Adds unit coverage for autopromotion strategy selection behavior.
libs/wire-subsystems/src/Wire/ConversationSubsystem/Update.hs Implements autopromotion guard behavior and team-conversation cleanup implementation.
libs/wire-subsystems/src/Wire/ConversationSubsystem/Interpreter.hs Wires new ConversationSubsystem operation into the interpreter.
libs/wire-subsystems/src/Wire/ConversationSubsystem/AdminlessGroups.hs New pure helper module for deterministic autopromotion candidate selection.
libs/wire-subsystems/src/Wire/ConversationSubsystem.hs Adjusts subsystem API (conn-id optionality; new DeleteUserFromTeamConversations operation).
integration/test/Test/AdminlessGroups.hs Adds integration coverage for autopromotion on v15 leave and deletion scenarios.
changelog.d/2-features/WPB-25313 Updates changelog entry text for the feature (but ticket/file mismatch vs PR).

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

Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem/Update.hs Outdated
Comment thread integration/test/Test/AdminlessGroups.hs Outdated
Comment thread changelog.d/2-features/WPB-25313
Base automatically changed from WPB-25313-backend-implement-adminless-check-on-leave-endpoint to develop June 11, 2026 07:48
@battermann
battermann force-pushed the WPB-25328-backend-autopromotion-for-adminless-groups branch from 2a87186 to 87d9f91 Compare June 11, 2026 08:04
Comment thread libs/wire-subsystems/src/Wire/ConversationSubsystem/Update.hs
@battermann
battermann merged commit 5da52ee into develop Jun 11, 2026
10 checks passed
@battermann
battermann deleted the WPB-25328-backend-autopromotion-for-adminless-groups branch June 11, 2026 09:38
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