Skip to content

Show relevant errors when failing to match a CI job entry

Marius Bobin requested to merge improve-matching-for-ci-job-entries into master

What does this MR do?

CI jobs were identified only by the script keyword, resulting in unhelpful error messages:

build:
  before_script: pwd

Would raise this validation error: This GitLab CI configuration is invalid: root config contains unknown keys: build

This patch uses all the possible keys to match a job entry, resulting in this error message: "jobs:build script can't be blank".

Examples

Screenshots

image

What doesn't this MR do

It doesn't fix the error message for combining bridge jobs with regular jobs. Using a script with trigger in the same job is still returning jobs:build config contains unknown keys: trigger

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 Marius Bobin

Merge request reports