Add only/except rule for merge request pipelines

Problem to solve

From @dosuken123

Probably it makes sense to introduce only: post_merge_requests event keyword to differentiate some jobs from merge requests and target branches.

Target audience

  • Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha

  • Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon

Further details

Proposal

For example,

##
# Test runs on merge requests and MR trains
test:
  script: ...
  only:
  - merge_requests
  - post_merge_requests

##
# Review app runs on merge requests only
review:
  script: ...
  only:
    - merge_requests
  except:
    - post_merge_requests
    - master

##
# Deployment happens on master only
deploy:
  script: ...
  only:
    - master

With this approach, at least users can leverage what kind of jobs will be included in pipelines on MR train. This is safer than GitLab's smart guess.

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

TBD

What is the type of buyer?

Individual Contributor (Core)

Links / references

Edited Feb 18, 2019 by Jason Yavorsky
Assignee Loading
Time tracking Loading