Skip to content
Snippets Groups Projects

Refactor Members ActivateService

Merged Nicolas Dular requested to merge nd/refactor-activate-service into master
All threads resolved!

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Nicolas Dular
  • Nicolas Dular
  • Nicolas Dular
  • Nicolas Dular
  • Nicolas Dular
  • Nicolas Dular
  • Nicolas Dular requested review from @rkadam3

    requested review from @rkadam3

  • Rajendra Kadam approved this merge request

    approved this merge request

  • Rajendra Kadam removed review request for @rkadam3

    removed review request for @rkadam3

  • :wave: @rkadam3, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • Nicolas Dular added 1 commit

    added 1 commit

    • 15c8bec6 - Refactor Members ActivateService

    Compare with previous version

  • Nicolas Dular added 1 commit

    added 1 commit

    • d99ad9ed - Refactor Members ActivateService

    Compare with previous version

  • Nicolas Dular added 1 commit

    added 1 commit

    • 227ef260 - Refactor Members ActivateService

    Compare with previous version

  • Nicolas Dular
    • Resolved by Doug Stull

      Hey @dstull :wave: Would you mind to take over the maintainer review as you have context around Members and looked at this code before already? No rush - I know it's a larger MR and I am sorry for that. I have no idea how to split it up as most of the refactoring affects test.

  • Nicolas Dular requested review from @dstull

    requested review from @dstull

  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull removed review request for @dstull

    removed review request for @dstull

  • Nicolas Dular added 1 commit

    added 1 commit

    • 015c7048 - Change for_invite API and use scopes

    Compare with previous version

  • Nicolas Dular requested review from @dstull

    requested review from @dstull

  • Doug Stull
  • Doug Stull
  • Doug Stull
  • Doug Stull removed review request for @dstull

    removed review request for @dstull

  • Nicolas Dular added 1 commit

    added 1 commit

    • 99dfc94c - Fix specs and correctly activate members

    Compare with previous version

  • Nicolas Dular requested review from @dstull

    requested review from @dstull

  • Doug Stull resolved all threads

    resolved all threads

  • Doug Stull approved this merge request

    approved this merge request

  • Doug Stull enabled an automatic merge when the pipeline for 0510c2f7 succeeds

    enabled an automatic merge when the pipeline for 0510c2f7 succeeds

  • merged

  • Doug Stull mentioned in commit b0d03934

    mentioned in commit b0d03934

  • mentioned in issue #361096 (closed)

  • Nicolas Dular mentioned in merge request !90496 (merged)

    mentioned in merge request !90496 (merged)

  • added workflowstaging label and removed workflowcanary label

  • Gerardo Gutierrez mentioned in merge request !155506

    mentioned in merge request !155506

  • Please register or sign in to reply
    Loading