Support `only: changes:` on MR pipelines
The current implementation of only: changes:
does not work for new branches. It is due to inability to understand all changes.
The introduction of Merge Request Pipelines allows us to get a proper changeset of changes: before_sha
and sha
of changes:
-
before_sha
to bemerge-base
of changes between our source and target branch, -
sha
head of the branch.
By looking at before_sha
and sha
we should fix support for running jobs only when given files are changed, thus solving the biggest deficiency of current implementation.
What needs to be done? I think that we need to set proper before_sha
when we create a new MR pipelines (CreatePipelineService). This should self-resolve the only: changes:
behavior.