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.
-
VALIDATE_SCHEMAis now considered deprecated, the plan is to remove it in %15.3 (if possible) - Remove
enforce_security_report_validationfeature flag (for now, we will introduce it later on) - Current behavior (
show_report_validation_warnings: false)- when
VALIDATE_SCHEMAis set totruein the CI job configuration then perform schema validation and reject reports that don't pass the validation - when
VALIDATE_SCHEMAis not set or set tofalsethen don't perform a schema validation
- when
- When
show_report_validation_warnings: true- Schema validation is always performed
- If
VALIDATE_SCHEMAistruethen schema validation errors are treated as errors and will result in the report not being ingested - If
VALIDATE_SCHEMAis not set or set tofalsethen 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
git switch 353126-surface-validation-errors-as-warningsFeature.enable(:show_report_validation_warnings)- Clone
https://gitlab.com/Quintasan/surface-validation-errors-as-warningssomewhere - Go to your local GitLab web interface, create a new repository
- Add it as a new upstream to the repository you cloned
git push new-upstream master && git push new-upstream invalid-cluster-image-scanning- Make sure the pipelines finish running
-
Security::Scan.last.warningsshould 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Michał Zając