'Included file does not have a valid YAML syntax

I am including a remote .gitlab-ci.yml file

variables:
   ENTITY_NAME: $CI_PROJECT_TITLE

include:
   remote: 'https://gitlab.com/paulblart/paul_test/-/main/.gitlab-ci.yml'

but checking for it YAML syntax in CI Lint GUI its saying

Included file 'https://gitlab.com/paulblart/paul_test/-/main/.gitlab-ci.yml' does not have valid YAML syntax!

But upon checking the syntax of .gitlab-ci.yml of the remote file its valid. I am not sure whats going on.



Solution 1:[1]

I saw a different version of problem in my case, I was trying to set CI/CD configuration file pointing to a different project with relatively longer name of a valid yaml file. I checked the linting, file was yaml but error thrown while attempting to run the pipeline was: Included file .gitlab-ci-a-very-long-gilabci-file.yml@group/subgroup/pipeline-project does not have YAML extension!

Shortening the name solved it, Gitlab can improve the error messages. Just adding as I didn't find it on Stackoverflow.

Solution 2:[2]

In addition to Radovan's response, I will provide some rationale for why ConstraintVerifier works the way it does.

For individual constraints, it does not take ConstraintConfiguration into account. That is because ConstraintConfiguration is solution-specific, and we want to be able to test consraints individually and independently. In this case, we only test match weights; match weights exist regardless of the solution, and regardless of constraint configuration. This would be your typical unit test. (If you prefer another way of thinking about this, consider the fact that constraint configuration is optional and most do not, in fact, use it.)

For integration testing, we support testing an entire solution. And when you test all the constraints as a whole, that is where we take your ConstraintConfiguration into account.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ashish bustler
Solution 2 Lukáš Petrovický