Pipeline run fails with "Include `{"project":null "file":null}` needs to match exactly one accessor!
Summary
After adding Compliance Framework
to a project CI Pipelines fail with yaml error.
"Include {"project":null "file":null} needs to match exactly one accessor!
Pipeline editor in the UI does not indicate a problem.
CI Lint only shows a problem when selecting the Simulate a pipeline created for the default branch
box.
Steps to reproduce
- Add new compliance framework to a group, do not include a project for CI files. (i.e. PCI)
- Tag project with new compliance framework.
- Edit
.gitlab-ci.yml
file (it seems like it will run until the project ci file is modified). - Run a new pipeline.
Example Project
https://gitlab.com/gitops-demo/apps/my-asp-net-app1/-/pipelines/318093566
What is the current bug behavior?
Pipeline fails to run.
What is the expected correct behavior?
A blank entry in the compliance framework should be ignored as it is indicated to be an optional parameter.
Relevant logs and/or screenshots
Output of checks
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)
Possible fixes
We currently only check for null
compliance pipeline configuration location. The bug is caused by an empty
string value in the compliance pipeline configuration location.
- Ensure the evaluation of the compliance CI template is guarded against empty value (ie.
" "
) - Ensure the compliance pipeline configuration location is not set (=
null
) if not entered by the user