Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LER0ever
Copy link
Contributor

@LER0ever LER0ever commented Oct 18, 2025

Summary

Ref: #6681

Fixes issue where tasks using run = { task = ":hello" } syntax would fail to resolve local task references in monorepo projects.

Problem:
When a monorepo project task used :task syntax in a run block to reference another local task, the pattern wasn't being resolved before execution, causing the error:

':task' pattern should be expanded before matching

For example:

[tasks.runs-hello]
run = { task = ":hello" }  # This would fail

Root Cause:
The exec_task_run_entries function in run.rs was not resolving :task patterns before calling inject_and_wait. While the resolve_task_pattern function existed and was used for depends blocks, it wasn't being applied to run blocks.

Solution:
Apply resolve_task_pattern() to task references in both RunEntry::SingleTask and RunEntry::TaskGroup variants before injecting them into the task scheduler. This resolves :task patterns relative to the parent task's monorepo path.

Changes:

  • src/cli/run.rs: Updated exec_task_run_entries() to resolve patterns in both single task and task group run entries
  • e2e/tasks/test_task_monorepo_run_project_local_tasks: New test validating :task resolution in run blocks

Test plan

  • New e2e test test_task_monorepo_run_project_local_tasks validates the fix
  • All existing task dependency tests pass
  • All existing monorepo task tests pass

Fixes: #6681

πŸ€– Generated with Claude Code

## Summary

Fixes issue where tasks using `run = { task = ":hello" }` syntax would
fail to resolve local task references in monorepo projects.

**Problem:**
When a monorepo project task used `:task` syntax in a `run` block to
reference another local task, the pattern wasn't being resolved before
execution, causing the error:
```
':task' pattern should be expanded before matching
```

For example:
```toml
[tasks.runs-hello]
run = { task = ":hello" }  # This would fail
```

**Root Cause:**
The `exec_task_run_entries` function in `run.rs` was not resolving
`:task` patterns before calling `inject_and_wait`. While the
`resolve_task_pattern` function existed and was used for `depends`
blocks, it wasn't being applied to `run` blocks.

**Solution:**
Apply `resolve_task_pattern()` to task references in both
`RunEntry::SingleTask` and `RunEntry::TaskGroup` variants before
injecting them into the task scheduler. This resolves `:task` patterns
relative to the parent task's monorepo path.

**Changes:**
- `src/cli/run.rs`: Updated `exec_task_run_entries()` to resolve
patterns in both single task and task group run entries
- `e2e/tasks/test_task_monorepo_run_project_local_tasks`: New test
validating :task resolution in run blocks

## Test plan

- [x] New e2e test `test_task_monorepo_run_project_local_tasks` validates
the fix
- [x] All existing task dependency tests pass
- [x] All existing monorepo task tests pass

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@LER0ever LER0ever force-pushed the fix-monorepo-task-run-pattern branch from fa67ffb to b29deb3 Compare October 18, 2025 04:25
@jdx jdx merged commit 2027c48 into jdx:main Oct 18, 2025
25 checks passed
jdx pushed a commit that referenced this pull request Oct 18, 2025
### πŸš€ Features

- remove experimental labels from stable features by @jdx in
[#6684](#6684)

### πŸ› Bug Fixes

- **(tasks)** resolve :task patterns in run blocks for monorepo tasks by
@LER0ever in [#6682](#6682)

### πŸ“š Documentation

- Fix typo in comparison-to-asdf.md by @TobiX in
[#6677](#6677)

### πŸ“¦οΈ Dependency Updates

- update docker/dockerfile:1 docker digest to b6afd42 by @renovate[bot]
in [#6675](#6675)
- update fedora:43 docker digest to 2ad3073 by @renovate[bot] in
[#6676](#6676)

### New Contributors

- @LER0ever made their first contribution in
[#6682](#6682)

## πŸ“¦ Aqua Registry Updates

#### New Packages (1)

- [`mas-cli/mas`](https://github.com/mas-cli/mas)

#### Updated Packages (2)

- [`microsoft/edit`](https://github.com/microsoft/edit)
- [`nodejs/node`](https://github.com/nodejs/node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants