Cannot include downstream pipeline with `include:file`
Summary
include:file
does not work with trigger
in parent-child pipeline feature
This is strange since the parent-child pipeline docs stated that all include
feature will work to compose the configuration.
I've tried the workaround to use include:remote
to include the file I need, but since the file lives in a private repository and it refers to other local sub-templates in that repo, using a remote URL does not work either.
Would there be any way to get around this issue? And why does it happen in the first place?
Steps to reproduce
Triggering a child pipeline using include:file
results in a CI Lint error "include config contains unknown keys: project, ref"
Here's the .gitlab-ci.yml
:
images_build_multiple:
stage: build
trigger:
strategy: depend
include:
- project: 'my-group/my-pipeline-library'
ref: 'master'
file: 'path/to/child-pipeline.yml'
What is the current bug behavior?
project
and ref
are not recognized as known key words
What is the expected correct behavior?
CI Lint should pass
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Proposal
The allowed keys for include
should contain project
and ref
. With Parent-child pipeline we actually enforce the use of ALLOWED_KEYS validation this is why we see this error because of the missing project
in the ALLOWED_KEYS. The difference between trigger:include
and top-level include
is that with the first we set the value
explicitly which is used by the validator.