Skip to content

Surface validation errors as warnings

What does this MR do and why?

tl;dr Make sure that schema validation happens always but it's results are treated as warnings that are displayed to the user.

  1. VALIDATE_SCHEMA is now considered deprecated, the plan is to remove it in %15.3 (if possible)
  2. Remove enforce_security_report_validation feature flag (for now, we will introduce it later on)
  3. Current behavior (show_report_validation_warnings: false)
    • when VALIDATE_SCHEMA is set to true in the CI job configuration then perform schema validation and reject reports that don't pass the validation
    • when VALIDATE_SCHEMA is not set or set to false then don't perform a schema validation
  4. When show_report_validation_warnings: true
    • Schema validation is always performed
    • If VALIDATE_SCHEMA is true then schema validation errors are treated as errors and will result in the report not being ingested
    • If VALIDATE_SCHEMA is not set or set to false then schema validation errors are treated as errors, will be shown to the user in Security section of the Pipeline widget and report will be ingested.

Related to #353126 (closed)

How to test

  1. git switch 353126-surface-validation-errors-as-warnings
  2. Feature.enable(:show_report_validation_warnings)
  3. Clone https://gitlab.com/Quintasan/surface-validation-errors-as-warnings somewhere
  4. Go to your local GitLab web interface, create a new repository
  5. Add it as a new upstream to the repository you cloned
  6. git push new-upstream master && git push new-upstream invalid-cluster-image-scanning
  7. Make sure the pipelines finish running
  8. Security::Scan.last.warnings should not be empty

MR acceptance checklist

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

Edited by Michał Zając

Merge request reports