From 5bd947f669b387023e6b593c72b8bca3f3c16800 Mon Sep 17 00:00:00 2001 From: aknysh Date: Sat, 24 Sep 2022 00:53:32 -0400 Subject: [PATCH 1/3] Fix `atlantis` projects generation --- atmos.yaml | 4 ++-- examples/complete/Dockerfile | 4 ++-- examples/complete/atmos.yaml | 4 ++-- .../complete/rootfs/usr/local/etc/atmos/atmos.yaml | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/exec/atlantis_generate_repo_config.go | 6 +++--- pkg/atlantis/README.md | 12 ++++++------ pkg/atlantis/atmos.yaml | 4 ++-- pkg/config/schema.go | 6 +++--- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/atmos.yaml b/atmos.yaml index 73785f4fc..3bf579c73 100644 --- a/atmos.yaml +++ b/atmos.yaml @@ -172,8 +172,8 @@ integrations: when_modified: - "**/*.tf" - "varfiles/$PROJECT_NAME.tfvars.json" - apply_requirements: - - "approved" + apply_requirements: + - "approved" # Workflow templates # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands diff --git a/examples/complete/Dockerfile b/examples/complete/Dockerfile index 2b8958b4b..5a8f0796b 100644 --- a/examples/complete/Dockerfile +++ b/examples/complete/Dockerfile @@ -1,8 +1,8 @@ # Geodesic: https://github.com/cloudposse/geodesic/ -ARG GEODESIC_VERSION=1.3.0 +ARG GEODESIC_VERSION=1.3.1 ARG GEODESIC_OS=debian # atmos: https://github.com/cloudposse/atmos -ARG ATMOS_VERSION=1.8.0 +ARG ATMOS_VERSION=1.8.2 # Terraform: https://github.com/hashicorp/terraform/releases ARG TF_VERSION=1.2.9 diff --git a/examples/complete/atmos.yaml b/examples/complete/atmos.yaml index f3ff82101..9db5a1857 100644 --- a/examples/complete/atmos.yaml +++ b/examples/complete/atmos.yaml @@ -172,8 +172,8 @@ integrations: when_modified: - "**/*.tf" - "varfiles/$PROJECT_NAME.tfvars.json" - apply_requirements: - - "approved" + apply_requirements: + - "approved" # Workflow templates # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands diff --git a/examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml b/examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml index 54d78d90f..753c1504d 100644 --- a/examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml +++ b/examples/complete/rootfs/usr/local/etc/atmos/atmos.yaml @@ -172,8 +172,8 @@ integrations: when_modified: - "**/*.tf" - "varfiles/$PROJECT_NAME.tfvars.json" - apply_requirements: - - "approved" + apply_requirements: + - "approved" # Workflow templates # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands diff --git a/go.mod b/go.mod index c41673216..8d60744d0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/fatih/color v1.13.0 github.com/hashicorp/go-getter v1.6.2 github.com/hashicorp/hcl v1.0.0 - github.com/hashicorp/hcl/v2 v2.14.0 + github.com/hashicorp/hcl/v2 v2.14.1 github.com/imdario/mergo v0.3.13 github.com/json-iterator/go v1.1.12 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index 5ad4ac409..d8b316d13 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl/v2 v2.14.0 h1:jX6+Q38Ly9zaAJlAjnFVyeNSNCKKW8D0wvyg7vij5Wc= -github.com/hashicorp/hcl/v2 v2.14.0/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= +github.com/hashicorp/hcl/v2 v2.14.1 h1:x0BpjfZ+CYdbiz+8yZTQ+gdLO7IXvOut7Da+XJayx34= +github.com/hashicorp/hcl/v2 v2.14.1/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= diff --git a/internal/exec/atlantis_generate_repo_config.go b/internal/exec/atlantis_generate_repo_config.go index 06faa643a..06d684b4b 100644 --- a/internal/exec/atlantis_generate_repo_config.go +++ b/internal/exec/atlantis_generate_repo_config.go @@ -195,9 +195,8 @@ func ExecuteAtlantisGenerateRepoConfig( } atlantisProjectAutoplanConfig := c.AtlantisProjectAutoplanConfig{ - Enabled: projectTemplate.Autoplan.Enabled, - ApplyRequirements: projectTemplate.Autoplan.ApplyRequirements, - WhenModified: whenModified, + Enabled: projectTemplate.Autoplan.Enabled, + WhenModified: whenModified, } atlantisProjectName := c.ReplaceContextTokens(context, projectTemplate.Name) @@ -210,6 +209,7 @@ func ExecuteAtlantisGenerateRepoConfig( TerraformVersion: projectTemplate.TerraformVersion, DeleteSourceBranchOnMerge: projectTemplate.DeleteSourceBranchOnMerge, Autoplan: atlantisProjectAutoplanConfig, + ApplyRequirements: projectTemplate.ApplyRequirements, } atlantisProjects = append(atlantisProjects, atlantisProject) diff --git a/pkg/atlantis/README.md b/pkg/atlantis/README.md index 9c4e7502a..841733b72 100644 --- a/pkg/atlantis/README.md +++ b/pkg/atlantis/README.md @@ -86,8 +86,8 @@ integrations: when_modified: - "**/*.tf" - "varfiles/$PROJECT_NAME.tfvars.json" - apply_requirements: - - "approved" + apply_requirements: + - "approved" # Workflow templates # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands @@ -131,8 +131,8 @@ projects: when_modified: - '**/*.tf' - varfiles/tenant1-ue2-staging-test-test-component-override-3.tfvars.json - apply_requirements: - - approved + apply_requirements: + - approved - name: tenant1-ue2-staging-infra-vpc workspace: tenant1-ue2-staging workflow: workflow-1 @@ -144,8 +144,8 @@ projects: when_modified: - '**/*.tf' - varfiles/tenant1-ue2-staging-infra-vpc.tfvars.json - apply_requirements: - - approved + apply_requirements: + - approved workflows: workflow-1: apply: diff --git a/pkg/atlantis/atmos.yaml b/pkg/atlantis/atmos.yaml index 774fd8e54..571fe8b44 100644 --- a/pkg/atlantis/atmos.yaml +++ b/pkg/atlantis/atmos.yaml @@ -106,8 +106,8 @@ integrations: when_modified: - "**/*.tf" - "varfiles/$PROJECT_NAME.tfvars.json" - apply_requirements: - - "approved" + apply_requirements: + - "approved" # Workflow templates # https://www.runatlantis.io/docs/custom-workflows.html#custom-init-plan-apply-commands diff --git a/pkg/config/schema.go b/pkg/config/schema.go index fa67b39a5..6a0409b45 100644 --- a/pkg/config/schema.go +++ b/pkg/config/schema.go @@ -265,12 +265,12 @@ type AtlantisProjectConfig struct { TerraformVersion string `yaml:"terraform_version" json:"terraform_version" mapstructure:"terraform_version"` DeleteSourceBranchOnMerge bool `yaml:"delete_source_branch_on_merge" json:"delete_source_branch_on_merge" mapstructure:"delete_source_branch_on_merge"` Autoplan AtlantisProjectAutoplanConfig `yaml:"autoplan" json:"autoplan" mapstructure:"autoplan"` + ApplyRequirements []string `yaml:"apply_requirements" json:"apply_requirements" mapstructure:"apply_requirements"` } type AtlantisProjectAutoplanConfig struct { - Enabled bool `yaml:"enabled" json:"enabled" mapstructure:"enabled"` - WhenModified []string `yaml:"when_modified" json:"when_modified" mapstructure:"when_modified"` - ApplyRequirements []string `yaml:"apply_requirements" json:"apply_requirements" mapstructure:"apply_requirements"` + Enabled bool `yaml:"enabled" json:"enabled" mapstructure:"enabled"` + WhenModified []string `yaml:"when_modified" json:"when_modified" mapstructure:"when_modified"` } type AtlantisConfigOutput struct { From 1f76fdff88f70fc99ceeed989c4bd6f161dc0029 Mon Sep 17 00:00:00 2001 From: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> Date: Sat, 24 Sep 2022 04:56:09 +0000 Subject: [PATCH 2/3] Auto Format --- .github/workflows/validate-codeowners.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-codeowners.yml b/.github/workflows/validate-codeowners.yml index 70f829e3a..4b4a2264a 100644 --- a/.github/workflows/validate-codeowners.yml +++ b/.github/workflows/validate-codeowners.yml @@ -10,6 +10,7 @@ jobs: steps: - name: "Checkout source code at current commit" uses: actions/checkout@v2 + # Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved - uses: mszostok/codeowners-validator@v0.7.1 if: github.event.pull_request.head.repo.full_name == github.repository name: "Full check of CODEOWNERS" From 7ab9272a9f807b41f36b0afb8aa747e11c8cd56f Mon Sep 17 00:00:00 2001 From: aknysh Date: Sat, 24 Sep 2022 00:59:38 -0400 Subject: [PATCH 3/3] Fix `atlantis` projects generation --- .github/workflows/validate-codeowners.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-codeowners.yml b/.github/workflows/validate-codeowners.yml index 70f829e3a..4b4a2264a 100644 --- a/.github/workflows/validate-codeowners.yml +++ b/.github/workflows/validate-codeowners.yml @@ -10,6 +10,7 @@ jobs: steps: - name: "Checkout source code at current commit" uses: actions/checkout@v2 + # Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved - uses: mszostok/codeowners-validator@v0.7.1 if: github.event.pull_request.head.repo.full_name == github.repository name: "Full check of CODEOWNERS"