Skip to content

Warn about invalid config when linting bash in templates

Rémy Coutable requested to merge exclude-katalon-template-from-shellcheck into master

What does this MR do and why?

After !100832 (diffs), config attributes are only set for valid configs. In this case, lib/gitlab/ci/templates/Katalon.gitlab-ci.yml doesn't declare any actual jobs, so it doesn't respond to jobs.

This MR skips invalid templates and warns their errors:

Katalon.gitlab-ci.yml is invalid: ["jobs config should contain at least one visible job"]
Security/API-Fuzzing.gitlab-ci.yml is invalid: ["apifuzzer_fuzz job: chosen stage does not exist; available stages are .pre, build, test, deploy, .post"]
Security/DAST.gitlab-ci.yml is invalid: ["dast job: chosen stage does not exist; available stages are .pre, build, test, deploy, .post"]
Security/DAST-API.gitlab-ci.yml is invalid: ["dast_api job: chosen stage does not exist; available stages are .pre, build, test, deploy, .post"]

Related to #378474 (closed).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports