diff --git a/server/events/markdown_renderer.go b/server/events/markdown_renderer.go index 34b51f171a..88c7d6bf55 100644 --- a/server/events/markdown_renderer.go +++ b/server/events/markdown_renderer.go @@ -202,7 +202,7 @@ var singleProjectPlanUnsuccessfulTmpl = template.Must(template.New("").Parse( "{{$result := index .Results 0}}Ran {{.Command}} for dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n" + "{{$result.Rendered}}\n" + logTmpl)) var multiProjectPlanTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap()).Parse( - "Ran {{.Command}} for {{ len .Results }} projects:\n" + + "Ran {{.Command}} for {{ len .Results }} projects:\n\n" + "{{ range $result := .Results }}" + "1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{end}}\n" + @@ -213,7 +213,7 @@ var multiProjectPlanTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap " * `atlantis apply`{{end}}" + logTmpl)) var multiProjectApplyTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap()).Parse( - "Ran {{.Command}} for {{ len .Results }} projects:\n" + + "Ran {{.Command}} for {{ len .Results }} projects:\n\n" + "{{ range $result := .Results }}" + "1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{end}}\n" + diff --git a/server/events/markdown_renderer_test.go b/server/events/markdown_renderer_test.go index 8b4c011584..1403015d73 100644 --- a/server/events/markdown_renderer_test.go +++ b/server/events/markdown_renderer_test.go @@ -126,7 +126,7 @@ func TestRenderProjectResults(t *testing.T) { models.PlanCommand, []models.ProjectResult{}, models.Github, - "Ran Plan for 0 projects:\n\n\n", + "Ran Plan for 0 projects:\n\n\n\n", }, { "single successful plan", @@ -262,6 +262,7 @@ $$$ }, models.Github, `Ran Plan for 2 projects: + 1. dir: $path$ workspace: $workspace$ 1. project: $projectname$ dir: $path2$ workspace: $workspace$ @@ -311,6 +312,7 @@ $$$ }, models.Github, `Ran Apply for 2 projects: + 1. project: $projectname$ dir: $path$ workspace: $workspace$ 1. dir: $path2$ workspace: $workspace$ @@ -394,6 +396,7 @@ $$$ }, models.Github, `Ran Plan for 3 projects: + 1. dir: $path$ workspace: $workspace$ 1. dir: $path2$ workspace: $workspace$ 1. project: $projectname$ dir: $path3$ workspace: $workspace$ @@ -447,6 +450,7 @@ $$$ }, models.Github, `Ran Apply for 3 projects: + 1. dir: $path$ workspace: $workspace$ 1. dir: $path2$ workspace: $workspace$ 1. dir: $path3$ workspace: $workspace$ @@ -493,6 +497,7 @@ $$$ }, models.Github, `Ran Apply for 3 projects: + 1. dir: $path$ workspace: $workspace$ 1. dir: $path2$ workspace: $workspace$ 1. dir: $path3$ workspace: $workspace$ @@ -837,6 +842,7 @@ func TestRenderProjectResults_MultiProjectApplyWrapped(t *testing.T) { }, }, models.ApplyCommand, "log", false, models.Github) exp := `Ran Apply for 2 projects: + 1. dir: $.$ workspace: $staging$ 1. dir: $.$ workspace: $production$ @@ -892,6 +898,7 @@ func TestRenderProjectResults_MultiProjectPlanWrapped(t *testing.T) { }, }, models.PlanCommand, "log", false, models.Github) exp := `Ran Plan for 2 projects: + 1. dir: $.$ workspace: $staging$ 1. dir: $.$ workspace: $production$ @@ -973,6 +980,7 @@ func TestRenderProjectResults_PlansDeleted(t *testing.T) { PlansDeleted: true, }, exp: `Ran Plan for 2 projects: + 1. dir: $.$ workspace: $staging$ 1. dir: $.$ workspace: $production$ @@ -1009,6 +1017,7 @@ func TestRenderProjectResults_PlansDeleted(t *testing.T) { PlansDeleted: true, }, exp: `Ran Plan for 2 projects: + 1. dir: $.$ workspace: $staging$ 1. dir: $.$ workspace: $production$ diff --git a/server/testfixtures/test-repos/automerge/exp-output-autoplan.txt b/server/testfixtures/test-repos/automerge/exp-output-autoplan.txt index 1ddff291f2..70ff3a5ba8 100644 --- a/server/testfixtures/test-repos/automerge/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/automerge/exp-output-autoplan.txt @@ -1,4 +1,5 @@ Ran Plan for 2 projects: + 1. dir: `dir1` workspace: `default` 1. dir: `dir2` workspace: `default` diff --git a/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt b/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt index 90891f1a08..2f739dfb13 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt @@ -1,4 +1,5 @@ Ran Plan for 2 projects: + 1. dir: `staging` workspace: `default` 1. dir: `production` workspace: `default` diff --git a/server/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt b/server/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt index ad7470557a..73e701a5f3 100644 --- a/server/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt @@ -1,4 +1,5 @@ Ran Plan for 2 projects: + 1. dir: `.` workspace: `default` 1. dir: `.` workspace: `staging` diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt index 05e2162fa3..c144599164 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt @@ -1,4 +1,5 @@ Ran Apply for 2 projects: + 1. dir: `.` workspace: `default` 1. dir: `.` workspace: `staging` diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt index f19ef044ce..3fff439369 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt @@ -1,4 +1,5 @@ Ran Plan for 2 projects: + 1. dir: `.` workspace: `default` 1. dir: `.` workspace: `staging` diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt index c6432b58bd..5abaf0d5a2 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-all.txt @@ -1,4 +1,5 @@ Ran Apply for 2 projects: + 1. dir: `.` workspace: `default` 1. dir: `.` workspace: `new_workspace` diff --git a/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt b/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt index 2faecf2963..f93de7fb89 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt @@ -1,4 +1,5 @@ Ran Plan for 2 projects: + 1. project: `default` dir: `.` workspace: `default` 1. project: `staging` dir: `.` workspace: `default`