Docs feedback - feature proposal: Allow "only/except" in "default" section of .gitlab-ci.yml files

Problem to solve

Reduce redundant only/except blocks in configs for various jobs in the CI config file.

Intended users

All CI users.

Further details

Travis CI supports this:

---
language: shell

jobs:
  include:
    - name: hello
      script: echo hello

    - name: goodbye
      script: echo goodbye

branches:
  only:
    - master

All the jobs ("hello" and "goodbye") will only be run on pull requests/pushes to master.

Proposal

---
default:
  image: alpine:latest
  only:
    - master

hello:
  script: echo hello

goodbye:
  script: echo goodbye

wellmeetagain:
  script: echo we'll meet again
  only:
    - merge_requests   

The only/except sections should behave like other fields in the default. That is, if there's an equivalent section in a job, it should override the default. In the example above, the wellmeetagain job should only run for merge requests, while hello and goodbye run for any push to master.

Permissions and Security

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited by goodspark