question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uses the wrong schema, even when yaml.schemas is set

See original GitHub issue

Describe the bug

wtfbbq

I’m using this extension and the GitHub Actions YAML extension. The last three error messages (using the proper schema) are from that other extension. The erroneous errors above them are from this extension. Disabling the GitHub Actions extension makes those last three (correct, proper) errors disappear, leaving the false errors this extension is reporting.

The problem: this extension thinks my GitHub Actions workflow file is a “deploy php” file and so uses the wrong schema… simply because it has the word “deploy” in its file name. Change the name to build-test-deplox.yml and everything works. I can’t make this extension ignore YAML files and I can’t force this extension to use the correct schema (on the right, you can see the yaml.schemas setting being completely ignored).

Unfortunately for my .github/dependabot.yml file, I’ve had to disable this extension for now. Am I doing something wrong here?

Expected Behavior

Use https://json.schemastore.org/github-workflow for build-test-deploy.yml like I told it to

Current Behavior

Uses https://raw.githubusercontent.com/deployphp/deployer/master/src/schema.json instead

Steps to Reproduce

  1. Have .github/workflows/build-test-deploy.yml file in your project
  2. Observe this extension invoke the wrong schema
  3. Try to override the schema for that file (using both full path and simple file name)
  4. Observe this extension continue to invoke the wrong schema

Bonus: replace “https://json.schemastore.org/github-workflow” with “https://json.schemastore.org/github-workflowfdsfdsff” in yaml.schemas and the extension recognizes that the schema does not exist, so it is receiving the proper schema from settings.json!

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:39
  • Comments:29 (2 by maintainers)

github_iconTop GitHub Comments

45reactions
MostefaKamalLalacommented, Aug 10, 2021

For those who don’t know how to set the schema settings with:

"yaml.schemas": {
  "https://json.schemastore.org/github-workflow": "/.github/workflows/**/*.yml"
}

Simply press Ctrl+, in visual code > Extentions > Yaml > Edit in settings.json right after Yaml: completion

14reactions
JPinkneycommented, Jan 6, 2021

It looks like "/.githhub/workflows/**/*.yml" is spelt wrong, it should probably be "/.github/workflows/**/*.yml". This issue is going to be fixed in the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't use JSON schema when edition YAML file in Visual ...
How to turn this off and simply use YAML syntax highlighting without specific JSON schema? In the schema selector there is not "No...
Read more >
How to configure YAML schema to make editing files easier
One of the drawbacks is that editing YAML files may not always be easy. For instance, writing a tag at the wrong indentation...
Read more >
Documentation: 15: 5.9. Schemas - PostgreSQL
To put our new schema in the path, we use: SET search_path TO myschema,public;. (We omit the $user here because we have no...
Read more >
Formats, Serializers, and Deserializers
When using RecordNameStrategy with Protobuf and JSON Schema, ... If auto.register.schemas is set to false and use.latest.version is set to true ...
Read more >
Schema allows additional properties
Unless you specifically set additionalProperties to false , the schema continues to ... leak stack trace that can be used for further attacks,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found