Skip to content

WIP: Only run jobs for changes on specified paths

This MR is a POC attempting to tackle https://gitlab.com/gitlab-org/gitlab-ce/issues/19232 It introduces a new configuration option for the .gitlab-ci.yml

With the following configuration provided, nested under only and paths, it accepts a string, describing the beginning of a file path. The changeset to the target branch is then matched against this string, to determine if a job needs to be run for this particular changset. If no match is found, the job is skipped.

  only:
    paths: "test/"

Are there points in the code the reviewer needs to double check?

Since this is a basic POC, there are still a number of potential side effects, not anticipated. More test coverage is needed.

Why was this MR needed?

To provide a POC for a long-standing feature request.

What's still needed to complete this feature?

  • Expand paths policy to support multiple paths (Array of strings) and not just a single string
  • Provide support for Regex on those paths provided
  • Provide support for except keyword
  • integration tests
  • error handling
  • config validation
  • support only if a MR exists for the branch, otherwise ignore

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/19232

@ayufan @grzesiek

Edited by Nicola

Merge request reports