Frontend: Circular includes in pipeline config no longer being detected correctly by validator, 500 error when committing changes to `.gitlab-ci.yml` via repo editor
Summary
When a pipeline is configured such that .gitlab-ci.yml
includes file1.yml
which includes file2.yml
which includes file1.yml
(i.e. a circular reference) no message is displayed in the CI/CD Editor indicating the same file has been included twice. Instead a "Configuration validation currently not available." message is displayed.
In earlier versions (e.g. 14.6.5) a message like "This GitLab CI configuration is invalid: Include {"local":"file1.yml"}
was already included!" was displayed.
Additionally, when you edit the .gitlab-ci.yml
file via the Repository file editor a 500 error is generated upon committing the change.
Steps to reproduce
- Create a new project
cicd-circular
- Create a file
file1.yml
:
include:
- file2.yml
- Create a file
file2.yml
:
include:
- file1.yml
- Create a file
.gitlab-ci.yml
:
include:
- file1.yml
- Go to CI/CD Editor. Note after a period of time the message "Configuration validation currently not available." is displayed.
- Go to Repository, Files, click on
.gitlab-ci.yml
and then click on Edit. Make a minor change and click Commit Changes. After a period a 500 error is displayed.
Implementation Table
Example Project
https://gitlab.com/jfarmiloe/cicd-circular
What is the current bug behavior?
Repository file editor and CI/CD Validator break when faced with circular include statements in pipeline config.
What is the expected correct behavior?
frontend A useful message should be displayed in the CI/CD Editor page indicating a circular reference has been detected.
Unable to validate CI/CD configuration. See the \[GitLab CI/CD troubleshooting guide\](https://docs.gitlab.com/ee/ci/troubleshooting.html#common-cicd-issues) for more details.
backend Changes made to the .gitlab-ci.yml
file via the Repository file editor should commit without error.
Relevant logs and/or screenshots
Version 14.6.5 CI/CD Editor page:
GitLab.com CI/CD Editor page:
Output of checks
This bug happens on GitLab.com.