Skip to content

Security approvals are duplicated in `Repository Settings > Branch Rules > Details`

Summary

Settings > Merge Requests

image.png

Settings > Repository Settings > Branch Rules > Details

image.png

Steps to reproduce

  1. Create a subgroup with multiple projects
  2. Create policies with rules that are enforced at the sub-group level
  3. View a project's settings as shown above

Example Project

https://gitlab.com/haven-group/development-projects/project-a

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: \\\`sudo gitlab-rake gitlab:env:info\\\`) (For installations from source run and paste the output of: \\\`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\\\`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:check SANITIZE=true\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true\`) (we will only investigate if the tests are passing)

Possible fixes

  • backend Update Projects::AllBranchesRule#approval_project_rules and Projects::AllProtectedBranchesRule#approval_project_rules to group project_approval_rules by security_orchestration_policy_configuration_id and orchestration_policy_idx
def approval_project_rules
  project
    .approval_rules
    .for_all_branches
    .group_by { |rule| [rule.security_orchestration_policy_configuration_id, rule.orchestration_policy_idx] }
    .map(&:first)
end
Edited by Sashi Kumar Kumaresan