From f9283cf7772f4a7fbe010b09c649d83e8c3a28d7 Mon Sep 17 00:00:00 2001 From: Vidya Sagar Reddy Desu <35026133+vidya381@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:15:33 -0500 Subject: [PATCH 1/2] add compose yml/yaml to detect in addition to docker compose --- .gitignore | 1 + internal/detector/detector.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index deffe34..c0d476e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist/ .env .env.local /devcheck +.DS_Store \ No newline at end of file diff --git a/internal/detector/detector.go b/internal/detector/detector.go index 1d9ab72..a7ccde6 100644 --- a/internal/detector/detector.go +++ b/internal/detector/detector.go @@ -46,7 +46,9 @@ func Detect(dir string) DetectedStack { stack.Gradle = fileExists(filepath.Join(dir, "build.gradle")) stack.Java = stack.Maven || stack.Gradle stack.DockerCompose = fileExists(filepath.Join(dir, "docker-compose.yml")) || - fileExists(filepath.Join(dir, "docker-compose.yaml")) + fileExists(filepath.Join(dir, "docker-compose.yaml")) || + fileExists(filepath.Join(dir, "compose.yml")) || + fileExists(filepath.Join(dir, "compose.yaml")) stack.Docker = fileExists(filepath.Join(dir, "Dockerfile")) || stack.DockerCompose dbURL := os.Getenv("DATABASE_URL") From 89ce9901a7b0e3f81f00dddc2468dcf44f2e1875 Mon Sep 17 00:00:00 2001 From: Vidya Sagar Reddy Desu <35026133+vidya381@users.noreply.github.com> Date: Tue, 31 Mar 2026 13:16:16 -0500 Subject: [PATCH 2/2] add tests for compose yml/yaml --- internal/detector/detector_test.go | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/internal/detector/detector_test.go b/internal/detector/detector_test.go index 98b23d7..7f5ff2e 100644 --- a/internal/detector/detector_test.go +++ b/internal/detector/detector_test.go @@ -68,4 +68,57 @@ func touch(t *testing.T, path string) { if err := os.WriteFile(path, nil, 0o644); err != nil { t.Fatalf("touch %s: %v", path, err) } +} + +func TestDetect_DockerCompose_legacy_yml(t *testing.T) { + dir := t.TempDir() + touch(t, filepath.Join(dir, "docker-compose.yml")) + stack := Detect(dir) + if !stack.DockerCompose { + t.Error("expected DockerCompose=true for docker-compose.yml") + } + if !stack.Docker { + t.Error("expected Docker=true when DockerCompose is true") + } +} + +func TestDetect_DockerCompose_legacy_yaml(t *testing.T) { + dir := t.TempDir() + touch(t, filepath.Join(dir, "docker-compose.yaml")) + stack := Detect(dir) + if !stack.DockerCompose { + t.Error("expected DockerCompose=true for docker-compose.yaml") + } +} + +func TestDetect_DockerCompose_compose_yml(t *testing.T) { + dir := t.TempDir() + touch(t, filepath.Join(dir, "compose.yml")) + stack := Detect(dir) + if !stack.DockerCompose { + t.Error("expected DockerCompose=true for compose.yml") + } + if !stack.Docker { + t.Error("expected Docker=true when DockerCompose is true") + } +} + +func TestDetect_DockerCompose_compose_yaml(t *testing.T) { + dir := t.TempDir() + touch(t, filepath.Join(dir, "compose.yaml")) + stack := Detect(dir) + if !stack.DockerCompose { + t.Error("expected DockerCompose=true for compose.yaml") + } + if !stack.Docker { + t.Error("expected Docker=true when DockerCompose is true") + } +} + +func TestDetect_DockerCompose_false_when_absent(t *testing.T) { + dir := t.TempDir() + stack := Detect(dir) + if stack.DockerCompose { + t.Error("expected DockerCompose=false when no compose file present") + } } \ No newline at end of file