Skip to content

Added Promotion Management for CreatorService

Suraj Tripathi requested to merge 433179_creator_integration into master

Context

  • As part of &13328 we are working on Adding controls for Admins/Owners to manage Billable Members promotion/addition in Groups and Projects (still a WIP feature).
  • This issue deals with adding that Promotion control for the Invite New Member flow.
  • When PromotionManagement conditions are applicable(code)(primarily when user is non-billable and the current change would make them billable), we want to queue the User/Member Addition/Promotion request if that addition/promotion will increase the Billable count for the SM instance (We will bring this to SaaS eventually)

What does this MR do and why?

PS: This is a SelfManaged feature, and is still in development(WIP), so the feature-flag and settings for the feature is disabled by default.

This MR is part of a wider change, broken down for ease of review
Database changes + Model Changes to Queue Member Approvals !154552 (merged)
Adds Finder to allow querying Nonbillable Users to be queued for promotion !154555 (merged) (in review)
Modifies existing Service to allow queuing Invited Members, (we have used the above two here) !156801 (merged) (in review)
Call the service modified above through Creator Service add_members method <---- You are here

This MR is built on top of the previous !154555 (merged) (in review MR), so the diff is setup against this MR for review :

EE: true Changelog: changed

ref: #433179 (closed)

How to setup and validate locally?

  1. Have an Ultimate License, and simulate Ultimate Self Managed setup (export GITLAB_SIMULATE_SAAS=0)
  2. Enable Setting setting = ApplicationSetting.first; setting.enable_member_promotion_management=true; setting.save!
  3. Enable FF Feature.enable(:member_promotion_management)
  4. Create promotion requests for a new user:
    1. Visit any Group as an owner of that group (e.g. http://127.0.0.1:3000/groups/gitlab-org/-/group_members)
    2. try Inviting a non-billable GUEST user to a DEVELOPER role (this user should be non-billable on the whole instance, i.e. have a highest role as guest, see !149094 (comment 1869616221) for details)
    3. You should see an Error in the Invitation Banner "Request Queued For Admin Approval." — this means a promotion request has been created, and the Invitation did not go through.
  5. Update an existing user of the group:
    1. Through the Invite modal Inviting a non-billable GUEST member to a DEVELOPER role (this member should be non-billable on the whole instance)
    2. Press Invite. You should see an Error in the Invitation Banner "Request Queued For Admin Approval." — this means a promotion request has been created, and the Invitation did not go through.
Edited by Suraj Tripathi

Merge request reports