Skip to content

Only validate package.json files in specified paths #122

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 12, 2025

The project infrastructure validates the package.json npm configuration files against their JSON schema.

Previously, in order to provide validation coverage for all package.json files in any locations in the repository, a "globstar" was used to cause the validator to recursively search the entire file tree under the repository. That approach is problematic because the repository contains externally maintained files (e.g., the npm packages under the node_modules folder). Searching and validating these files is inefficient at best and the cause of spurious failures at worst.

This is avoided by targeting the search. Support for a repository maintainer to configure any number of specific locations of npm-managed projects in the "Check npm" workflow has been added, so this system is used to target the validations. When the npm:validate task is ran by a contributor on their local clone, it defaults to the root of the repository, but the path can be configured by setting the PROJECT_PATH taskfile variable via an argument to the task invocation command.

The project infrastructure validates the package.json npm configuration files against their JSON schema.

Previously, in order to provide validation coverage for all package.json files in any locations in the repository, a
"globstar" was used to cause the validator to recursively search the entire file tree under the repository. That
approach is problematic because the repository contains externally maintained files (e.g., the npm packages under the
node_modules folder). Searching and validating these files is inefficient at best and the cause of spurious failures at
worst.

This is avoided by targeting the search. Support for a repository maintainer to configure any number of specific
locations of npm-managed projects in the "Check npm" workflow has been added, so this system is used to target the
validations. When the `npm:validate` task is ran by a contributor on their local clone, it defaults to the root of the
repository, but the path can be configured by setting the PROJECT_PATH taskfile variable via an argument to the task
invocation command.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Mar 12, 2025
@per1234 per1234 self-assigned this Mar 12, 2025
@per1234 per1234 merged commit 1418267 into arduino:master Mar 12, 2025
24 checks passed
@per1234 per1234 deleted the targeted-npm-validation branch March 12, 2025 11:53
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: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant