From 5db4cca1d5ff1a43baafe5cea42bc14d51c9e70e Mon Sep 17 00:00:00 2001 From: vincenthsh <111712068+vincenthsh@users.noreply.github.com> Date: Wed, 24 Apr 2024 21:14:31 +0700 Subject: [PATCH] fix: Ensure autoplan self (#288) Bug introduced in last release dropped autoplan for self --- plan/ci.go | 2 +- testdata/v2_atlantis_depends_on/atlantis.yaml | 3 +++ testdata/v2_tf_registry_module_atlantis/atlantis.yaml | 1 + .../v2_tf_registry_module_atlantis_dup_module/atlantis.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plan/ci.go b/plan/ci.go index a376f57f8..9457e161e 100644 --- a/plan/ci.go +++ b/plan/ci.go @@ -401,7 +401,7 @@ func (p *Plan) buildAtlantisConfig(c *v2.Config) AtlantisConfig { uniqueModuleSources = append(uniqueModuleSources, *m.Source) } } - whenModified := []string{} + whenModified := []string{"*.tf"} if d.AutoplanRelativeGlobs != nil { whenModified = append(whenModified, d.AutoplanRelativeGlobs...) } diff --git a/testdata/v2_atlantis_depends_on/atlantis.yaml b/testdata/v2_atlantis_depends_on/atlantis.yaml index 59a09c303..21454d835 100644 --- a/testdata/v2_atlantis_depends_on/atlantis.yaml +++ b/testdata/v2_atlantis_depends_on/atlantis.yaml @@ -9,6 +9,7 @@ projects: terraform_version: 0.100.0 autoplan: when_modified: + - '*.tf' - ../../foo.yaml - ../../../modules/my_module/**/*.tf - ../../../modules/my_module/**/*.tf.json @@ -21,6 +22,7 @@ projects: terraform_version: 0.100.0 autoplan: when_modified: + - '*.tf' - '!remote-states.tf' - ../../../../foo_modules/parent_module/**/*.tf - ../../../../foo_modules/parent_module/**/*.tf.json @@ -39,6 +41,7 @@ projects: terraform_version: 0.100.0 autoplan: when_modified: + - '*.tf' - '!remote-states.tf' - ../../../modules/my_module/**/*.tf - ../../../modules/my_module/**/*.tf.json diff --git a/testdata/v2_tf_registry_module_atlantis/atlantis.yaml b/testdata/v2_tf_registry_module_atlantis/atlantis.yaml index e722a80ae..76961aa0e 100644 --- a/testdata/v2_tf_registry_module_atlantis/atlantis.yaml +++ b/testdata/v2_tf_registry_module_atlantis/atlantis.yaml @@ -9,6 +9,7 @@ projects: terraform_version: 0.100.0 autoplan: when_modified: + - '*.tf' - '!remote-states.tf' - ../../../modules/my_module/**/*.tf - ../../../modules/my_module/**/*.tf.json diff --git a/testdata/v2_tf_registry_module_atlantis_dup_module/atlantis.yaml b/testdata/v2_tf_registry_module_atlantis_dup_module/atlantis.yaml index 1a11ffad0..51138fc55 100644 --- a/testdata/v2_tf_registry_module_atlantis_dup_module/atlantis.yaml +++ b/testdata/v2_tf_registry_module_atlantis_dup_module/atlantis.yaml @@ -9,6 +9,7 @@ projects: terraform_version: 0.100.0 autoplan: when_modified: + - '*.tf' - '!remote-states.tf' - ../../../modules/my_module/**/*.tf - ../../../modules/my_module/**/*.tf.json