fix(core): handle local plugin executors when trying to hash targets (#20436)

This commit is contained in:
Jonathan Cammisuli 2023-11-27 18:22:10 -05:00 committed by GitHub
parent 21e952f37e
commit 7f404ad720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -138,9 +138,13 @@ impl HashPlanner {
.split(':')
.next()
.expect("Executors should always have a ':'");
let existing_package =
let Some(existing_package) =
find_external_dependency_node_name(executor_package, &external_nodes_keys)
.unwrap_or(executor_package);
else {
// this usually happens because the executor was a local plugin.
// todo)) @Cammisuli: we need to gather the project's inputs and its dep inputs similar to how we do it in `self_and_deps_inputs`
return Ok(None);
};
Ok(Some(vec![HashInstruction::External(
existing_package.to_string(),
)]))

View File

@ -82,8 +82,8 @@ impl TaskHasher {
hash_plans: External<HashMap<String, Vec<HashInstruction>>>,
js_env: HashMap<String, String>,
) -> anyhow::Result<NapiDashMap<String, HashDetails>> {
debug!("{:?}", hash_plans.as_ref());
trace!("hash_plans: {}", hash_plans.len());
debug!("hashing plans {:?}", hash_plans.as_ref());
trace!("plan length: {}", hash_plans.len());
trace!("all workspace files: {}", self.all_workspace_files.len());
trace!("project_file_map: {}", self.project_file_map.len());
@ -103,7 +103,7 @@ impl TaskHasher {
let hashes: NapiDashMap<String, HashDetails> = NapiDashMap::new();
let _ = hash_plans
hash_plans
.iter()
.flat_map(|(task_id, instructions)| {
instructions
@ -133,7 +133,7 @@ impl TaskHasher {
entry.details.insert(hash_detail.0, hash_detail.1);
Ok::<(), anyhow::Error>(())
});
})?;
hashes.iter_mut().for_each(|mut h| {
let hash_details = h.value_mut();