Skip to content
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

fix: remove panic from task graph validation #5789

Merged
merged 2 commits into from
Aug 24, 2023
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
3 changes: 2 additions & 1 deletion crates/turborepo-lib/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ impl Engine<Built> {
.node_weight(dep_index)
.expect("index comes from iterating the graph and must be present")
else {
panic!("{task_id} depends on root task node");
// No need to check the root node
continue;
};

let task_definition = self.task_definitions.get(dep_id).ok_or_else(|| {
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 @@ -177,7 +177,12 @@ impl Run {

engine
.validate(&pkg_dep_graph, opts.run_opts.concurrency)
.map_err(|errors| anyhow!("Validation failed:\n{}", errors.into_iter().join("\n")))?;
.map_err(|errors| {
anyhow!(
"error preparing engine: Invalid persistent task configuration:\n{}",
errors.into_iter().join("\n")
)
})?;

if let Some(graph_opts) = opts.run_opts.graph {
match graph_opts {
Expand Down
Loading