From 82f00f10cdca7923fd5dd801fb4c266e4ae9bc00 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 12 Dec 2023 18:39:53 -0800 Subject: [PATCH] fix: Fix custom IDs and implicit deps. (#1228) * Keep track of renamed IDs. * Update changelog. * Try a diff approach. * Update tests. * Fix tests. * Try bash again. --- .cargo/nextest.toml | 4 +- .github/workflows/rust.yml | 1 + ...raph_test__aliases__uses_ids_in_graph.snap | 26 ++-- .../project_graph_test__many_projects.snap | 14 +-- ...est__single_project_with_dependencies.snap | 10 +- ...aliases_test__graph_uses_id_for_nodes.snap | 26 ++-- nextgen/project-graph/src/project_graph.rs | 11 +- .../src/project_graph_builder.rs | 112 ++++++++++++++---- .../project-graph/tests/project_graph_test.rs | 17 +-- ...project_graph__aliases__loads_aliases.snap | 24 ++-- ...__project_graph__to_dot__renders_full.snap | 18 +-- ...roject_graph__to_dot__renders_partial.snap | 6 +- packages/cli/CHANGELOG.md | 2 + 13 files changed, 169 insertions(+), 102 deletions(-) diff --git a/.cargo/nextest.toml b/.cargo/nextest.toml index b776110f0dc..f8d6a605ad5 100644 --- a/.cargo/nextest.toml +++ b/.cargo/nextest.toml @@ -4,5 +4,5 @@ failure-output = "immediate-final" retries = 1 test-threads = 2 -# [profile.default] -# test-threads = 8 +[profile.default] +test-threads = 8 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 48a7ab8cf5b..45952582a53 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,6 +83,7 @@ jobs: - uses: mozilla-actions/sccache-action@v0.0.3 - name: Checking coverage status id: coverage + shell: bash run: echo "coverage=$WITH_COVERAGE" >> $GITHUB_OUTPUT env: WITH_COVERAGE: diff --git a/crates/cli/tests/snapshots/project_graph_test__aliases__uses_ids_in_graph.snap b/crates/cli/tests/snapshots/project_graph_test__aliases__uses_ids_in_graph.snap index 46060364625..4694e89958b 100644 --- a/crates/cli/tests/snapshots/project_graph_test__aliases__uses_ids_in_graph.snap +++ b/crates/cli/tests/snapshots/project_graph_test__aliases__uses_ids_in_graph.snap @@ -3,22 +3,22 @@ source: crates/cli/tests/project_graph_test.rs expression: assert.output() --- digraph { - 0 [ label="explicitAndImplicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="nodeNameScope" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 [ label="nodeNameOnly" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 3 [ label="node" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 0 [ label="nodeNameScope" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="nodeNameOnly" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 [ label="node" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 3 [ label="explicitAndImplicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 4 [ label="explicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 5 [ label="noLang" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 6 [ label="implicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 0 -> 1 [ label="production" arrowhead=none] - 0 -> 2 [ label="peer" arrowhead=none] - 3 -> 2 [ label="production" arrowhead=box, arrowtail=box] - 3 -> 1 [ label="production" arrowhead=box, arrowtail=box] - 0 -> 3 [ label="development" arrowhead=none] - 4 -> 1 [ label="production" arrowhead=box, arrowtail=box] - 4 -> 3 [ label="development" arrowhead=box, arrowtail=box] - 6 -> 1 [ label="development" arrowhead=box, arrowtail=box] - 6 -> 3 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 1 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 3 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 3 -> 1 [ label="peer" arrowhead=box, arrowtail=box] + 3 -> 2 [ label="development" arrowhead=box, arrowtail=box] + 4 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 4 -> 2 [ label="development" arrowhead=box, arrowtail=box] + 6 -> 0 [ label="development" arrowhead=box, arrowtail=box] + 6 -> 2 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/crates/cli/tests/snapshots/project_graph_test__many_projects.snap b/crates/cli/tests/snapshots/project_graph_test__many_projects.snap index 4e8039790d1..a8f3feb4f93 100644 --- a/crates/cli/tests/snapshots/project_graph_test__many_projects.snap +++ b/crates/cli/tests/snapshots/project_graph_test__many_projects.snap @@ -7,14 +7,14 @@ digraph { 1 [ label="emptyConfig" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 2 [ label="platforms" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 3 [ label="bar" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 4 [ label="basic" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 5 [ label="noConfig" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 4 [ label="noConfig" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 5 [ label="basic" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 6 [ label="advanced" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 7 [ label="foo" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 8 [ label="baz" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 4 -> 5 [ label="production" arrowhead=box, arrowtail=box] - 7 -> 3 [ label="production" arrowhead=box, arrowtail=box] - 7 -> 8 [ label="production" arrowhead=box, arrowtail=box] + 7 [ label="baz" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 8 [ label="foo" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 5 -> 4 [ label="production" arrowhead=box, arrowtail=box] + 8 -> 3 [ label="production" arrowhead=box, arrowtail=box] + 8 -> 7 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependencies.snap b/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependencies.snap index f215c430725..47197d0d4ab 100644 --- a/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependencies.snap +++ b/crates/cli/tests/snapshots/project_graph_test__single_project_with_dependencies.snap @@ -3,11 +3,11 @@ source: crates/cli/tests/project_graph_test.rs expression: assert.output() --- digraph { - 0 [ label="foo" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="bar" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 [ label="baz" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 0 -> 1 [ label="production" arrowhead=none] - 0 -> 2 [ label="production" arrowhead=none] + 0 [ label="bar" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="baz" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 [ label="foo" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 1 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/crates/node/platform/tests/snapshots/project_aliases_test__graph_uses_id_for_nodes.snap b/crates/node/platform/tests/snapshots/project_aliases_test__graph_uses_id_for_nodes.snap index 82834b949a5..0a84ee1f237 100644 --- a/crates/node/platform/tests/snapshots/project_aliases_test__graph_uses_id_for_nodes.snap +++ b/crates/node/platform/tests/snapshots/project_aliases_test__graph_uses_id_for_nodes.snap @@ -3,21 +3,21 @@ source: crates/node/platform/tests/project_aliases_test.rs expression: graph.to_dot() --- digraph { - 0 [ label="explicitAndImplicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="nodeNameScope" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 [ label="nodeNameOnly" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 3 [ label="node" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 0 [ label="nodeNameScope" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="nodeNameOnly" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 [ label="node" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 3 [ label="explicitAndImplicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 4 [ label="explicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 5 [ label="noLang" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 6 [ label="implicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 0 -> 1 [ label="production" arrowhead=none] - 0 -> 2 [ label="peer" arrowhead=none] - 3 -> 2 [ label="production" arrowhead=box, arrowtail=box] - 3 -> 1 [ label="production" arrowhead=box, arrowtail=box] - 0 -> 3 [ label="development" arrowhead=none] - 4 -> 1 [ label="production" arrowhead=box, arrowtail=box] - 4 -> 3 [ label="development" arrowhead=box, arrowtail=box] - 6 -> 1 [ label="development" arrowhead=box, arrowtail=box] - 6 -> 3 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 1 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 3 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 3 -> 1 [ label="peer" arrowhead=box, arrowtail=box] + 3 -> 2 [ label="development" arrowhead=box, arrowtail=box] + 4 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 4 -> 2 [ label="development" arrowhead=box, arrowtail=box] + 6 -> 0 [ label="development" arrowhead=box, arrowtail=box] + 6 -> 2 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/nextgen/project-graph/src/project_graph.rs b/nextgen/project-graph/src/project_graph.rs index 854bce09e9d..b91907bb0b9 100644 --- a/nextgen/project-graph/src/project_graph.rs +++ b/nextgen/project-graph/src/project_graph.rs @@ -31,6 +31,7 @@ pub struct ProjectGraphCache<'graph> { pub struct ProjectNode { pub alias: Option, pub index: NodeIndex, + pub original_id: Option, pub source: WorkspaceRelativePathBuf, } @@ -377,7 +378,15 @@ impl ProjectGraph { } else { self.nodes .iter() - .find(|(_, node)| node.alias.as_ref().is_some_and(|a| a == alias_or_id)) + .find(|(_, node)| { + node.alias + .as_ref() + .is_some_and(|alias| alias == alias_or_id) + || node + .original_id + .as_ref() + .is_some_and(|id| id == alias_or_id) + }) .map(|(id, _)| id.as_str()) .unwrap_or(alias_or_id) }) diff --git a/nextgen/project-graph/src/project_graph_builder.rs b/nextgen/project-graph/src/project_graph_builder.rs index 1cffb642d83..602494381cd 100644 --- a/nextgen/project-graph/src/project_graph_builder.rs +++ b/nextgen/project-graph/src/project_graph_builder.rs @@ -59,9 +59,13 @@ pub struct ProjectGraphBuilder<'app> { /// Nodes (projects) inserted into the graph. nodes: FxHashMap, + /// Projects that have explicitly renamed themselves. + /// Maps original ID to renamed ID. + renamed_ids: FxHashMap, + /// The root project ID. #[serde(skip)] - root_project_id: Option, + root_id: Option, /// Mapping of project IDs to file system sources, /// derived from the `workspace.projects` setting. @@ -81,7 +85,8 @@ impl<'app> ProjectGraphBuilder<'app> { aliases: FxHashMap::default(), graph: DiGraph::new(), nodes: FxHashMap::default(), - root_project_id: None, + renamed_ids: FxHashMap::default(), + root_id: None, sources: FxHashMap::default(), }; @@ -181,6 +186,12 @@ impl<'app> ProjectGraphBuilder<'app> { }); } + for (original_id, id) in self.renamed_ids { + nodes.entry(id).and_modify(|node| { + node.original_id = Some(original_id); + }); + } + let mut graph = ProjectGraph::new(self.graph, nodes, context.workspace_root); graph.working_dir = context.working_dir.to_owned(); @@ -215,7 +226,7 @@ impl<'app> ProjectGraphBuilder<'app> { &mut self, project_locator: &str, cycle: &mut FxHashSet, - ) -> miette::Result { + ) -> miette::Result<(Id, NodeIndex)> { let id = self.resolve_id(project_locator); // Already loaded, exit early with existing index @@ -225,7 +236,7 @@ impl<'app> ProjectGraphBuilder<'app> { "Project already exists in the project graph, skipping load", ); - return Ok(*index); + return Ok((id, *index)); } // Check that the project ID is configured @@ -239,44 +250,92 @@ impl<'app> ProjectGraphBuilder<'app> { }; // Create the project - let project = self.build_project(id, source).await?; - let dependencies = project - .dependencies - .values() - .map(|v| v.to_owned()) - .collect::>(); // How to avoid cloning??? - - // Add to the graph + let mut project = self.build_project(id, source).await?; let id = project.id.clone(); - let index = self.graph.add_node(project); cycle.insert(id.clone()); - self.nodes.insert(id.clone(), index); // Create dependent projects - for dep_config in dependencies { - if cycle.contains(&dep_config.id) { + let mut edges = vec![]; + + for dep_config in project.dependencies.values_mut() { + let loaded_dep_id = if cycle.contains(&dep_config.id) { debug!( id = id.as_str(), dependency_id = dep_config.id.as_str(), "Encountered a dependency cycle (from project); will disconnect nodes to avoid recursion", ); + continue; + // Don't link the root project to any project, but still load it } else if matches!(dep_config.scope, DependencyScope::Root) { - self.internal_load(&dep_config.id, cycle).await?; + self.internal_load(&dep_config.id, cycle).await?.0 // Otherwise link projects } else { - let dep_index = self.internal_load(&dep_config.id, cycle).await?; + let dep = self.internal_load(&dep_config.id, cycle).await?; + edges.push((dep.1, dep_config.scope)); + dep.0 + }; - self.graph.add_edge(index, dep_index, dep_config.scope); + if loaded_dep_id != dep_config.id { + dep_config.id = loaded_dep_id; } } + // Add to the graph + let index = self.graph.add_node(project); + + self.nodes.insert(id.clone(), index); + + for edge in edges { + self.graph.add_edge(index, edge.0, edge.1); + } + cycle.clear(); - Ok(index) + Ok((id, index)) + + // // Create the project + // let project = self.build_project(id, source).await?; + // let dependencies = project + // .dependencies + // .values() + // .map(|v| v.to_owned()) + // .collect::>(); // How to avoid cloning??? + + // // Add to the graph + // let id = project.id.clone(); + // let index = self.graph.add_node(project); + + // cycle.insert(id.clone()); + // self.nodes.insert(id.clone(), index); + + // // Create dependent projects + // for dep_config in dependencies { + // if cycle.contains(&dep_config.id) { + // debug!( + // id = id.as_str(), + // dependency_id = dep_config.id.as_str(), + // "Encountered a dependency cycle (from project); will disconnect nodes to avoid recursion", + // ); + + // // Don't link the root project to any project, but still load it + // } else if matches!(dep_config.scope, DependencyScope::Root) { + // self.internal_load(&dep_config.id, cycle).await?; + + // // Otherwise link projects + // } else { + // let dep_index = self.internal_load(&dep_config.id, cycle).await?; + + // self.graph.add_edge(index, dep_index, dep_config.scope); + // } + // } + + // cycle.clear(); + + // Ok(index) } /// Create and build the project with the provided ID and source. @@ -303,7 +362,7 @@ impl<'app> ProjectGraphBuilder<'app> { .workspace_config .experiments .interweaved_task_inheritance, - root_project_id: self.root_project_id.as_ref(), + root_project_id: self.root_id.as_ref(), toolchain_config: context.toolchain_config, workspace_root: context.workspace_root, }, @@ -350,6 +409,8 @@ impl<'app> ProjectGraphBuilder<'app> { if let Some(alias) = project.alias.as_ref() { self.aliases.insert(alias.to_owned(), project.id.clone()); } + + self.renamed_ids.insert(id, project.id.clone()); } Ok(project) @@ -483,7 +544,7 @@ impl<'app> ProjectGraphBuilder<'app> { .await?; // Find the root project - self.root_project_id = sources.iter().find_map(|(id, source)| { + self.root_id = sources.iter().find_map(|(id, source)| { if source.as_str().is_empty() || source.as_str() == "." { Some(id.to_owned()) } else { @@ -502,9 +563,14 @@ impl<'app> ProjectGraphBuilder<'app> { } fn resolve_id(&self, project_locator: &str) -> Id { - match self.aliases.get(project_locator) { + let id = match self.aliases.get(project_locator) { Some(project_id) => project_id.to_owned(), None => Id::raw(project_locator), + }; + + match self.renamed_ids.get(&id) { + Some(new_id) => new_id.to_owned(), + None => id, } } } diff --git a/nextgen/project-graph/tests/project_graph_test.rs b/nextgen/project-graph/tests/project_graph_test.rs index 660f15f55ee..b490c0a3217 100644 --- a/nextgen/project-graph/tests/project_graph_test.rs +++ b/nextgen/project-graph/tests/project_graph_test.rs @@ -720,7 +720,7 @@ mod project_graph { .build_graph_for(context, &["some-depends-on"]) .await; - assert_eq!(map_ids(graph.ids()), ["some-depends-on", "c", "a"]); + assert_eq!(map_ids(graph.ids()), ["c", "a", "some-depends-on"]); } #[tokio::test] @@ -732,7 +732,7 @@ mod project_graph { .build_graph_for(context, &["from-task-deps"]) .await; - assert_eq!(map_ids(graph.ids()), ["from-task-deps", "b", "c"]); + assert_eq!(map_ids(graph.ids()), ["b", "c", "from-task-deps"]); let deps = &graph.get("from-task-deps").unwrap().dependencies; @@ -749,7 +749,7 @@ mod project_graph { .build_graph_for(context, &["from-root-task-deps"]) .await; - assert_eq!(map_ids(graph.ids()), ["from-root-task-deps", "root"]); + assert_eq!(map_ids(graph.ids()), ["root", "from-root-task-deps"]); let deps = &graph.get("from-root-task-deps").unwrap().dependencies; @@ -1406,10 +1406,6 @@ mod project_graph { assert_eq!(graph.get("foo").unwrap().id, "foo"); assert_eq!(graph.get("bar-renamed").unwrap().id, "bar-renamed"); assert_eq!(graph.get("baz-renamed").unwrap().id, "baz-renamed"); - - // Should not exist - assert!(graph.get("bar").is_err()); - assert!(graph.get("baz").is_err()); } #[tokio::test] @@ -1428,12 +1424,5 @@ mod project_graph { ] ); } - - #[tokio::test] - #[should_panic(expected = "No project has been configured with the name or alias bar.")] - async fn errors_when_referencing_old_id() { - let sandbox = create_sandbox("custom-id-old-ref"); - generate_project_graph_from_sandbox(sandbox.path()).await; - } } } diff --git a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__aliases__loads_aliases.snap b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__aliases__loads_aliases.snap index ad73b00a8b6..ab77d40b26a 100644 --- a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__aliases__loads_aliases.snap +++ b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__aliases__loads_aliases.snap @@ -3,27 +3,27 @@ source: nextgen/project-graph/tests/project_graph_test.rs expression: graph.to_dot() --- digraph { - 0 [ label="tasks" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="alias-one" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 [ label="alias-three" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 3 [ label="implicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 0 [ label="alias-one" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="alias-three" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 [ label="implicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 3 [ label="tasks" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 4 [ label="dupes-task-deps" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 5 [ label="alias-two" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 6 [ label="dupes-depends-on" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 7 [ label="explicit-and-implicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] 8 [ label="explicit" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 0 -> 1 [ label="build" arrowhead=none] - 0 -> 2 [ label="build" arrowhead=none] - 3 -> 1 [ label="peer" arrowhead=box, arrowtail=box] + 2 -> 0 [ label="peer" arrowhead=box, arrowtail=box] + 2 -> 1 [ label="build" arrowhead=box, arrowtail=box] + 3 -> 0 [ label="build" arrowhead=box, arrowtail=box] + 3 -> 1 [ label="build" arrowhead=box, arrowtail=box] 3 -> 2 [ label="build" arrowhead=box, arrowtail=box] - 0 -> 3 [ label="build" arrowhead=none] - 4 -> 1 [ label="build" arrowhead=box, arrowtail=box] - 4 -> 1 [ label="build" arrowhead=box, arrowtail=box] + 4 -> 0 [ label="build" arrowhead=box, arrowtail=box] + 4 -> 0 [ label="build" arrowhead=box, arrowtail=box] 6 -> 5 [ label="development" arrowhead=box, arrowtail=box] 6 -> 5 [ label="build" arrowhead=box, arrowtail=box] 7 -> 5 [ label="development" arrowhead=box, arrowtail=box] - 7 -> 2 [ label="build" arrowhead=box, arrowtail=box] + 7 -> 1 [ label="build" arrowhead=box, arrowtail=box] 8 -> 5 [ label="production" arrowhead=box, arrowtail=box] - 8 -> 1 [ label="development" arrowhead=box, arrowtail=box] + 8 -> 0 [ label="development" arrowhead=box, arrowtail=box] } diff --git a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_full.snap b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_full.snap index 1bb42e5a4ef..7e20378bb20 100644 --- a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_full.snap +++ b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_full.snap @@ -3,14 +3,14 @@ source: nextgen/project-graph/tests/project_graph_test.rs expression: graph.to_dot() --- digraph { - 0 [ label="d" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="a" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 [ label="b" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 3 [ label="c" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 2 -> 3 [ label="production" arrowhead=box, arrowtail=box] - 1 -> 2 [ label="development" arrowhead=box, arrowtail=box] - 0 -> 1 [ label="peer" arrowhead=none] - 0 -> 2 [ label="build" arrowhead=none] - 0 -> 3 [ label="production" arrowhead=none] + 0 [ label="c" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="b" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 2 [ label="a" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 3 [ label="d" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 -> 0 [ label="production" arrowhead=box, arrowtail=box] + 2 -> 1 [ label="development" arrowhead=box, arrowtail=box] + 3 -> 2 [ label="peer" arrowhead=box, arrowtail=box] + 3 -> 1 [ label="build" arrowhead=box, arrowtail=box] + 3 -> 0 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_partial.snap b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_partial.snap index 2a993159c51..85791ea7b49 100644 --- a/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_partial.snap +++ b/nextgen/project-graph/tests/snapshots/project_graph_test__project_graph__to_dot__renders_partial.snap @@ -3,8 +3,8 @@ source: nextgen/project-graph/tests/project_graph_test.rs expression: graph.to_dot() --- digraph { - 0 [ label="b" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 1 [ label="c" style=filled, shape=oval, fillcolor=gray, fontcolor=black] - 0 -> 1 [ label="production" arrowhead=none] + 0 [ label="c" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 [ label="b" style=filled, shape=oval, fillcolor=gray, fontcolor=black] + 1 -> 0 [ label="production" arrowhead=box, arrowtail=box] } diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 9fa439204a7..b2868548747 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -15,6 +15,8 @@ #### 🐞 Fixes - Fixed an issue where we would install `proto` even when not required. +- Fixed an issue where implicit dependencies were not resolving correctly when projects were + renamed. ## 1.18.0