Surface validation errors as warnings

Why are we doing this work

Currently, when users opt-in to schema validation we DO NOT ingest reports that do not pass schema validation.

However, in %15.0 we want to enforce the schema validation. As such, in "%14.10 we would like soft-enforce schema validation and surface the validation errors as warnings in the Security tab of the Pipeline status page.

Implementation plan

  • backend Extend lib/gitlab/ci/reports/security/report.rb with warnings attribute
  • backend Extend ee/app/models/security/scan.rb with warnings getter and setter so the warnings get stored to Security::Scan#info table
  • backend Extend ee/app/presenters/security/scan_presenter.rb to present warnings
  • backend Expose warnings in ee/app/graphql/types/scan_type.rb
  • backend Adjust lib/gitlab/ci/parsers/security/common.rb so that it always performs schema validation but treats the errors are warnings unless VALIDATE_SCHEMA is true
Edited by Michał Zając