Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitlab-ci files are not recognized, if they live under .gitlab/ci #3994

Open
alsmnn opened this issue Aug 16, 2024 · 2 comments
Open

gitlab-ci files are not recognized, if they live under .gitlab/ci #3994

alsmnn opened this issue Aug 16, 2024 · 2 comments
Labels
issue:filematch-conflict Wrong schema triggered for this json.

Comments

@alsmnn
Copy link

alsmnn commented Aug 16, 2024

Area with issue?

JSON Schema

✔️ Expected Behavior

To break the gitlab ci configuration into smaller files it is possible to put them into the folder .gitlab/ci. Then you can include these files in the .gitlab-ci.yml file, which is lying in the root dir of the project.
This makes it easy to work with complex pipelines.
In catalog.json you could expand the fileMatch argument with the following parameters:
"**.gitlab/ci/*.yml", "**.gitlab/ci/*.yaml"
This would be great, so you could organize the files as the stages or jobs they represent.

❌ Actual Behavior

If i place a gitlab-ci file, which has something to do with docker images under .gitlab/ci and name it docker.yml it will result in the following file path: .gitlab/ci/docker.yml.
Although it is a valid gitlab-ci file, the fileMatch regex is not satisfied and therefore the correct schema could not be selected.

YAML or JSON file that does not work.

Any otherwise correct .gitlab-ci.yml file under the dir $PROJECT_ROOT/.gitlab/ci

IDE or code editor.

None

Are you making a PR for this?

Yes, I will create a PR.

Edit: changed link to correct position and corrected fileMatch pattern

@alsmnn alsmnn added the issue:bug Report errors or unexpected behavior (auto-generated by issue forms) label Aug 16, 2024
@hyperupcall hyperupcall added issue:filematch-conflict Wrong schema triggered for this json. and removed issue:bug Report errors or unexpected behavior (auto-generated by issue forms) labels Oct 5, 2024
@alsmnn
Copy link
Author

alsmnn commented Nov 26, 2024

Somehow my link was linking to the wrong section.
Here is the correct link

"name": "gitlab-ci",

"name": "gitlab-ci",
      "description": "GitLab CI Configuration file",
      "fileMatch": [
        "**/.gitlab-ci.yml",
        "**/.gitlab-ci.yaml",
        "**/*.gitlab-ci.yml",
        "**/*.gitlab-ci.yaml"
      ],

You could do something like

"name": "gitlab-ci",
      "description": "GitLab CI Configuration file",
      "fileMatch": [
        "**/.gitlab-ci.yml",
        "**/.gitlab-ci.yaml",
        "**/.gitlab/ci/*.yml",
        "**/.gitlab/ci/*.yaml,
        "**/*.gitlab-ci.yml",
        "**/*.gitlab-ci.yaml",
      ],

which shouldn't result in a filematch conflict

@hyperupcall
Copy link
Member

Thanks for the report - related to #1783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue:filematch-conflict Wrong schema triggered for this json.
Projects
None yet
Development

No branches or pull requests

2 participants