Modified UpdateService to use the MemberManagement::CreateService
What does this MR do and why?
Context
- Currently the logic to identify/control the Promotion Management flow for Ultimate SelfManaged Customers does not account for Custom Roles. It uses
NewRole > GUEST
to check if this Member Role change is a Billable Role Change. - For Ultimate Tier Customers, CustomRoles
Guest+
Roles might still have the access_level of GUEST and be Billable. - We need to modify the logic to handle CustomRoles to ensure every NonBillable to Billable Role change is handled via the Promotion Management Flow.
- And make changes to save the customrole specific field in the table
This is the Fourth MR:
- The First MR moves the billable logic to a common Util
- The Second MR is modifies the Validation logic to account for member_role_id and persists the same in DB when passed via the service.
- The Third MR CreateService for creating MemberApproval objects.
What does this MR do and why?
The changes in this MR uses the CreateService and Util that was added in the previous MR
- Modifies UpdateService to use the CreateService
- Removes codes that ̇were part of the member model, but now has been moved to Util
PS: This entire feature is still a WIP and isn't yet release to prod.
ref: https://gitlab.com/gitlab-org/gitlab/-/issues/443491
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Validate the behaviour remains the same before and after this MR
How to set up and validate locally
- Enable Setting
setting = ApplicationSetting.first; setting.enable_member_promotion_management=true; setting.save!
- Enable FF
Feature.enable(:member_promotion_management)
- Purchase Ultimate License, and simulate Ultimate SM setup
- Visit any Group as non admin, try promoting GUEST member to DEVELOPER, verify that API returns 200, and the role doesnt change on UI
- Verify that after reload the user is still a GUEST user
- Repeat the same for a Project member
- Try the same as Admin, the user role changes seemlessly
Edited by Suraj Tripathi