Skip to content

Configure task dependencies to avoid redundant execution #607

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 2 commits into from
Jun 20, 2025

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 20, 2025

The Task task runner tool is used to perform common development operations for the project.

Tasks may call other tasks. Under certain conditions (most commonly when running a convenience "umbrella" which calls all tasks of a general type), this can result in the same task being called redundantly, which is inefficient. Worse, since task calls specified via the deps mapping of a task definition are executed concurrently, the multiple executions can conflict with each other and cause problems such as a spurious failure.

This can be avoided by configuring tasks which may be called multiple times, and for which it never makes sense to execute multiple times with the same conditions, so that all but the first call will be ignored:

https://taskfile.dev/usage/#limiting-when-tasks-run

Related

per1234 added 2 commits June 19, 2025 17:53
The "Poetry" tool is used to manage the project's Python package dependencies.

Dependencies might be classified into distinct categories. The most basic classification would be:

- Application dependencies: used by the project's applications
- Development dependencies: tools used in the development and maintenance of the project, but not by the application

By default, Poetry installs all non-optional dependencies. This can be inefficient in a case where a specific operation
is being performed, since a given operation might only require the dependencies from one category and so the
installation of dependencies from the other is pointless for that operation.

For this reason, Poetry allows the user to organize dependencies into arbitrary "groups", and to specify which groups
should be installed.

The Python package installation task is hereby updated to allow dependency groups to be specified, and the calls to that
task updated to specify the groups they require.
The "Task" task runner tool is used to perform common development operations for the project.

Tasks may call other tasks. Under certain conditions (most commonly when running a convenience "umbrella" which calls
all tasks of a general type), this can result in the same task being called redundantly, which is inefficient. Worse,
since task calls specified via the `deps` mapping of a task definition are executed concurrently, the multiple
executions can conflict with each other and cause problems such as a spurious failure.

This can be avoided by configuring tasks which may be called multiple times, and for which it never makes sense to
execute multiple times with the same conditions, so that all but the first call will be ignored.
@per1234 per1234 self-assigned this Jun 20, 2025
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: infrastructure Related to project infrastructure labels Jun 20, 2025
@per1234 per1234 merged commit 14f413c into arduino:main Jun 20, 2025
48 checks passed
@per1234 per1234 deleted the avoid-redundant-task-calls branch June 20, 2025 05:24
@per1234 per1234 changed the title Only install Python package dependencies from relevant group Configure task dependencies to avoid redundant execution Jun 20, 2025
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: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant