Loading
Fix empty popover when pre-enforcement policy overrides setting
What does this MR do and why?
Fixes a bug in PolicyOverrideWarningIcon where a policy created before the enforcement_type field was introduced (pre-enforcement policy) could produce an empty popover.
Root cause: hasApprovalSettingsOverride was derived from policiesWithSettingsOverride.length > 0, but a pre-enforcement policy (no enforcement_type) passes the hasSettingsOverride check while failing both the enforced (=== 'enforce') and warn (=== 'warn') filters. This left the popover open with no content rendered.
Fix:
enforcedPoliciesWithSettingsOverridenow includes policies whereenforcement_typeis absent — pre-enforcement policies default to the enforced behavior, which matches the original intent.hasApprovalSettingsOverrideis now derived from the two display-level computed properties (enforcedPoliciesWithSettingsOverrideandwarnPoliciesWithSettingsOverride) rather than the intermediatepoliciesWithSettingsOverride, eliminating any case where the icon shows but the popover is empty.
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Enable the
security_orchestration_policies_configurationfeature flag (or ensure scan result policies are available). - Set up a scan result policy on a project without an
enforcement_typefield in its YAML (i.e., a policy created before the enforcement_type field was added). - Navigate to Settings → Merge requests for that project.
- Before this fix: the warning icon appears, clicking it opens an empty popover.
- After this fix: the warning icon only appears when there is content to show; the popover correctly shows the policy in the enforced section.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Alexander Turinske

