Skip to content

ci.json schema does not allow empty tags array

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

GitLab CI accepts a job configuration which sets an empty tag list, but the official schema does not allow it.

Steps to reproduce

  1. Configure some default set of tags in .gitlab-ci.yml:

    default:
      tags: [my-tag]
  2. Reset the tags in a job:

    my-job:
      tags: []
      script: 'true'
  3. Push the configuration to GitLab

What is the current bug behavior?

The job runs fine in CI, but the configuration does not correspond to the schema:

❯ check-jsonschema --schemafile=https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json .gitlab-ci.yml
Schema validation errors were encountered.
  .gitlab-ci.yml::$.my-job.tags: [] should be non-empty

What is the expected correct behavior?

The configuration works, and being able to override the tags when using defaults or extends is useful, so the schema should allow it.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖