diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..efb00b2 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,38 @@ +# Woodpecker CI Pipeline for CIGen + +when: + - event: [push, pull_request] + branch: main + +steps: + install-deps: + image: rust:1.85 + commands: + - apt-get update + - apt-get install -y nodejs npm protobuf-compiler + + fmt: + image: rust:1.85 + commands: + - apt-get update + - apt-get install -y protobuf-compiler + - rustup component add rustfmt + - cargo fmt -- --check + depends_on: [install-deps] + + clippy: + image: rust:1.85 + commands: + - apt-get update + - apt-get install -y protobuf-compiler + - rustup component add clippy + - cargo clippy --all-targets --all-features -- -D warnings + depends_on: [install-deps] + + test: + image: rust:1.85 + commands: + - apt-get update + - apt-get install -y protobuf-compiler + - cargo test + depends_on: [install-deps] diff --git a/src/orchestrator/dag.rs b/src/orchestrator/dag.rs index 3ef065f..6873ae9 100644 --- a/src/orchestrator/dag.rs +++ b/src/orchestrator/dag.rs @@ -87,22 +87,17 @@ impl JobDAG { continue; } - // Match base job ID (scoped to same stage if prefixing active) + // Match base job ID (the job_id from split config) + // NOTE: This must work across stages. When stage prefixing is enabled, the + // *generated* instance IDs are stage-scoped, but the job_id is still the + // canonical identifier users reference in `needs` (e.g. "build/build_app_image"). + // + // We intentionally add *all* concrete instances that share this job_id + // (e.g. matrix-expanded jobs). if &candidate.job_id == needed_job_id { - if should_prefix(&concrete_job.stage, wf_config) - && should_prefix(&candidate.stage, wf_config) - { - if concrete_job.stage == candidate.stage { - new_needs.insert(candidate_id.clone()); - graph.update_edge(node_map[candidate_id], dependent_node, ()); - found_match = true; - } - } else { - // Global match (e.g. no stage prefixing) - new_needs.insert(candidate_id.clone()); - graph.update_edge(node_map[candidate_id], dependent_node, ()); - found_match = true; - } + new_needs.insert(candidate_id.clone()); + graph.update_edge(node_map[candidate_id], dependent_node, ()); + found_match = true; } } if !found_match {