Fix execution caching to cache artifact graph NodePath (#6978)

* Fix to add NodePaths to SketchOnFace and SketchOnPlane artifacts

* Fix to only compute the new part of the artifact graph

* Change to early-return sooner when in mock mode

* Add another test

* Fix to propagate NodePath for sketch on face

* Update output
This commit is contained in:
Jonathan Tran
2025-05-15 19:18:03 -04:00
committed by GitHub
parent 9906c9947a
commit 74939e5cd6
63 changed files with 357 additions and 274 deletions

View File

@ -1155,23 +1155,24 @@ impl ExecutorContext {
#[cfg(feature = "artifact-graph")]
{
// Move the artifact commands and responses to simplify cache management
// and error creation.
exec_state
.global
.artifact_commands
.extend(self.engine.take_artifact_commands().await);
exec_state
.global
.artifact_responses
.extend(self.engine.take_responses().await);
let new_commands = self.engine.take_artifact_commands().await;
let new_responses = self.engine.take_responses().await;
let initial_graph = exec_state.global.artifact_graph.clone();
// Build the artifact graph.
match build_artifact_graph(
&exec_state.global.artifact_commands,
&exec_state.global.artifact_responses,
let graph_result = build_artifact_graph(
&new_commands,
&new_responses,
program,
&exec_state.global.artifacts,
) {
&mut exec_state.global.artifacts,
initial_graph,
);
// Move the artifact commands and responses into ExecState to
// simplify cache management and error creation.
exec_state.global.artifact_commands.extend(new_commands);
exec_state.global.artifact_responses.extend(new_responses);
match graph_result {
Ok(artifact_graph) => {
exec_state.global.artifact_graph = artifact_graph;
exec_result.map(|(_, env_ref, _)| env_ref)