Skip to content

Allow to not inherit defaults as part of job/bridge

Problem to solve

This is proposal to add additional YAML option that allows to disable inheritance of defaults and global yaml variables for a particular job:

default:
  image: ruby:2.1

dast:
  inherit:
    default: true/false # true by default
    variables: true/false # true by default
  script: echo Hello World

Currently, in order to disable the inheritance you have to manually overwrite each setting. This is also impossible to stop the inheritance of variables: as variables can also affect the behaviour of job, due to special type variables like CI_CLONE_PATH:

checks:
  stage: .post
  tags:
    - linux-default
  before_script: [] #override and before after scripts
  after_script: [] #override and before after scripts
  dependencies: [] 

The future

Allow the inherit: to fine tune what will be inherited:


default:
  before_script: echo Hello World
  image: ruby:2.1

variables:
  DOMAIN: my-domain.com
  KEY: value

dast:
  inherit:
    default: [image] # inherit only `image:`, but not `before_script`
    variables: [DOMAIN] # inherit only `DOMAIN`, but not `key`
  script: echo Hello World

Intended users

Links / references

Edited by Kamil Trzciński