Skip to content

Show inherited group members when flag is number

Andrew Fontaine requested to merge afontaine/421434/fix into master

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

  1. Create a group and add members directly
  2. create another group and add the first group. these are the inherited members
  3. Invite your second group to a project's members so they are available to protect environments
  4. 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!
  1. Navigate to your project's Settings > CI/CD
  2. expand the protected environments section
  3. expand the development environment
  4. 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.

For #421434 (closed)

Edited by Andrew Fontaine

Merge request reports

Loading