Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,126
    • Issues 43,126
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,369
    • Merge requests 1,369
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 has launched! Please visit Breaking changes in 15.0 and 15.0 Removals to see which breaking changes may impact your workflow.

  • GitLab.org
  • GitLabGitLab
  • Issues
  • #207484
Closed
Open
Created Feb 21, 2020 by Kamil Trzciński@ayufanMaintainer

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

  • Sasha (Software Developer)
  • Devon (DevOps Engineer)

Links / references

Edited Mar 04, 2020 by Kamil Trzciński
Assignee
Assign to
Time tracking