Skip to content

Ci::YamlProcessor.new_with_validation_errors to prevent double processing

drew stachon requested to merge yaml-processor-validation-errors into master

What does this MR do?

This MR adds a #validation_errors class method to Ci::YamlProcessor for returning a structured list of error messages, and uses this method in the Ci::LintsController to return all configuration-composition messages attached to the Ci::Config.

After this is merged, the Ci::LintsController will be more prepared for the changes required for #24340 (closed).

What does this MR not do?

This MR does not refactor the Exceptions used for flow control out of our CI configuration parsing process. To do that is going to require at least a significant rewrite of Ci::YamlProcessor to maintain the tiered, GOTO-like structure of the validations. That refactor can also be followed by a similar one in Ci::Config, and several steps in the configuration processing chain beyond that.

In Ci::YamlProcessor, several of the validations are in fact dependent on preceding validations passing, so we can't simply remove the raise statements without adding error checks and returns to stop processing.

This MR also does not include any front-end formatting code. There is a bunch of that ready to go, and that MR will closely follow this one.

Screenshots

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by drew stachon

Merge request reports