Skip to content

Commit 9094abf

Browse files
chenrui333kvanzuijlen
authored andcommitted
chore: fix typo pt2 (runatlantis#5203)
Signed-off-by: Rui Chen <[email protected]> Signed-off-by: kvanzuijlen <[email protected]>
1 parent 028e71a commit 9094abf

12 files changed

+225
-225
lines changed

server/core/config/raw/repo_cfg.go

+33-33
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ import (
1010
// DefaultEmojiReaction is the default emoji reaction for repos
1111
const DefaultEmojiReaction = ""
1212

13-
// DefaultAbortOnExcecutionOrderFail being false is the default setting for abort on execution group failures
14-
const DefaultAbortOnExcecutionOrderFail = false
13+
// DefaultAbortOnExecutionOrderFail being false is the default setting for abort on execution group failures
14+
const DefaultAbortOnExecutionOrderFail = false
1515

1616
// RepoCfg is the raw schema for repo-level atlantis.yaml config.
1717
type RepoCfg struct {
18-
Version *int `yaml:"version,omitempty"`
19-
Projects []Project `yaml:"projects,omitempty"`
20-
Workflows map[string]Workflow `yaml:"workflows,omitempty"`
21-
PolicySets PolicySets `yaml:"policies,omitempty"`
22-
AutoDiscover *AutoDiscover `yaml:"autodiscover,omitempty"`
23-
Automerge *bool `yaml:"automerge,omitempty"`
24-
ParallelApply *bool `yaml:"parallel_apply,omitempty"`
25-
ParallelPlan *bool `yaml:"parallel_plan,omitempty"`
26-
DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"`
27-
EmojiReaction *string `yaml:"emoji_reaction,omitempty"`
28-
AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"`
29-
AbortOnExcecutionOrderFail *bool `yaml:"abort_on_execution_order_fail,omitempty"`
30-
RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"`
31-
SilencePRComments []string `yaml:"silence_pr_comments,omitempty"`
18+
Version *int `yaml:"version,omitempty"`
19+
Projects []Project `yaml:"projects,omitempty"`
20+
Workflows map[string]Workflow `yaml:"workflows,omitempty"`
21+
PolicySets PolicySets `yaml:"policies,omitempty"`
22+
AutoDiscover *AutoDiscover `yaml:"autodiscover,omitempty"`
23+
Automerge *bool `yaml:"automerge,omitempty"`
24+
ParallelApply *bool `yaml:"parallel_apply,omitempty"`
25+
ParallelPlan *bool `yaml:"parallel_plan,omitempty"`
26+
DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"`
27+
EmojiReaction *string `yaml:"emoji_reaction,omitempty"`
28+
AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"`
29+
AbortOnExecutionOrderFail *bool `yaml:"abort_on_execution_order_fail,omitempty"`
30+
RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"`
31+
SilencePRComments []string `yaml:"silence_pr_comments,omitempty"`
3232
}
3333

3434
func (r RepoCfg) Validate() error {
@@ -69,9 +69,9 @@ func (r RepoCfg) ToValid() valid.RepoCfg {
6969
emojiReaction = *r.EmojiReaction
7070
}
7171

72-
abortOnExcecutionOrderFail := DefaultAbortOnExcecutionOrderFail
73-
if r.AbortOnExcecutionOrderFail != nil {
74-
abortOnExcecutionOrderFail = *r.AbortOnExcecutionOrderFail
72+
abortOnExecutionOrderFail := DefaultAbortOnExecutionOrderFail
73+
if r.AbortOnExecutionOrderFail != nil {
74+
abortOnExecutionOrderFail = *r.AbortOnExecutionOrderFail
7575
}
7676

7777
var autoDiscover *valid.AutoDiscover
@@ -84,19 +84,19 @@ func (r RepoCfg) ToValid() valid.RepoCfg {
8484
repoLocks = r.RepoLocks.ToValid()
8585
}
8686
return valid.RepoCfg{
87-
Version: *r.Version,
88-
Projects: validProjects,
89-
Workflows: validWorkflows,
90-
AutoDiscover: autoDiscover,
91-
Automerge: automerge,
92-
ParallelApply: parallelApply,
93-
ParallelPlan: parallelPlan,
94-
ParallelPolicyCheck: parallelPlan,
95-
DeleteSourceBranchOnMerge: r.DeleteSourceBranchOnMerge,
96-
AllowedRegexpPrefixes: r.AllowedRegexpPrefixes,
97-
EmojiReaction: emojiReaction,
98-
AbortOnExcecutionOrderFail: abortOnExcecutionOrderFail,
99-
RepoLocks: repoLocks,
100-
SilencePRComments: r.SilencePRComments,
87+
Version: *r.Version,
88+
Projects: validProjects,
89+
Workflows: validWorkflows,
90+
AutoDiscover: autoDiscover,
91+
Automerge: automerge,
92+
ParallelApply: parallelApply,
93+
ParallelPlan: parallelPlan,
94+
ParallelPolicyCheck: parallelPlan,
95+
DeleteSourceBranchOnMerge: r.DeleteSourceBranchOnMerge,
96+
AllowedRegexpPrefixes: r.AllowedRegexpPrefixes,
97+
EmojiReaction: emojiReaction,
98+
AbortOnExecutionOrderFail: abortOnExecutionOrderFail,
99+
RepoLocks: repoLocks,
100+
SilencePRComments: r.SilencePRComments,
101101
}
102102
}

server/core/config/raw/repo_cfg_test.go

+23-23
Original file line numberDiff line numberDiff line change
@@ -281,43 +281,43 @@ func TestConfig_ToValid(t *testing.T) {
281281
Version: Int(2),
282282
},
283283
exp: valid.RepoCfg{
284-
Version: 2,
285-
Automerge: nil,
286-
ParallelApply: nil,
287-
AbortOnExcecutionOrderFail: false,
288-
Workflows: map[string]valid.Workflow{},
284+
Version: 2,
285+
Automerge: nil,
286+
ParallelApply: nil,
287+
AbortOnExecutionOrderFail: false,
288+
Workflows: map[string]valid.Workflow{},
289289
},
290290
},
291291
{
292292
description: "automerge, parallel_apply, abort_on_execution_order_fail true",
293293
input: raw.RepoCfg{
294-
Version: Int(2),
295-
Automerge: Bool(true),
296-
ParallelApply: Bool(true),
297-
AbortOnExcecutionOrderFail: Bool(true),
294+
Version: Int(2),
295+
Automerge: Bool(true),
296+
ParallelApply: Bool(true),
297+
AbortOnExecutionOrderFail: Bool(true),
298298
},
299299
exp: valid.RepoCfg{
300-
Version: 2,
301-
Automerge: Bool(true),
302-
ParallelApply: Bool(true),
303-
AbortOnExcecutionOrderFail: true,
304-
Workflows: map[string]valid.Workflow{},
300+
Version: 2,
301+
Automerge: Bool(true),
302+
ParallelApply: Bool(true),
303+
AbortOnExecutionOrderFail: true,
304+
Workflows: map[string]valid.Workflow{},
305305
},
306306
},
307307
{
308308
description: "automerge, parallel_apply, abort_on_execution_order_fail false",
309309
input: raw.RepoCfg{
310-
Version: Int(2),
311-
Automerge: Bool(false),
312-
ParallelApply: Bool(false),
313-
AbortOnExcecutionOrderFail: Bool(false),
310+
Version: Int(2),
311+
Automerge: Bool(false),
312+
ParallelApply: Bool(false),
313+
AbortOnExecutionOrderFail: Bool(false),
314314
},
315315
exp: valid.RepoCfg{
316-
Version: 2,
317-
Automerge: Bool(false),
318-
ParallelApply: Bool(false),
319-
AbortOnExcecutionOrderFail: false,
320-
Workflows: map[string]valid.Workflow{},
316+
Version: 2,
317+
Automerge: Bool(false),
318+
ParallelApply: Bool(false),
319+
AbortOnExecutionOrderFail: false,
320+
Workflows: map[string]valid.Workflow{},
321321
},
322322
},
323323
{

server/core/config/valid/global_cfg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const DefaultAtlantisFile = "atlantis.yaml"
3737
// NonOverridableApplyReqs will get applied across all "repos" in the server side config.
3838
// If repo config is allowed overrides, they can override this.
3939
// TODO: Make this more customizable, not everyone wants this rigid workflow
40-
// maybe something along the lines of defining overridable/non-overrideable apply
40+
// maybe something along the lines of defining overridable/non-overridable apply
4141
// requirements in the config and removing the flag to enable policy checking.
4242
var NonOverridableApplyReqs = []string{PoliciesPassedCommandReq}
4343

server/core/config/valid/global_cfg_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ repos:
774774
CustomPolicyCheck: false,
775775
},
776776
},
777-
"repo-side apply reqs should include non-overrideable 'policies_passed' req when overridden and policies enabled": {
777+
"repo-side apply reqs should include non-overridable 'policies_passed' req when overridden and policies enabled": {
778778
gCfg: `
779779
repos:
780780
- id: /.*/
@@ -806,7 +806,7 @@ repos:
806806
PolicyCheck: true,
807807
},
808808
},
809-
"repo-side apply reqs should not include non-overrideable 'policies_passed' req when overridden and policies disabled": {
809+
"repo-side apply reqs should not include non-overridable 'policies_passed' req when overridden and policies disabled": {
810810
gCfg: `
811811
repos:
812812
- id: /.*/

server/core/config/valid/repo_cfg.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ import (
1414
// RepoCfg is the atlantis.yaml config after it's been parsed and validated.
1515
type RepoCfg struct {
1616
// Version is the version of the atlantis YAML file.
17-
Version int
18-
Projects []Project
19-
Workflows map[string]Workflow
20-
PolicySets PolicySets
21-
Automerge *bool
22-
AutoDiscover *AutoDiscover
23-
ParallelApply *bool
24-
ParallelPlan *bool
25-
ParallelPolicyCheck *bool
26-
DeleteSourceBranchOnMerge *bool
27-
RepoLocks *RepoLocks
28-
CustomPolicyCheck *bool
29-
EmojiReaction string
30-
AllowedRegexpPrefixes []string
31-
AbortOnExcecutionOrderFail bool
32-
SilencePRComments []string
17+
Version int
18+
Projects []Project
19+
Workflows map[string]Workflow
20+
PolicySets PolicySets
21+
Automerge *bool
22+
AutoDiscover *AutoDiscover
23+
ParallelApply *bool
24+
ParallelPlan *bool
25+
ParallelPolicyCheck *bool
26+
DeleteSourceBranchOnMerge *bool
27+
RepoLocks *RepoLocks
28+
CustomPolicyCheck *bool
29+
EmojiReaction string
30+
AllowedRegexpPrefixes []string
31+
AbortOnExecutionOrderFail bool
32+
SilencePRComments []string
3333
}
3434

3535
func (r RepoCfg) FindProjectsByDirWorkspace(repoRelDir string, workspace string) []Project {

server/events/apply_command_runner_test.go

+49-49
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,16 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
234234
Description: "When first apply fails, the second don't run",
235235
ProjectContexts: []command.ProjectContext{
236236
{
237-
ExecutionOrderGroup: 0,
238-
ProjectName: "First",
239-
ParallelApplyEnabled: true,
240-
AbortOnExcecutionOrderFail: true,
237+
ExecutionOrderGroup: 0,
238+
ProjectName: "First",
239+
ParallelApplyEnabled: true,
240+
AbortOnExecutionOrderFail: true,
241241
},
242242
{
243-
ExecutionOrderGroup: 1,
244-
ProjectName: "Second",
245-
ParallelApplyEnabled: true,
246-
AbortOnExcecutionOrderFail: true,
243+
ExecutionOrderGroup: 1,
244+
ProjectName: "Second",
245+
ParallelApplyEnabled: true,
246+
AbortOnExecutionOrderFail: true,
247247
},
248248
},
249249
ProjectResults: []command.ProjectResult{
@@ -268,16 +268,16 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
268268
Description: "When first apply fails, the second not will run",
269269
ProjectContexts: []command.ProjectContext{
270270
{
271-
ExecutionOrderGroup: 0,
272-
ProjectName: "First",
273-
ParallelApplyEnabled: true,
274-
AbortOnExcecutionOrderFail: true,
271+
ExecutionOrderGroup: 0,
272+
ProjectName: "First",
273+
ParallelApplyEnabled: true,
274+
AbortOnExecutionOrderFail: true,
275275
},
276276
{
277-
ExecutionOrderGroup: 1,
278-
ProjectName: "Second",
279-
ParallelApplyEnabled: true,
280-
AbortOnExcecutionOrderFail: true,
277+
ExecutionOrderGroup: 1,
278+
ProjectName: "Second",
279+
ParallelApplyEnabled: true,
280+
AbortOnExecutionOrderFail: true,
281281
},
282282
},
283283
ProjectResults: []command.ProjectResult{
@@ -300,25 +300,25 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
300300
Description: "When both in a group of two succeeds, the following two will run",
301301
ProjectContexts: []command.ProjectContext{
302302
{
303-
ExecutionOrderGroup: 0,
304-
ProjectName: "First",
305-
ParallelApplyEnabled: true,
306-
AbortOnExcecutionOrderFail: true,
303+
ExecutionOrderGroup: 0,
304+
ProjectName: "First",
305+
ParallelApplyEnabled: true,
306+
AbortOnExecutionOrderFail: true,
307307
},
308308
{
309-
ExecutionOrderGroup: 0,
310-
ProjectName: "Second",
311-
AbortOnExcecutionOrderFail: true,
309+
ExecutionOrderGroup: 0,
310+
ProjectName: "Second",
311+
AbortOnExecutionOrderFail: true,
312312
},
313313
{
314-
ExecutionOrderGroup: 1,
315-
ProjectName: "Third",
316-
AbortOnExcecutionOrderFail: true,
314+
ExecutionOrderGroup: 1,
315+
ProjectName: "Third",
316+
AbortOnExecutionOrderFail: true,
317317
},
318318
{
319-
ExecutionOrderGroup: 1,
320-
ProjectName: "Fourth",
321-
AbortOnExcecutionOrderFail: true,
319+
ExecutionOrderGroup: 1,
320+
ProjectName: "Fourth",
321+
AbortOnExecutionOrderFail: true,
322322
},
323323
},
324324
ProjectResults: []command.ProjectResult{
@@ -353,25 +353,25 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
353353
Description: "When one out of two fails, the following two will not run",
354354
ProjectContexts: []command.ProjectContext{
355355
{
356-
ExecutionOrderGroup: 0,
357-
ProjectName: "First",
358-
ParallelApplyEnabled: true,
359-
AbortOnExcecutionOrderFail: true,
356+
ExecutionOrderGroup: 0,
357+
ProjectName: "First",
358+
ParallelApplyEnabled: true,
359+
AbortOnExecutionOrderFail: true,
360360
},
361361
{
362-
ExecutionOrderGroup: 0,
363-
ProjectName: "Second",
364-
AbortOnExcecutionOrderFail: true,
362+
ExecutionOrderGroup: 0,
363+
ProjectName: "Second",
364+
AbortOnExecutionOrderFail: true,
365365
},
366366
{
367-
ExecutionOrderGroup: 1,
368-
ProjectName: "Third",
369-
AbortOnExcecutionOrderFail: true,
367+
ExecutionOrderGroup: 1,
368+
ProjectName: "Third",
369+
AbortOnExecutionOrderFail: true,
370370
},
371371
{
372-
ExecutionOrderGroup: 1,
373-
AbortOnExcecutionOrderFail: true,
374-
ProjectName: "Fourth",
372+
ExecutionOrderGroup: 1,
373+
AbortOnExecutionOrderFail: true,
374+
ProjectName: "Fourth",
375375
},
376376
},
377377
ProjectResults: []command.ProjectResult{
@@ -408,14 +408,14 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
408408
Description: "Don't block when parallel is not set",
409409
ProjectContexts: []command.ProjectContext{
410410
{
411-
ExecutionOrderGroup: 0,
412-
ProjectName: "First",
413-
AbortOnExcecutionOrderFail: true,
411+
ExecutionOrderGroup: 0,
412+
ProjectName: "First",
413+
AbortOnExecutionOrderFail: true,
414414
},
415415
{
416-
ExecutionOrderGroup: 1,
417-
ProjectName: "Second",
418-
AbortOnExcecutionOrderFail: true,
416+
ExecutionOrderGroup: 1,
417+
ProjectName: "Second",
418+
AbortOnExecutionOrderFail: true,
419419
},
420420
},
421421
ProjectResults: []command.ProjectResult{
@@ -437,7 +437,7 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
437437
"2. dir: `` workspace: ``\n```diff\nGreat success!\n```\n\n---\n### Apply Summary\n\n2 projects, 1 successful, 0 failed, 1 errored",
438438
},
439439
{
440-
Description: "Don't block when abortOnExcecutionOrderFail is not set",
440+
Description: "Don't block when abortOnExecutionOrderFail is not set",
441441
ProjectContexts: []command.ProjectContext{
442442
{
443443
ExecutionOrderGroup: 0,

server/events/command/project_context.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type ProjectContext struct {
122122
// The index of order group. Before planning/applying it will use to sort projects. Default is 0.
123123
ExecutionOrderGroup int
124124
// If plans/applies should be aborted if any prior plan/apply fails
125-
AbortOnExcecutionOrderFail bool
125+
AbortOnExecutionOrderFail bool
126126
// Allows custom policy check tools outside of Conftest to run in checks
127127
CustomPolicyCheck bool
128128
SilencePRComments []string

0 commit comments

Comments
 (0)