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

Install referenced schema in "npm:validate" task #96

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Install referenced schema in "npm:validate" task #96

merged 1 commit into from
Jan 31, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jan 31, 2024

The npm:validate task validates the repository's package.json npm manifest file against its JSON schema to catch any problems with its data format.

In order to avoid duplication of content, JSON schemas may reference other schemas via the $ref keyword. The package.json schema was recently updated to share resources with the "base" configuration schema, which caused the validation to start failing:

https://github.com/arduino/setup-protoc/actions/runs/7728930562/job/21070931021#step:5:88

schema /tmp/package-json-schema-norSGPxlCR.json is invalid
error: can't resolve reference https://json.schemastore.org/base.json#/definitions/license from id https://json.schemastore.org/package.json#
task: Failed to run task "npm:validate": exit status 1

The solution is to configure the task to download that schema as well and also to provide its path to the avj-cli validator via a -r flag.


This is a sync from the upstream "template" asset: arduino/tooling-project-assets@c4393b0

The "npm:validate" task validates the repository's `package.json` npm manifest file against its JSON schema to catch any
problems with its data format.

In order to avoid duplication of content, JSON schemas may reference other schemas via the `$ref` keyword. The
`package.json` schema was recently updated to share resources with the "base" configuration schema, which caused the
validation to start failing:

schema /tmp/package-json-schema-norSGPxlCR.json is invalid
error: can't resolve reference https://json.schemastore.org/base.json#/definitions/license from id https://json.schemastore.org/package.json#
task: Failed to run task "npm:validate": exit status 1

The solution is to configure the task to download that schema as well and also to provide its path to the avj-cli
validator via a `-r` flag.
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: infrastructure Related to project infrastructure labels Jan 31, 2024
@per1234 per1234 self-assigned this Jan 31, 2024
@per1234 per1234 mentioned this pull request Jan 31, 2024
Copy link
Contributor

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Super!

@per1234 per1234 merged commit a3ad94c into arduino:master Jan 31, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants