Use versioned schemas when validating security reports

Why are we doing this work

Currently lib/gitlab/ci/parsers/security/validators/schema_validator.rb is not validating against the schema version declared by the report, instead it uses the schema present under lib/gitlab/ci/parsers/security/validators/schemas/ instead which is not what we want.

Implementation plan

  1. Adjust lib/gitlab/ci/parsers/security/validators/schema_validator.rb so it accepts a version as an argument
  2. Adjust lib/gitlab/ci/parsers/security/common.rb so it passes the parsed version to SchemaValidator
Edited by Michał Zając