Show relevant errors when failing to match a CI job entry
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
- https://gitlab.com/guided-explorations/rough-drafts/multi-app-monorepo/-/blob/22d01b6f7b89cde4d2750539c201bb32c7fd604d/.gitlab-ci.yml
- https://gitlab.com/guided-explorations/rough-drafts/multi-app-monorepo/-/pipelines/164913721
Screenshots
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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