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

Prometheus Rules File Match Rules Too Broad - Conflicting With Other Tools #4337

Open
ekkohdev opened this issue Jan 8, 2025 · 2 comments
Open

Comments

@ekkohdev
Copy link

ekkohdev commented Jan 8, 2025

Area with issue?

JSON Schema

✔️ Expected Behavior

I created a new stack called test in my Pulumi project, which results in a Pulumi.test.yaml stack config file. I am using VS Code with the RedHat YAML extension. Normally, no JSON Schema is automatically used for stack config files.

This is expected and allows authoring of the stack config as needed.

❌ Actual Behavior

The JSON Schema for prometheus.rules.test.json is being automatically used for my Pulumi.test.yaml file which results in validation errors and an interrupted editor experience. It appears, having any JSON/YAML file in a project with a name ending in .test.json or .test.yaml automatically uses the prometheus.rules.test.json schema.

This is too broad of a file match pattern, as it is very common to have this suffix in other tools. The issue with Pulumi I described above bought this to my attention but the same has been reported in other tools, such as Docker...

I'm not that familiar with prometheus rules to comment on how to make the pattern(s) more selective but the current patterns conflict with multiple other uses of .test.json/yaml.

The use of the schema store could be disabled entirely in the VS Code YAML extension but this is very inconvenient and a significant loss of functionality.

YAML or JSON file that does not work.

It looks like the issue was introduced in this PR: #3003

IDE or code editor.

Visual Studio Code

Are you making a PR for this?

No, someone else must create the PR.

@aureq
Copy link

aureq commented Jan 9, 2025

@MichaelSnowden and @madskristensen I'd like to point out that changes in #3006 (which tries to address #3003) is still too broad. At Pulumi we have Pulumi.<somename>.yaml which gets caught by *.tests.yaml file match rule quite often for our users.

@madskristensen
Copy link
Contributor

@aureq @MichaelSnowden @hyperupcall I agree. This should be fixed such that the prometheus file match is less generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants