Skip to content

Add id_tokens to default key in ci schema

What does this MR do and why?

Right now, when using a defaults.id_tokens key, linters like check-jsonschema will complain that this key is not allowed. Same for editor integrations that use the same Gitlab json schema.

This MR adds id_tokens as possible value to the default key in ci schema

The CI docs show that id_tokens is a valid subkey for the default key.

%{first_multiline_commit}

How to set up and validate locally

Reproduce the issue

  1. Install check-jsonschema
  2. Use a .gitlab-ci.yml with following content:
default:
  id_tokens:
    GCP_TOKEN:
      aud: https://gitlab.com
  before_script:
    - echo hi
  1. Run check using latest ci.json from master branch:
$ 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::$.default: Additional properties are not allowed ('id_tokens' was unexpected)

Solved by this MR

  1. Run check using ci.json from this MR's branch:
$ check-jsonschema --schemafile 'https://gitlab.com/hinricht/gitlab/-/raw/update_default_schema_key/app/assets/javascripts/editor/schema/ci.json?ref_type=heads' .gitlab-ci.yml
ok -- validation done

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 T. Hinrichsmeyer

Merge request reports