这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(cli): no longer attempt to parse task name as continue value #10097

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 5 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ pub struct ExecutionArgs {
/// continue running tasks whose dependencies have succeeded. Use "always"
/// to continue running all tasks, even those whose dependencies have
/// failed.
#[clap(long = "continue", value_name = "CONTINUE", num_args = 0..=1, default_value = "never", default_missing_value = "always")]
#[clap(long = "continue", value_name = "CONTINUE", num_args = 0..=1, default_value = "never", default_missing_value = "always", require_equals = true)]
pub continue_execution: ContinueMode,
/// Run turbo in single-package mode
#[clap(long)]
Expand Down Expand Up @@ -1945,6 +1945,21 @@ mod test {
} ;
"continue option with no value"
)]
#[test_case::test_case(
&["turbo", "run", "--continue", "build"],
Args {
command: Some(Command::Run {
execution_args: Box::new(ExecutionArgs {
tasks: vec!["build".to_string()],
continue_execution: ContinueMode::Always,
..get_default_execution_args()
}),
run_args: Box::new(get_default_run_args())
}),
..Args::default()
} ;
"continue option with no value before task"
)]
#[test_case::test_case(
&["turbo", "run", "build", "--continue=dependencies-successful"],
Args {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ error: unexpected argument '--no-daemon' found
tip: a similar argument exists: '--no-update-notifier'
tip: to pass '--no-daemon' as a value, use '-- --no-daemon'

Usage: turbo watch --no-update-notifier <--cache-dir <CACHE_DIR>|--concurrency <CONCURRENCY>|--continue [<CONTINUE>]|--single-package|--framework-inference [<BOOL>]|--global-deps <GLOBAL_DEPS>|--env-mode [<ENV_MODE>]|--filter <FILTER>|--affected|--output-logs <OUTPUT_LOGS>|--log-order <LOG_ORDER>|--only|--pkg-inference-root <PKG_INFERENCE_ROOT>|--log-prefix <LOG_PREFIX>|TASKS|PASS_THROUGH_ARGS>
Usage: turbo watch --no-update-notifier <--cache-dir <CACHE_DIR>|--concurrency <CONCURRENCY>|--continue[=<CONTINUE>]|--single-package|--framework-inference [<BOOL>]|--global-deps <GLOBAL_DEPS>|--env-mode [<ENV_MODE>]|--filter <FILTER>|--affected|--output-logs <OUTPUT_LOGS>|--log-order <LOG_ORDER>|--only|--pkg-inference-root <PKG_INFERENCE_ROOT>|--log-prefix <LOG_PREFIX>|TASKS|PASS_THROUGH_ARGS>

For more information, try '--help'.
2 changes: 1 addition & 1 deletion docs/repo-docs/guides/migrating-from-nx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ Configuration found in `nx.json` can be mapped to `turbo.json` using the tables
| `nx run-many` | [`turbo run`](/repo/docs/reference/run) |
| `nx reset` | [`--force`](/repo/docs/reference/run#--force) |
| `--parallel` | [`--concurrency`](/repo/docs/reference/run#--concurrency-number--percentage) |
| `--nxBail` | [`--continue`](/repo/docs/reference/run#--continue-option) |
| `--nxBail` | [`--continue`](/repo/docs/reference/run#--continueoption) |
| `--projects` | [`--filter`](/repo/docs/reference/run#--filter-string) |
| `--graph` | [`--graph`](/repo/docs/reference/run#--graph-file-type) |
| `--output-style` | [`--log-order`](/repo/docs/reference/run#--log-order-option) |
Expand Down
8 changes: 4 additions & 4 deletions docs/repo-docs/reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ turbo run build --concurrency=50%
turbo run test --concurrency=5
```

### `--continue <option>`
### `--continue[=<option>]`

Default: `never`

Specify how `turbo` should handle current and pending tasks in the presence of an error (e.g. non-zero exit code from a task).

- When `--continue` is `never` and an error occurs, `turbo` will cancel all tasks.
- When `--continue` is `dependencies-successful` and an error occurs, `turbo` will cancel dependent tasks. Tasks whose dependencies have succeeded will continue to run.
- When `--continue` is `always` and an error occurs, `turbo` will continue running all tasks, even those whose dependencies have failed.
- When `--continue=never` and an error occurs, `turbo` will cancel all tasks.
- When `--continue=dependencies-successful` and an error occurs, `turbo` will cancel dependent tasks. Tasks whose dependencies have succeeded will continue to run.
- When `--continue=always` and an error occurs, `turbo` will continue running all tasks, even those whose dependencies have failed.
- When `--continue` is specified without a value, it will default to `always`.

In all cases, `turbo` will exit with the highest exit code value encountered during execution.
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/tests/no-args.t
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Make sure exit code is 2 when no args are passed
Override the filesystem cache directory
--concurrency <CONCURRENCY>
Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution
--continue [<CONTINUE>]
--continue[=<CONTINUE>]
Specify how task execution should proceed when an error occurs. Use "never" to cancel all tasks. Use "dependencies-successful" to continue running tasks whose dependencies have succeeded. Use "always" to continue running all tasks, even those whose dependencies have failed [default: never] [possible values: never, dependencies-successful, always]
--single-package
Run turbo in single-package mode
Expand Down
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/turbo-help.t
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Test help flag
Override the filesystem cache directory
--concurrency <CONCURRENCY>
Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution
--continue [<CONTINUE>]
--continue[=<CONTINUE>]
Specify how task execution should proceed when an error occurs. Use "never" to cancel all tasks. Use "dependencies-successful" to continue running tasks whose dependencies have succeeded. Use "always" to continue running all tasks, even those whose dependencies have failed [default: never] [possible values: never, dependencies-successful, always]
--single-package
Run turbo in single-package mode
Expand Down Expand Up @@ -273,7 +273,7 @@ Test help flag
--concurrency <CONCURRENCY>
Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution

--continue [<CONTINUE>]
--continue[=<CONTINUE>]
Specify how task execution should proceed when an error occurs. Use "never" to cancel all tasks. Use "dependencies-successful" to continue running tasks whose dependencies have succeeded. Use "always" to continue running all tasks, even those whose dependencies have failed

[default: never]
Expand Down
Loading