Add error handling for parsing yaml strings in sep

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR resolves 393858

When a user is creating a scan execution policy (SEP) in yaml mode with invalid yaml content, rule mode should be disabled

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Error handling
invalid_yaml

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Upload an GitLab Ultimate license
  2. Navigate to /security/policies/new?type=scan_execution_policy
  3. Navigate to yaml mode
  4. Paste in the below policy, which has valid cron syntax or any invalid yaml
type: scan_execution_policy
name: Test
description: ''
enabled: true
rules:
  - type: schedule
    branches: []
    cadence: */5 0 * * *
actions:
  - scan: dast
    site_profile: ''
    scanner_profile: ''
    tags: []

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 #393858 (closed)

Edited by Artur Fedorov

Merge request reports

Loading