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 "base" schema in validation tasks #452

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jan 31, 2024

The dependabot:validate and npm:validate tasks validate configuration files against their JSON schemas to catch any problems with the data format.

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

schema /tmp/dependabot-schema-CuMFs6bqY1.json is invalid
error: can't resolve reference https://json.schemastore.org/base.json#/definitions/timezone from id https://json.schemastore.org/timezone
schema /tmp/package-json-schema-m3x8Uu4NED.json is invalid error: can't resolve reference https://json.schemastore.org/base.json#/definitions/license from id https://json.schemastore.org/package.json#

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

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-m3x8Uu4NED.json is invalid
error: can't resolve reference https://json.schemastore.org/base.json#/definitions/license from id https://json.schemastore.org/package.json#

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.
The "dependabot: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
Dependabot configuration schema was recently updated to share resources with the "base" configuration schema, which
caused the validation to start failing:

schema /tmp/dependabot-schema-CuMFs6bqY1.json is invalid
error: can't resolve reference https://json.schemastore.org/base.json#/definitions/timezone from id https://json.schemastore.org/timezone

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: code Related to content of the project itself topic: infrastructure Related to project infrastructure labels Jan 31, 2024
@per1234 per1234 self-assigned this Jan 31, 2024
@per1234 per1234 merged commit f4f08aa into arduino:main Jan 31, 2024
47 checks passed
@per1234 per1234 deleted the base-schema branch January 31, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself 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.

1 participant