diff --git a/server/core/config/raw/repo_cfg.go b/server/core/config/raw/repo_cfg.go index f613f320ab..7d5592a5b9 100644 --- a/server/core/config/raw/repo_cfg.go +++ b/server/core/config/raw/repo_cfg.go @@ -10,25 +10,25 @@ import ( // DefaultEmojiReaction is the default emoji reaction for repos const DefaultEmojiReaction = "" -// DefaultAbortOnExcecutionOrderFail being false is the default setting for abort on execution group failures -const DefaultAbortOnExcecutionOrderFail = false +// DefaultAbortOnExecutionOrderFail being false is the default setting for abort on execution group failures +const DefaultAbortOnExecutionOrderFail = false // RepoCfg is the raw schema for repo-level atlantis.yaml config. type RepoCfg struct { - Version *int `yaml:"version,omitempty"` - Projects []Project `yaml:"projects,omitempty"` - Workflows map[string]Workflow `yaml:"workflows,omitempty"` - PolicySets PolicySets `yaml:"policies,omitempty"` - AutoDiscover *AutoDiscover `yaml:"autodiscover,omitempty"` - Automerge *bool `yaml:"automerge,omitempty"` - ParallelApply *bool `yaml:"parallel_apply,omitempty"` - ParallelPlan *bool `yaml:"parallel_plan,omitempty"` - DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"` - EmojiReaction *string `yaml:"emoji_reaction,omitempty"` - AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"` - AbortOnExcecutionOrderFail *bool `yaml:"abort_on_execution_order_fail,omitempty"` - RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"` - SilencePRComments []string `yaml:"silence_pr_comments,omitempty"` + Version *int `yaml:"version,omitempty"` + Projects []Project `yaml:"projects,omitempty"` + Workflows map[string]Workflow `yaml:"workflows,omitempty"` + PolicySets PolicySets `yaml:"policies,omitempty"` + AutoDiscover *AutoDiscover `yaml:"autodiscover,omitempty"` + Automerge *bool `yaml:"automerge,omitempty"` + ParallelApply *bool `yaml:"parallel_apply,omitempty"` + ParallelPlan *bool `yaml:"parallel_plan,omitempty"` + DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"` + EmojiReaction *string `yaml:"emoji_reaction,omitempty"` + AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"` + AbortOnExecutionOrderFail *bool `yaml:"abort_on_execution_order_fail,omitempty"` + RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"` + SilencePRComments []string `yaml:"silence_pr_comments,omitempty"` } func (r RepoCfg) Validate() error { @@ -69,9 +69,9 @@ func (r RepoCfg) ToValid() valid.RepoCfg { emojiReaction = *r.EmojiReaction } - abortOnExcecutionOrderFail := DefaultAbortOnExcecutionOrderFail - if r.AbortOnExcecutionOrderFail != nil { - abortOnExcecutionOrderFail = *r.AbortOnExcecutionOrderFail + abortOnExecutionOrderFail := DefaultAbortOnExecutionOrderFail + if r.AbortOnExecutionOrderFail != nil { + abortOnExecutionOrderFail = *r.AbortOnExecutionOrderFail } var autoDiscover *valid.AutoDiscover @@ -84,19 +84,19 @@ func (r RepoCfg) ToValid() valid.RepoCfg { repoLocks = r.RepoLocks.ToValid() } return valid.RepoCfg{ - Version: *r.Version, - Projects: validProjects, - Workflows: validWorkflows, - AutoDiscover: autoDiscover, - Automerge: automerge, - ParallelApply: parallelApply, - ParallelPlan: parallelPlan, - ParallelPolicyCheck: parallelPlan, - DeleteSourceBranchOnMerge: r.DeleteSourceBranchOnMerge, - AllowedRegexpPrefixes: r.AllowedRegexpPrefixes, - EmojiReaction: emojiReaction, - AbortOnExcecutionOrderFail: abortOnExcecutionOrderFail, - RepoLocks: repoLocks, - SilencePRComments: r.SilencePRComments, + Version: *r.Version, + Projects: validProjects, + Workflows: validWorkflows, + AutoDiscover: autoDiscover, + Automerge: automerge, + ParallelApply: parallelApply, + ParallelPlan: parallelPlan, + ParallelPolicyCheck: parallelPlan, + DeleteSourceBranchOnMerge: r.DeleteSourceBranchOnMerge, + AllowedRegexpPrefixes: r.AllowedRegexpPrefixes, + EmojiReaction: emojiReaction, + AbortOnExecutionOrderFail: abortOnExecutionOrderFail, + RepoLocks: repoLocks, + SilencePRComments: r.SilencePRComments, } } diff --git a/server/core/config/raw/repo_cfg_test.go b/server/core/config/raw/repo_cfg_test.go index b3844ee68c..245f2d56d2 100644 --- a/server/core/config/raw/repo_cfg_test.go +++ b/server/core/config/raw/repo_cfg_test.go @@ -281,43 +281,43 @@ func TestConfig_ToValid(t *testing.T) { Version: Int(2), }, exp: valid.RepoCfg{ - Version: 2, - Automerge: nil, - ParallelApply: nil, - AbortOnExcecutionOrderFail: false, - Workflows: map[string]valid.Workflow{}, + Version: 2, + Automerge: nil, + ParallelApply: nil, + AbortOnExecutionOrderFail: false, + Workflows: map[string]valid.Workflow{}, }, }, { description: "automerge, parallel_apply, abort_on_execution_order_fail true", input: raw.RepoCfg{ - Version: Int(2), - Automerge: Bool(true), - ParallelApply: Bool(true), - AbortOnExcecutionOrderFail: Bool(true), + Version: Int(2), + Automerge: Bool(true), + ParallelApply: Bool(true), + AbortOnExecutionOrderFail: Bool(true), }, exp: valid.RepoCfg{ - Version: 2, - Automerge: Bool(true), - ParallelApply: Bool(true), - AbortOnExcecutionOrderFail: true, - Workflows: map[string]valid.Workflow{}, + Version: 2, + Automerge: Bool(true), + ParallelApply: Bool(true), + AbortOnExecutionOrderFail: true, + Workflows: map[string]valid.Workflow{}, }, }, { description: "automerge, parallel_apply, abort_on_execution_order_fail false", input: raw.RepoCfg{ - Version: Int(2), - Automerge: Bool(false), - ParallelApply: Bool(false), - AbortOnExcecutionOrderFail: Bool(false), + Version: Int(2), + Automerge: Bool(false), + ParallelApply: Bool(false), + AbortOnExecutionOrderFail: Bool(false), }, exp: valid.RepoCfg{ - Version: 2, - Automerge: Bool(false), - ParallelApply: Bool(false), - AbortOnExcecutionOrderFail: false, - Workflows: map[string]valid.Workflow{}, + Version: 2, + Automerge: Bool(false), + ParallelApply: Bool(false), + AbortOnExecutionOrderFail: false, + Workflows: map[string]valid.Workflow{}, }, }, { diff --git a/server/core/config/valid/global_cfg.go b/server/core/config/valid/global_cfg.go index 5cf6f2795e..b0bdc86822 100644 --- a/server/core/config/valid/global_cfg.go +++ b/server/core/config/valid/global_cfg.go @@ -37,7 +37,7 @@ const DefaultAtlantisFile = "atlantis.yaml" // NonOverridableApplyReqs will get applied across all "repos" in the server side config. // If repo config is allowed overrides, they can override this. // TODO: Make this more customizable, not everyone wants this rigid workflow -// maybe something along the lines of defining overridable/non-overrideable apply +// maybe something along the lines of defining overridable/non-overridable apply // requirements in the config and removing the flag to enable policy checking. var NonOverridableApplyReqs = []string{PoliciesPassedCommandReq} diff --git a/server/core/config/valid/global_cfg_test.go b/server/core/config/valid/global_cfg_test.go index f247723a3e..05fbc462f0 100644 --- a/server/core/config/valid/global_cfg_test.go +++ b/server/core/config/valid/global_cfg_test.go @@ -774,7 +774,7 @@ repos: CustomPolicyCheck: false, }, }, - "repo-side apply reqs should include non-overrideable 'policies_passed' req when overridden and policies enabled": { + "repo-side apply reqs should include non-overridable 'policies_passed' req when overridden and policies enabled": { gCfg: ` repos: - id: /.*/ @@ -806,7 +806,7 @@ repos: PolicyCheck: true, }, }, - "repo-side apply reqs should not include non-overrideable 'policies_passed' req when overridden and policies disabled": { + "repo-side apply reqs should not include non-overridable 'policies_passed' req when overridden and policies disabled": { gCfg: ` repos: - id: /.*/ diff --git a/server/core/config/valid/repo_cfg.go b/server/core/config/valid/repo_cfg.go index e42e60158b..4612f72cec 100644 --- a/server/core/config/valid/repo_cfg.go +++ b/server/core/config/valid/repo_cfg.go @@ -14,22 +14,22 @@ import ( // RepoCfg is the atlantis.yaml config after it's been parsed and validated. type RepoCfg struct { // Version is the version of the atlantis YAML file. - Version int - Projects []Project - Workflows map[string]Workflow - PolicySets PolicySets - Automerge *bool - AutoDiscover *AutoDiscover - ParallelApply *bool - ParallelPlan *bool - ParallelPolicyCheck *bool - DeleteSourceBranchOnMerge *bool - RepoLocks *RepoLocks - CustomPolicyCheck *bool - EmojiReaction string - AllowedRegexpPrefixes []string - AbortOnExcecutionOrderFail bool - SilencePRComments []string + Version int + Projects []Project + Workflows map[string]Workflow + PolicySets PolicySets + Automerge *bool + AutoDiscover *AutoDiscover + ParallelApply *bool + ParallelPlan *bool + ParallelPolicyCheck *bool + DeleteSourceBranchOnMerge *bool + RepoLocks *RepoLocks + CustomPolicyCheck *bool + EmojiReaction string + AllowedRegexpPrefixes []string + AbortOnExecutionOrderFail bool + SilencePRComments []string } func (r RepoCfg) FindProjectsByDirWorkspace(repoRelDir string, workspace string) []Project { diff --git a/server/events/apply_command_runner_test.go b/server/events/apply_command_runner_test.go index 7dcc0a574d..6f713710f6 100644 --- a/server/events/apply_command_runner_test.go +++ b/server/events/apply_command_runner_test.go @@ -234,16 +234,16 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { Description: "When first apply fails, the second don't run", ProjectContexts: []command.ProjectContext{ { - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Second", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Second", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -268,16 +268,16 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { Description: "When first apply fails, the second not will run", ProjectContexts: []command.ProjectContext{ { - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Second", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Second", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -300,25 +300,25 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { Description: "When both in a group of two succeeds, the following two will run", ProjectContexts: []command.ProjectContext{ { - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 0, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Third", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Third", + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Fourth", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Fourth", + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -353,25 +353,25 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { Description: "When one out of two fails, the following two will not run", ProjectContexts: []command.ProjectContext{ { - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelApplyEnabled: true, - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelApplyEnabled: true, + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 0, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Third", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Third", + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - AbortOnExcecutionOrderFail: true, - ProjectName: "Fourth", + ExecutionOrderGroup: 1, + AbortOnExecutionOrderFail: true, + ProjectName: "Fourth", }, }, ProjectResults: []command.ProjectResult{ @@ -408,14 +408,14 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { Description: "Don't block when parallel is not set", ProjectContexts: []command.ProjectContext{ { - ExecutionOrderGroup: 0, - ProjectName: "First", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + AbortOnExecutionOrderFail: true, }, { - ExecutionOrderGroup: 1, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + ExecutionOrderGroup: 1, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -437,7 +437,7 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) { "2. dir: `` workspace: ``\n```diff\nGreat success!\n```\n\n---\n### Apply Summary\n\n2 projects, 1 successful, 0 failed, 1 errored", }, { - Description: "Don't block when abortOnExcecutionOrderFail is not set", + Description: "Don't block when abortOnExecutionOrderFail is not set", ProjectContexts: []command.ProjectContext{ { ExecutionOrderGroup: 0, diff --git a/server/events/command/project_context.go b/server/events/command/project_context.go index 5490b4a41e..8fff2831d6 100644 --- a/server/events/command/project_context.go +++ b/server/events/command/project_context.go @@ -122,7 +122,7 @@ type ProjectContext struct { // The index of order group. Before planning/applying it will use to sort projects. Default is 0. ExecutionOrderGroup int // If plans/applies should be aborted if any prior plan/apply fails - AbortOnExcecutionOrderFail bool + AbortOnExecutionOrderFail bool // Allows custom policy check tools outside of Conftest to run in checks CustomPolicyCheck bool SilencePRComments []string diff --git a/server/events/plan_command_runner_test.go b/server/events/plan_command_runner_test.go index 79e08ab2df..c0085dc963 100644 --- a/server/events/plan_command_runner_test.go +++ b/server/events/plan_command_runner_test.go @@ -170,20 +170,20 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "When first plan fails, the second don't run", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - Workspace: "first", - ProjectName: "First", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + Workspace: "first", + ProjectName: "First", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - Workspace: "second", - ProjectName: "Second", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + Workspace: "second", + ProjectName: "Second", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -207,18 +207,18 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "When first fails, the second will not run", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - ProjectName: "Second", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + ProjectName: "Second", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -240,20 +240,20 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "When first fails by autorun, the second will not run", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - AutoplanEnabled: true, - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + AutoplanEnabled: true, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - AutoplanEnabled: true, - ExecutionOrderGroup: 1, - ProjectName: "Second", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + AutoplanEnabled: true, + ExecutionOrderGroup: 1, + ProjectName: "Second", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -275,29 +275,29 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "When both in a group of two succeeds, the following two will run", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - ProjectName: "Third", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + ProjectName: "Third", + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - ProjectName: "Fourth", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + ProjectName: "Fourth", + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -335,29 +335,29 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "When one out of two fails, the following two will not run", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "First", - ParallelPlanEnabled: true, - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "First", + ParallelPlanEnabled: true, + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - ProjectName: "Third", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + ProjectName: "Third", + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - AbortOnExcecutionOrderFail: true, - ProjectName: "Fourth", + CommandName: command.Plan, + ExecutionOrderGroup: 1, + AbortOnExecutionOrderFail: true, + ProjectName: "Fourth", }, }, ProjectResults: []command.ProjectResult{ @@ -395,16 +395,16 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { Description: "Don't block when parallel is not set", ProjectContexts: []command.ProjectContext{ { - CommandName: command.Plan, - ExecutionOrderGroup: 0, - ProjectName: "First", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 0, + ProjectName: "First", + AbortOnExecutionOrderFail: true, }, { - CommandName: command.Plan, - ExecutionOrderGroup: 1, - ProjectName: "Second", - AbortOnExcecutionOrderFail: true, + CommandName: command.Plan, + ExecutionOrderGroup: 1, + ProjectName: "Second", + AbortOnExecutionOrderFail: true, }, }, ProjectResults: []command.ProjectResult{ @@ -425,7 +425,7 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { }, }, { - Description: "Don't block when abortOnExcecutionOrderFail is not set", + Description: "Don't block when abortOnExecutionOrderFail is not set", ProjectContexts: []command.ProjectContext{ { CommandName: command.Plan, diff --git a/server/events/project_command_builder.go b/server/events/project_command_builder.go index 0ffec157f8..c52dee6360 100644 --- a/server/events/project_command_builder.go +++ b/server/events/project_command_builder.go @@ -32,8 +32,8 @@ const ( DefaultWorkspace = "default" // DefaultDeleteSourceBranchOnMerge being false is the default setting whether or not to remove a source branch on merge DefaultDeleteSourceBranchOnMerge = false - // DefaultAbortOnExcecutionOrderFail being false is the default setting for abort on execution group failures - DefaultAbortOnExcecutionOrderFail = false + // DefaultAbortOnExecutionOrderFail being false is the default setting for abort on execution group failures + DefaultAbortOnExecutionOrderFail = false ) func NewInstrumentedProjectCommandBuilder( @@ -440,7 +440,7 @@ func (p *DefaultProjectCommandBuilder) buildAllCommandsByCfg(ctx *command.Contex automerge := p.EnableAutoMerge parallelApply := p.EnableParallelApply parallelPlan := p.EnableParallelPlan - abortOnExcecutionOrderFail := DefaultAbortOnExcecutionOrderFail + abortOnExecutionOrderFail := DefaultAbortOnExecutionOrderFail if hasRepoCfg { if repoCfg.Automerge != nil { automerge = *repoCfg.Automerge @@ -451,7 +451,7 @@ func (p *DefaultProjectCommandBuilder) buildAllCommandsByCfg(ctx *command.Contex if repoCfg.ParallelPlan != nil { parallelPlan = *repoCfg.ParallelPlan } - abortOnExcecutionOrderFail = repoCfg.AbortOnExcecutionOrderFail + abortOnExecutionOrderFail = repoCfg.AbortOnExecutionOrderFail } if len(repoCfg.Projects) > 0 { @@ -477,7 +477,7 @@ func (p *DefaultProjectCommandBuilder) buildAllCommandsByCfg(ctx *command.Contex parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, p.TerraformExecutor, )...) } @@ -539,7 +539,7 @@ func (p *DefaultProjectCommandBuilder) buildAllCommandsByCfg(ctx *command.Contex parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, p.TerraformExecutor, )...) } @@ -860,7 +860,7 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx(ctx *command.Conte automerge := p.EnableAutoMerge parallelApply := p.EnableParallelApply parallelPlan := p.EnableParallelPlan - abortOnExcecutionOrderFail := DefaultAbortOnExcecutionOrderFail + abortOnExecutionOrderFail := DefaultAbortOnExecutionOrderFail if repoCfgPtr != nil { if repoCfgPtr.Automerge != nil { automerge = *repoCfgPtr.Automerge @@ -871,7 +871,7 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx(ctx *command.Conte if repoCfgPtr.ParallelPlan != nil { parallelPlan = *repoCfgPtr.ParallelPlan } - abortOnExcecutionOrderFail = repoCfgPtr.AbortOnExcecutionOrderFail + abortOnExecutionOrderFail = repoCfgPtr.AbortOnExecutionOrderFail } if len(matchingProjects) > 0 { @@ -896,7 +896,7 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx(ctx *command.Conte parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, p.TerraformExecutor, )...) } @@ -920,7 +920,7 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx(ctx *command.Conte parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, p.TerraformExecutor, )...) } diff --git a/server/events/project_command_context_builder.go b/server/events/project_command_context_builder.go index 19c1c8ff34..509fa728b8 100644 --- a/server/events/project_command_context_builder.go +++ b/server/events/project_command_context_builder.go @@ -38,7 +38,7 @@ type ProjectCommandContextBuilder interface { prjCfg valid.MergedProjectCfg, commentFlags []string, repoDir string, - automerge, parallelApply, parallelPlan, verbose, abortOnExcecutionOrderFail bool, terraformClient terraform.Client, + automerge, parallelApply, parallelPlan, verbose, abortOnExecutionOrderFail bool, terraformClient terraform.Client, ) []command.ProjectContext } @@ -58,13 +58,13 @@ func (cb *CommandScopedStatsProjectCommandContextBuilder) BuildProjectContext( prjCfg valid.MergedProjectCfg, commentFlags []string, repoDir string, - automerge, parallelApply, parallelPlan, verbose, abortOnExcecutionOrderFail bool, + automerge, parallelApply, parallelPlan, verbose, abortOnExecutionOrderFail bool, terraformClient terraform.Client, ) (projectCmds []command.ProjectContext) { cb.ProjectCounter.Inc(1) cmds := cb.ProjectCommandContextBuilder.BuildProjectContext( - ctx, cmdName, subCmdName, prjCfg, commentFlags, repoDir, automerge, parallelApply, parallelPlan, verbose, abortOnExcecutionOrderFail, terraformClient, + ctx, cmdName, subCmdName, prjCfg, commentFlags, repoDir, automerge, parallelApply, parallelPlan, verbose, abortOnExecutionOrderFail, terraformClient, ) projectCmds = []command.ProjectContext{} @@ -92,7 +92,7 @@ func (cb *DefaultProjectCommandContextBuilder) BuildProjectContext( prjCfg valid.MergedProjectCfg, commentFlags []string, repoDir string, - automerge, parallelApply, parallelPlan, verbose, abortOnExcecutionOrderFail bool, + automerge, parallelApply, parallelPlan, verbose, abortOnExecutionOrderFail bool, terraformClient terraform.Client, ) (projectCmds []command.ProjectContext) { ctx.Log.Debug("Building project command context for %s", cmdName) @@ -141,7 +141,7 @@ func (cb *DefaultProjectCommandContextBuilder) BuildProjectContext( parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, ctx.Scope, ctx.PullRequestStatus, ctx.PullStatus, @@ -165,7 +165,7 @@ func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext( prjCfg valid.MergedProjectCfg, commentFlags []string, repoDir string, - automerge, parallelApply, parallelPlan, verbose, abortOnExcecutionOrderFail bool, + automerge, parallelApply, parallelPlan, verbose, abortOnExecutionOrderFail bool, terraformClient terraform.Client, ) (projectCmds []command.ProjectContext) { if prjCfg.PolicyCheck { @@ -192,7 +192,7 @@ func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext( parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, terraformClient, ) @@ -214,7 +214,7 @@ func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext( parallelApply, parallelPlan, verbose, - abortOnExcecutionOrderFail, + abortOnExecutionOrderFail, ctx.Scope, ctx.PullRequestStatus, ctx.PullStatus, @@ -240,7 +240,7 @@ func newProjectCommandContext(ctx *command.Context, parallelApplyEnabled bool, parallelPlanEnabled bool, verbose bool, - abortOnExcecutionOrderFail bool, + abortOnExecutionOrderFail bool, scope tally.Scope, pullReqStatus models.PullReqStatus, pullStatus *models.PullStatus, @@ -308,7 +308,7 @@ func newProjectCommandContext(ctx *command.Context, PullStatus: pullStatus, JobID: uuid.New().String(), ExecutionOrderGroup: projCfg.ExecutionOrderGroup, - AbortOnExcecutionOrderFail: abortOnExcecutionOrderFail, + AbortOnExecutionOrderFail: abortOnExecutionOrderFail, SilencePRComments: projCfg.SilencePRComments, TeamAllowlistChecker: teamAllowlistChecker, } diff --git a/server/events/project_command_context_builder_test.go b/server/events/project_command_context_builder_test.go index 84ce0ff630..ff40645e0a 100644 --- a/server/events/project_command_context_builder_test.go +++ b/server/events/project_command_context_builder_test.go @@ -106,7 +106,7 @@ func TestProjectCommandContextBuilder_PullStatus(t *testing.T) { assert.False(t, result[0].ParallelPlanEnabled) }) - t.Run("when AbortOnExcecutionOrderFail is set to true", func(t *testing.T) { + t.Run("when AbortOnExecutionOrderFail is set to true", func(t *testing.T) { projCfg.Name = "Apply Comment" When(mockCommentBuilder.BuildPlanComment(projRepoRelDir, projWorkspace, "", []string{})).ThenReturn(expectedPlanCmt) When(mockCommentBuilder.BuildApplyComment(projRepoRelDir, projWorkspace, "", false, "")).ThenReturn(expectedApplyCmt) @@ -123,6 +123,6 @@ func TestProjectCommandContextBuilder_PullStatus(t *testing.T) { result := subject.BuildProjectContext(commandCtx, command.Plan, "", projCfg, []string{}, "some/dir", false, false, false, false, true, terraformClient) - assert.True(t, result[0].AbortOnExcecutionOrderFail) + assert.True(t, result[0].AbortOnExecutionOrderFail) }) } diff --git a/server/events/project_command_pool_executor.go b/server/events/project_command_pool_executor.go index c3b19114d6..bd6a934b36 100644 --- a/server/events/project_command_pool_executor.go +++ b/server/events/project_command_pool_executor.go @@ -82,7 +82,7 @@ func runProjectCmdsParallelGroups( for _, group := range groups { res := runProjectCmdsParallel(group, runnerFunc, poolSize) results = append(results, res.ProjectResults...) - if res.HasErrors() && group[0].AbortOnExcecutionOrderFail { + if res.HasErrors() && group[0].AbortOnExecutionOrderFail { ctx.Log.Info("abort on execution order when failed") break }