Skip to content

Refactor Members ActivateService

Nicolas Dular requested to merge nd/refactor-activate-service into master

What does this MR do and why?

Issue: #361096 (closed)

This refactors the ::Members::ActivateService by

  1. Using factory methods to initialize the service
  2. Use update_all instead of looping over each member
  3. Make it clear that either an invited member, a user or the whole group gets activated.

This has the following advantages:

  1. The API is easier to use and less error prone. Before that you had to either pass user, member or activate_all: true
  2. We use an update_all instead of doing a looping over each Member
  3. It's more clear what resource gets activates. Before this change, passing member did update all memberships of the given member's user.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports