Skip to content

Commit 14c55eb

Browse files
Fix needs resolution across stages (approval jobs)
1 parent 31242b1 commit 14c55eb

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

src/orchestrator/dag.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,17 @@ impl JobDAG {
8787
continue;
8888
}
8989

90-
// Match base job ID (scoped to same stage if prefixing active)
90+
// Match base job ID (the job_id from split config)
91+
// NOTE: This must work across stages. When stage prefixing is enabled, the
92+
// *generated* instance IDs are stage-scoped, but the job_id is still the
93+
// canonical identifier users reference in `needs` (e.g. "build/build_app_image").
94+
//
95+
// We intentionally add *all* concrete instances that share this job_id
96+
// (e.g. matrix-expanded jobs).
9197
if &candidate.job_id == needed_job_id {
92-
if should_prefix(&concrete_job.stage, wf_config)
93-
&& should_prefix(&candidate.stage, wf_config)
94-
{
95-
if concrete_job.stage == candidate.stage {
96-
new_needs.insert(candidate_id.clone());
97-
graph.update_edge(node_map[candidate_id], dependent_node, ());
98-
found_match = true;
99-
}
100-
} else {
101-
// Global match (e.g. no stage prefixing)
102-
new_needs.insert(candidate_id.clone());
103-
graph.update_edge(node_map[candidate_id], dependent_node, ());
104-
found_match = true;
105-
}
98+
new_needs.insert(candidate_id.clone());
99+
graph.update_edge(node_map[candidate_id], dependent_node, ());
100+
found_match = true;
106101
}
107102
}
108103
if !found_match {

0 commit comments

Comments
 (0)