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?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by Nicola