-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support task id entrypoints (#9344)
### Description Currently if you run `turbo cli#build` you will get the following failure*: ``` Error: × could not find task `cli#build` in project ``` *It works if you had `"tasks": {"cli#build": {...}}` in your root level `turbo.json` After this PR, passing a fully qualified task id to run will now work, regardless of how the task definition is defined: - In the root `turbo.json` as `build` - In the root `turbo.json` as `cli#build` - In the `cli` workspace's `turbo.json` as `build` The usage of `#` is safe here as you already have been unable to use `#` in a unqualified task name. - If you attempt to use a `#` in a task name in a workspace level `turbo.json` you will get an error about using package task syntax in a workspace file. - If you attempt to specify a task in the root `turbo.json` of the form `foo#bar` it will be read as the `bar` task in package `foo` - If you attempt to use `foo#bar#baz` as a task name in root `turbo.json` it will work currently with `foo#bar#baz` and after this PR it will continue to work ### Testing Instructions Added unit tests! Manual verification by running `turbo cli#build`.
- Loading branch information
1 parent
7bf0228
commit ba769dc
Showing
6 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ngine/snapshots/turborepo_lib__engine__builder__test__run_package_task_exact_error-2.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: crates/turborepo-lib/src/engine/builder.rs | ||
expression: msg | ||
--- | ||
"{\"message\": \"missing tasks in project\",\"severity\": \"error\",\"causes\": [],\"labels\": [],\"related\": [{\"message\": \"could not find task `app1#another` in project\",\"severity\": \"error\",\"causes\": [],\"filename\": \"\",\"labels\": [],\"related\": []}]}" |
5 changes: 5 additions & 0 deletions
5
.../engine/snapshots/turborepo_lib__engine__builder__test__run_package_task_exact_error.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
source: crates/turborepo-lib/src/engine/builder.rs | ||
expression: msg | ||
--- | ||
"{\"message\": \"missing tasks in project\",\"severity\": \"error\",\"causes\": [],\"labels\": [],\"related\": [{\"message\": \"could not find task `app1#special` in project\",\"severity\": \"error\",\"causes\": [],\"filename\": \"\",\"labels\": [],\"related\": []}]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters