Skip to content

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Sep 11, 2025

A repository might contain multiple npm-managed projects. For this reason, the appropriate npm-managed tasks have a parameter environment variable that allows it to be configured for an arbitrary path, with the "Check npm" workflow having a job matrix of paths to pass.

Generally, even if there are multiple npm-managed projects, there will be one primary project that is most often the target of contributor operation. Since it would be inconvenient for the contributor to pass the environment variable path every time they want to run a task for that primary project, the tasks are configured to have a default path which is used if the variable is not defined by the user.

Since the primary npm-managed project would typically be in the root of the repository, the default value is set to the root. In the case where the primary npm-managed project is not in the root of the repository, the template installer will need to adjust this. Previously the default was hard coded in each individual task. The template will be made easier to install by defining the default in a single place via a friendly taskfile variable, following the convention already established by the templates for Go-based projects.

…ters

For the sake of efficiency, GitHub Workflows should be configured to only be triggered when relevant files are modified.
This filtering is done via the `paths` mapping. "Globstar" patterns are supported in paths filters. This will cause the
filter to match the matching files in any path under the repository.

Previously, this was done for the `.npmrc` npm configuration file in various workflows. Although this is appropriate in
the "Check npm" workflow, which supports checking npm-based projects in subfolders of the repository, it is not
appropriate for the other workflows which do not have such support (and likely don't need it).

In order to improve the efficiency of the workflows, the globstars are removed from the `.npmrc` path filters in the
workflows where it is not appropriate.
A repository might contain multiple npm-managed projects. For this reason, the appropriate npm-managed tasks have a
parameter environment variable that allows it to be configured for an arbitrary path, with the "Check npm" workflow
having a job matrix of paths to pass.

Generally, even if there are multiple npm-managed projects, there will be one primary project that is most often the
target of contributor operation. Since it would be inconvenient for the contributor to pass the environment variable
path every time they want to run a task for that primary project, the tasks are configured to have a default path which
is used if the variable is not defined by the user.

Since the primary npm-managed project would typically be in the root of the repository, the default value is set to the
root. In the case where the primary npm-managed project is not in the root of the repository, the template installer
will need to adjust this. Previously the default was hard coded in each individual task. The template will be made
easier to install by defining the default in a single place via a friendly taskfile variable, following the convention
already established by the templates for Go-based projects.
@per1234 per1234 self-assigned this Sep 11, 2025
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Sep 11, 2025
Copy link

codecov bot commented Sep 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.33%. Comparing base (512c586) to head (2affc92).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #933   +/-   ##
=======================================
  Coverage   83.33%   83.33%           
=======================================
  Files           1        1           
  Lines         180      180           
=======================================
  Hits          150      150           
  Misses         19       19           
  Partials       11       11           
Flag Coverage Δ
unit 83.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@per1234 per1234 merged commit e9eab18 into arduino:main Sep 11, 2025
58 of 70 checks passed
@per1234 per1234 deleted the configure-npm-path branch September 14, 2025 02:49
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