Fix update of optional_approvals in bot comment
What does this MR do and why?
This change fixes a policy bot comment message in existing MRs in case the policy changes from having optional approvals to having required approvals
How to set up and validate locally
- Create a policy which sets
approvals_required: 0
. Example YAML:type: scan_result_policy name: Secrets description: '' enabled: true rules: - type: scan_finding scanners: - secret_detection vulnerabilities_allowed: 0 severity_levels: [] vulnerability_states: [] branch_type: protected actions: - type: require_approval approvals_required: 0 user_approvers_ids: - 1
- Create MR that violated the policy
- Observe a bot comment that has
optional_approvals
section - Update the policy to set
approvals_required: 1
- Verify that bot comment message in the MR changes and
optional_approvals
section is removed
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.
Related to #420948 (closed)