Skip to content

Introduce default: for gitlab-ci.yml

Kamil Trzciński requested to merge move-all-configs-to-global into master

What does this MR do?

This moves all existing image/services/before_script/variables into default:. This allows us to easily add default entries. default: keeps backward compatible: to be considered to be a job if default:script: is specified. This behavior should be removed.

All existing image/services/before_script/variables are properly handled in root context.

  1. This allows to properly discover the:
# a default that is CI job
default:
  script: My CI job
  1. And to discover the:
# a default configuration, as it is missing script:
default:
  image: ruby:2.1
  1. And to properly translate (for backward compatiblity):
image: ruby:2.1
  1. And handle the case as such:
image: ruby:2.1

default:
  image: go:2.1 # the default as it is more specific takes precedence

Ideally, this should allow us to deprecate the case nb 1. where default: would become a reserved word, that should not be job.

Ideally, we should fix all our documents to use a default: always.

What are the relevant issue numbers?

Closes: https://gitlab.com/gitlab-org/gitlab-ce/issues/62732

Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/55011 https://gitlab.com/gitlab-org/gitlab-ce/issues/57190

Does this MR meet the acceptance criteria?

Conformity

Edited by Grzegorz Bizon

Merge request reports