From 4b05ad5e861496cbf220a137b271331e3315107a Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Mon, 11 May 2026 22:47:20 +0000 Subject: [PATCH] fix: add infra/, org/, and deployment file detection for pipeline B The detection script was missing infra/, org/, Dockerfile, docker-compose*, and Makefile patterns required by the SDLC spec. Added 11 new test cases covering these patterns. Co-Authored-By: Paperclip --- scripts/detect-pipeline.sh | 7 ++++++- scripts/test-detect-pipeline.sh | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/scripts/detect-pipeline.sh b/scripts/detect-pipeline.sh index 1b2dfc2..a77e9a2 100755 --- a/scripts/detect-pipeline.sh +++ b/scripts/detect-pipeline.sh @@ -18,13 +18,18 @@ detect_pipeline() { dir=$(dirname "$file") if [[ "$dir" == ".github" || "$dir" == .github/* ]] || \ + [[ "$dir" == "infra" || "$dir" == infra/* ]] || \ + [[ "$dir" == "org" || "$dir" == org/* ]] || \ [[ "$filename" == *.md ]] || \ [[ "$filename" == .eslintrc* ]] || \ [[ "$filename" == .prettierrc* ]] || \ [[ "$filename" == renovate.json* ]] || \ [[ "$filename" == .gitignore ]] || \ [[ "$filename" == .editorconfig ]] || \ - [[ "$filename" == LICENSE ]]; then + [[ "$filename" == LICENSE ]] || \ + [[ "$filename" == Dockerfile ]] || \ + [[ "$filename" == docker-compose* ]] || \ + [[ "$filename" == Makefile ]]; then continue else all_infra=false diff --git a/scripts/test-detect-pipeline.sh b/scripts/test-detect-pipeline.sh index d467645..7245345 100755 --- a/scripts/test-detect-pipeline.sh +++ b/scripts/test-detect-pipeline.sh @@ -70,6 +70,36 @@ assert_eq "workflow + markdown combo" "pipeline-b" \ "$(run_detect ".github/workflows/detect-pr-pipeline.yaml .github/workflows/README.md")" +assert_eq "infra root file" "pipeline-b" \ + "$(run_detect "infra/helmrelease.yaml")" + +assert_eq "infra nested file" "pipeline-b" \ + "$(run_detect "infra/clusters/prod/kustomization.yaml")" + +assert_eq "org root file" "pipeline-b" \ + "$(run_detect "org/CODEOWNERS")" + +assert_eq "org nested file" "pipeline-b" \ + "$(run_detect "org/policies/branch-protection.json")" + +assert_eq "Dockerfile" "pipeline-b" \ + "$(run_detect "Dockerfile")" + +assert_eq "docker-compose.yaml" "pipeline-b" \ + "$(run_detect "docker-compose.yaml")" + +assert_eq "docker-compose.override.yml" "pipeline-b" \ + "$(run_detect "docker-compose.override.yml")" + +assert_eq "Makefile" "pipeline-b" \ + "$(run_detect "Makefile")" + +assert_eq "mixed infra + org + workflow" "pipeline-b" \ + "$(run_detect ".github/workflows/ci.yaml +infra/helmrelease.yaml +org/CODEOWNERS +README.md")" + # --- Pipeline A cases (has non-infra files) --- assert_eq "plugin source file" "pipeline-a" \ @@ -89,6 +119,11 @@ README.md")" assert_eq "single non-infra file" "pipeline-a" \ "$(run_detect "server.js")" +assert_eq "plugin code + infra files" "pipeline-a" \ + "$(run_detect "infra/helmrelease.yaml +org/CODEOWNERS +headlamp-polaris-plugin/src/index.tsx")" + # --- Edge cases --- assert_eq "empty input" "pipeline-b" \