Skip to content

Validation jobs

There are several code validation jobs, trying to mirror what core does. There is documentation for each of those jobs in:

Allow failure in pipelines

By default, all validation jobs are allowed to fail. This means that even if the job fails, the overall result of the pipeline will not be affected by it.

If the overall result of the pipeline is successful, and any of the validation jobs fail, then a warning icon will show.

There are several ways to alter this behavior, listed below.

All validation jobs

There is a special variable, named _ALL_VALIDATE_ALLOW_FAILURE, to control all the validation jobs allow_failure-behavior at once. Set to 1 to allow the all the validation/linting jobs to fail, set to 0 for not allowing any failure. Individual job variables can override this global settings.

variables:
  _ALL_VALIDATE_ALLOW_FAILURE: 0

Per job

There are individual variables to allow each job to fail (default value) or not. You just need to set these values to 0 in the variables: section in your .gitlab-ci.yml file, as shown below:

variables:
  _COMPOSER_LINT_ALLOW_FAILURE: 0
  _PHPCS_ALLOW_FAILURE: 0
  _STYLELINT_ALLOW_FAILURE: 0
  _CSPELL_ALLOW_FAILURE: 0
  _ESLINT_ALLOW_FAILURE: 0
  _PHPSTAN_ALLOW_FAILURE: 0

Override the job value

If you don't want to use any of the above variables, you can simply override the job value definition in your .gitlab-ci.yml file for the linting jobs where you want to change this behavior.

cspell:
  allow_failure: false