Show inherited group members when flag is number
What does this MR do and why?
For some reason, while I was testing locally, the inheritance type would always be a string, but in production, we see many integer values being returned.
So, we convert the flag to a string always before we check its value with the constant to eliminate the type issue.
Changelog: fixed
Screenshots or screen recordings
Screen_Recording_2023-08-14_at_11.49.01_AM
How to set up and validate locally
- Create a group and add members directly
- create another group and add the first group. these are the inherited members
- Invite your second group to a project's members so they are available to protect environments
- Execute the following rails snippet, adjusting project and group IDs
group_id = <ID OF SECOND GROUP CREATED ABOVE>
project_id = <ID OF PROJECT USED ABOVE>
deploy = ProtectedEnvironments::DeployAccessLevel.new(group_id: group_id, group_inheritance_type: 1)
approve = ProtectedEnvironments::ApprovalRule.new(group_id: group_id, required_approvals: 1)
ProtectedEnvironment.new(name: 'development', project_id: project_id, deploy_access_levels: [deploy], approval_rules: [approve]).save!
- Navigate to your project's Settings > CI/CD
- expand the protected environments section
- expand the development environment
- see that the Allowed to deploy section shows inherited members while the Allowed to approve section does not.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
For #421434 (closed)
Edited by Andrew Fontaine