Skip to content

Commit

Permalink
fix: Run outline bugs (#6041)
Browse files Browse the repository at this point in the history
### Description

Fixes bug with root workspace inclusion logic.

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes TURBO-1367

---------

Co-authored-by: Alexander Lyon <Alexander Lyon>
Co-authored-by: nicholaslyang <Nicholas Yang>
  • Loading branch information
NicholasLYang committed Sep 27, 2023
1 parent 26a50ca commit 8cedae6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GENERATED_FILES = internal/turbodprotocol/turbod.pb.go internal/turbodprotocol/t
# We do not set go-turbo as a dependency because the Rust build.rs
# script will call it for us and copy over the binary
turbo:
cargo build -p turbo
cargo build -p turbo --features run-stub

turbo-prod:
cargo build --release --manifest-path ../crates/turborepo/Cargo.toml
Expand Down
7 changes: 6 additions & 1 deletion crates/turborepo-lib/src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ impl<'a> Run<'a> {

if filtered_pkgs.len() != pkg_dep_graph.len() {
for target in self.targets() {
let task_name = TaskName::from(target.as_str());
let mut task_name = TaskName::from(target.as_str());
// If it's not a package task, we convert to a root task
if !task_name.is_package_task() {
task_name = task_name.into_root_task()
}

if root_turbo_json.pipeline.contains_key(&task_name) {
filtered_pkgs.insert(WorkspaceName::Root);
break;
Expand Down
10 changes: 10 additions & 0 deletions turborepo-tests/integration/tests/single_package/graph.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ Graph
\t} (esc)
}

Graph in Rust
$ ${TURBO} run build --graph --experimental-rust-codepath
digraph {
\tcompound = "true" (esc)
\tnewrank = "true" (esc)
\tsubgraph "root" { (esc)
\t\t"[root] build" -> "[root] ___ROOT___" (esc)
\t} (esc)
}

0 comments on commit 8cedae6

Please sign in to comment.