Christian Heike commented on issue #342209 at GitLab.org / GitLab

Christian Heike
2023-07-07T05:58:18Z

Seems like, unfortunately, that did not happen. This feature would be a a game changer, though. Instead of including build files with repeating rules (even though referenced), one could stop processing an include if certain changes have not been added and then decide on a fine grained level.

Could you please get that into the next release.

Here is an example why this would help structure everyones CI/CD:

.gitlab-ci.yml:

.changes:
golang:
dependencies:
- "go.mod"
- "go.sum"
sources:
- "**/*.go"
linter:
- ".golangci.yaml"
containers:
sources:
- "Dockerfile"
linter:
- ".hadolint.yaml"

include:
# Usually another project containing the pipelines
local: .gitlab-ci/pipelines/golang.yaml
rules:
- changes: !reference [.changes, golang, dependencies]
- changes: !reference [.changes, golang, sources]
- changes: !reference [.changes, golang, linter]
include:
local: .gitlab-ci/pipelines/containers.yaml
rules:
- changes: !reference [.changes, container, sources]
- changes: !reference [.changes, container, linter]

.gitlab-ci/pipelines/golang.yaml:

include:
local: .gitlab-ci/tasks/build.yaml
rules:
- changes: !reference [.changes, golang, dependencies]
- changes: !reference [.changes, golang, sources]
include:
local: .gitlab-ci/tasks/lint.yaml
rules:
- changes: !reference [.changes, golang, dependencies]
- changes: !reference [.changes, golang, sources]
- changes: !reference [.changes, golang, linter]