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_SCHEMA
is now considered deprecated, the plan is to remove it in %15.3 (if possible) - Remove
enforce_security_report_validation
feature flag (for now, we will introduce it later on) - Current behavior (
show_report_validation_warnings: false
)- when
VALIDATE_SCHEMA
is set totrue
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 tofalse
then don't perform a schema validation
- when
- When
show_report_validation_warnings: true
- Schema validation is always performed
- If
VALIDATE_SCHEMA
istrue
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 tofalse
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
git switch 353126-surface-validation-errors-as-warnings
Feature.enable(:show_report_validation_warnings)
- Clone
https://gitlab.com/Quintasan/surface-validation-errors-as-warnings
somewhere - 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.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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Michał Zając