Giter Club home page Giter Club logo

Comments (6)

flagarde avatar flagarde commented on May 26, 2024 1

Hi, I have test with 0.8.2 and there is no crash

from check-jsonschema.

sirosen avatar sirosen commented on May 26, 2024

The check-github-workflows hook fetches the latest schema from https://json.schemastore.org/github-workflow.
It will always attempt to fetch in case the schema has been updated.
The "Temporary failure in name resolution" points at DNS, suggesting that json.schemastore.org wasn't resolving for you.

So I have two questions for you:

  • Are you using the hook in an environment where the network was unavailable or restricted? e.g. laptop disconnected from wifi, running within a company intranet, etc
  • Does the failure persist, or did it fail once and is working now?

And a workaround:

  • If you download the schema from the link above, you can refer to the local path to your schema with --schemafile. The readme documents how to "reimplement" the github workflows hook in this way.

If you commit the schemastore schema to your repo, I believe it would be appropriate to put it in a directory with a copy of the schemastore license.

If that workaround is satisfying for you, I could document it in the readme.

from check-jsonschema.

flagarde avatar flagarde commented on May 26, 2024

Thanks for the fast response.

Concerning your questions, I'm using https://pre-commit.ci/ so I don't know if the have some restrictions but it could be the case.

from check-jsonschema.

sirosen avatar sirosen commented on May 26, 2024

I looked into the pre-commit.ci issue tracker a bit, and it seems that the system disallows use of the network at runtime. That's reasonable, but it also poses a problem for how I designed check-jsonschema.

I think the best possible solution is for check-jsonschema to bundle versions of the various schemas for supported hooks, and then to use those as a failover in the event that downloads from schemastore fail.
I'll need to script out vendorizing these schemas, so that I can easily pull in updates to keep the bundled versions fresh.
(I did consider having it pull in the schema at install time, but that's a lot trickier than having a vendored copy included.)

I also want to look into adding some retries for the download step and better logging if it fails and we don't have a failover schema to use, but that can be done later.

from check-jsonschema.

flagarde avatar flagarde commented on May 26, 2024

Indeed it makes sense to disallows the use of network at runtime.

The failover would be a very nice feature.

from check-jsonschema.

sirosen avatar sirosen commented on May 26, 2024

I've just released version 0.8.0, which adds in builtin schemas, including vendorized copies of the ones for the default hooks, and a behavior to failover to these schemas when downloading fails.

I believe this is sufficient to resolve this issue, so I've closed. But if someone could confirm that the fix works, that would be awesome! Please reopen if 0.8.0 isn't solving this.

from check-jsonschema.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.