Skip to content

Fix error messages for policy editor's yaml mode

Martin Čavoj requested to merge 395545-fix-approver-alert-in-yaml into master

What does this MR do and why?

This MR fixes certain error messages not being displayed in policy editor's yaml mode.

Screenshots or screen recordings

Before After
error_handling_before error_handling_after

How to set up and validate locally

  1. Navigate to Policies -> New policy -> Scan result policy
  2. Switch to yaml mode, enter the following:
    type: scan_result_policy
    name: Test
    description: ''
    enabled: true
    rules:
      - type: scan_finding
        branches: []
        scanners: []
        vulnerabilities_allowed: 0
        severity_levels: []
        vulnerability_states: []
    actions:
      - type: require_approval
        approvals_required: 2
        user_approvers_ids:
          - 4
  3. Submit
  4. Error alert should be shown on top
  5. Remove user_approvers_ids from yaml and switch to the rule mode
  6. Select Individual users from Choose approver type, select any user
  7. Submit
  8. Error should still be shown in the Actions section (the current behavior)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #395545 (closed)

Merge request reports