Cron syntax in a SEP is modified when switching from yaml to rule mode

Summary

When a user is creating a scan execution policy (SEP), the yaml inputed into yaml mode is modified when switching to rule mode

Steps to reproduce

  1. Upload an GitLab Ultimate license
  2. Navigate to https://staging.gitlab.com/govern-team-test/cnp-alert-demo/-/security/policies/new?type=scan_execution_policy\
  3. Navigate to yaml mode
  4. Paste in the below policy, which has valid cron syntax
type: scan_execution_policy
name: Test
description: ''
enabled: true
rules:
  - type: schedule
    branches: []
    cadence: */5 0 * * *
actions:
  - scan: dast
    site_profile: ''
    scanner_profile: ''
    tags: []
  1. Navigate to rule mode
  2. Navigate back to yaml mode

Example Project

https://staging.gitlab.com/govern-team-test/cnp-alert-demo/-/security/policies/new?type=scan_execution_policy

What is the current bug behavior?

When a user navigates from yaml mode to rule mode, the cron syntax is changed. When the user navigates back to yaml mode, the syntax highlighting complains about the modified yaml.

What is the expected correct behavior?

When a user navigates from yaml mode to rule mode, the cron syntax is not changed. When the user navigates back to yaml mode, the syntax highlighting does not indicate there is a problem with valid cron syntax

Possible fixes

Edited by Alexander Turinske