Framework editor drops additional policies of same type due to dedup by checksum (order-dependent listing)
Summary
When multiple policies of the same type are scoped to a compliance framework, the Framework → Edit view lists only one. Which one appears is order-dependent. Root cause appears to be deduplication by [checksum, security_policy_management_project_id] in LazyComplianceFrameworkAggregate, which removes distinct policies that share identical/near-identical content.
Steps to reproduce
- Create a compliance framework.
- In the group security-policies project, define 2× scan_execution and 2× pipeline_execution policies all scoped to the framework.
- Secure → Policies shows all 4 with the framework badge.
- Compliance Center → Framework → Edit shows only 2 (one per type).
- Reorder items in the YAML so the other policy of each type is first; commit to default branch.
- Refresh Framework → Edit: the displayed items switch to the ones moved first.
Example Project
What is the current bug behavior?
Framework editor shows only the first policy per type (order-dependent), hiding others.
What is the expected correct behavior?
Framework editor lists all policies scoped to the framework.
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
LazyComplianceFrameworkAggregate#filter_policies_by_scope (or nearby) dedups with:
unique_policies = filtered_policies.uniq { |p| [p[:checksum], p[:security_policy_management_project_id]] }
Because checksum ignores policy name/identity, multiple distinct policies with identical content collapse to one.
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.