Skip to content

Return pretty error validation messages for Security Policy

What does this MR do and why?

We're adding this MR to provide additional information to users whenever they provide invalid YAML.

Screenshots or screen recordings

Before

image

After

image

How to set up and validate locally

  1. Create new project
  2. Go to Security & Compliance -> Policies
  3. Click on Click new and click on New Policy
  4. Select Scan Execution as Policy type and paste this YAML:
type: scan_execution_policy
name: 'Test'
description: 1234567
enabled: true
rules:
  - type: pipeline
    branches: main
actions:
  - scan: cosmos_scan
    site_profile: ''
    scanner_profile: ''
  1. Click on Create via Merge Request and verify errors

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

Edited by Alan (Maciej) Paruszewski

Merge request reports