[go: up one dir, main page]

[SAM] Add Members::AcceptInviteService and publish event on accepting

GitLab currently has several services for managing member access:

  • InviteService: Handles sending invitations to users
  • RequestAccessService: Allows users to request access to groups/projects
  • ApproveAccessRequestService: Processes approval of access requests

However, we lack a dedicated service for accepting invitations in the subscription context.

Proposal

Implement Members::AcceptInviteService to handle the acceptance flow for invitations within the subscription management system. This service will reuse existing logic from the Member model and do the following

  1. Process invitation acceptances for subscription members
  2. Validate user permissions and subscription status.
  3. Update membership records appropriately.
  4. New: Publish an AcceptInviteEvent that can be consumed by the seat assignment sync service
  5. Handle edge cases (expired invitations, already accepted invitations, etc.)

Implementation Details

  • The service should follow GitLab's service object pattern
  • It should integrate with existing member management systems
  • Implement event publishing mechanism for AcceptInviteEvent
  • Proper error handling for various scenarios (invalid invites, permission issues)
  • Include comprehensive test coverage

Benefits

  • Enables seat assignment synchronization when invites are accepted
  • Improves code organization by moving invitation acceptance logic to a dedicated service
  • Enables better maintainability and future extensions to the invitation flow

Acceptance Criteria

  • Service successfully processes invitation acceptances
  • Service publishes AcceptInviteEvent that can be subscribed to by the seat assignment sync service
  • All edge cases are handled appropriately
  • Test coverage meets GitLab standards
  • Documentation is updated to reflect the new service