Provide a CI_CONFIG_PATH_REF variable
Hello,
We use CI/CD from a separate repository feature of GitLab. This allows control over the CI/CD code and we can apply it generically to many repositories from a central location.
One of the ways we test CI/CD changes is to point to a dev branch off of our CI/CD project in another project which amounts to updating the ci_config_path of the project to this documented method my/path/.my-custom-file.yml@namespace/subgroup1/subgroup2/another-project:refname
When you include other components/files by composition (we use input spec pipeline code), you can specify a 'ref'. The core issue we have is that since there is no variable which provides the refname part before the pipeline code is evaluated, we have to resort to manually update the value in the pipeline code directly to point to the refname.
If the variable would exist, then we could apply the following pattern to all our CI code and not worry about pulling the wrong version when testing changes.
include:
project: 'namespace/group/ci-project'
file: 'my/path/custom.gitlab-ci.yml'
ref: $CI_CONFIG_PATH_REF
rules:
...
inputs:
...
We could define such a variable in the project itself to make it available before pipeline execution, but that would require 2 changes to a project config at all times making this more fragile.