From 934b51b64fe8bec2663ed0d5f6b7270da8a825f3 Mon Sep 17 00:00:00 2001 From: Luke Kysow <1034429+lkysow@users.noreply.github.com> Date: Tue, 4 Dec 2018 11:57:58 -0600 Subject: [PATCH] Add project name to comments. If projects are configured using an atlantis.yaml with a specific project name, include that in the output for comments. This is useful because often the project names are better identifiers than the directory and workspace names and also because some projects use the same dir and workspace so the only way to differentiate them is via their names. Fixes #353 --- server/events/markdown_renderer.go | 26 +-- server/events/markdown_renderer_test.go | 186 +++++++++++------- server/events/models/models.go | 9 + server/events/project_command_runner.go | 2 + server/events/project_result.go | 1 + .../exp-output-apply-production.txt | 2 +- .../modules-yaml/exp-output-apply-staging.txt | 2 +- .../modules-yaml/exp-output-autoplan.txt | 8 +- .../exp-output-plan-production.txt | 2 +- .../modules-yaml/exp-output-plan-staging.txt | 2 +- .../modules/exp-output-apply-production.txt | 2 +- .../modules/exp-output-apply-staging.txt | 2 +- .../exp-output-autoplan-only-staging.txt | 2 +- .../modules/exp-output-plan-production.txt | 2 +- .../modules/exp-output-plan-staging.txt | 2 +- .../simple-yaml/exp-output-apply-all.txt | 8 +- .../simple-yaml/exp-output-apply-default.txt | 2 +- .../simple-yaml/exp-output-apply-staging.txt | 2 +- .../simple-yaml/exp-output-autoplan.txt | 8 +- .../simple/exp-output-apply-var-all.txt | 8 +- ...exp-output-apply-var-default-workspace.txt | 2 +- .../exp-output-apply-var-new-workspace.txt | 2 +- .../simple/exp-output-apply-var.txt | 2 +- .../test-repos/simple/exp-output-apply.txt | 2 +- ...exp-output-atlantis-plan-new-workspace.txt | 2 +- ...xp-output-atlantis-plan-var-overridden.txt | 2 +- .../simple/exp-output-atlantis-plan.txt | 2 +- .../test-repos/simple/exp-output-autoplan.txt | 2 +- .../exp-output-apply-default.txt | 2 +- .../exp-output-apply-staging.txt | 2 +- .../exp-output-plan-default.txt | 2 +- .../exp-output-plan-staging.txt | 2 +- .../tfvars-yaml/exp-output-apply-default.txt | 2 +- .../tfvars-yaml/exp-output-apply-staging.txt | 2 +- .../tfvars-yaml/exp-output-autoplan.txt | 8 +- 35 files changed, 191 insertions(+), 123 deletions(-) diff --git a/server/events/markdown_renderer.go b/server/events/markdown_renderer.go index 638ae9d9ea..7b88f80b4a 100644 --- a/server/events/markdown_renderer.go +++ b/server/events/markdown_renderer.go @@ -65,9 +65,10 @@ type ResultData struct { } type projectResultTmplData struct { - Workspace string - RepoRelDir string - Rendered string + Workspace string + RepoRelDir string + ProjectName string + Rendered string } // Render formats the data into a markdown string. @@ -90,8 +91,9 @@ func (m *MarkdownRenderer) renderProjectResults(results []ProjectResult, common for _, result := range results { resultData := projectResultTmplData{ - Workspace: result.Workspace, - RepoRelDir: result.RepoRelDir, + Workspace: result.Workspace, + RepoRelDir: result.RepoRelDir, + ProjectName: result.ProjectName, } if result.Error != nil { tmpl := unwrappedErrTmpl @@ -178,23 +180,23 @@ func (m *MarkdownRenderer) renderTemplate(tmpl *template.Template, data interfac // todo: refactor to remove duplication #refactor var singleProjectApplyTmpl = template.Must(template.New("").Parse( - "{{$result := index .Results 0}}Ran {{.Command}} in dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n{{$result.Rendered}}\n" + logTmpl)) + "{{$result := index .Results 0}}Ran {{.Command}} for {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n{{$result.Rendered}}\n" + logTmpl)) var singleProjectPlanSuccessTmpl = template.Must(template.New("").Parse( - "{{$result := index .Results 0}}Ran {{.Command}} in dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n{{$result.Rendered}}\n" + + "{{$result := index .Results 0}}Ran {{.Command}} for {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n{{$result.Rendered}}\n" + "\n" + "---\n" + "* :fast_forward: To **apply** all unapplied plans from this pull request, comment:\n" + " * `atlantis apply`" + logTmpl)) var singleProjectPlanUnsuccessfulTmpl = template.Must(template.New("").Parse( - "{{$result := index .Results 0}}Ran {{.Command}} in dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n\n" + + "{{$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" + "{{ range $result := .Results }}" + - "1. workspace: `{{$result.Workspace}}` dir: `{{$result.RepoRelDir}}`\n" + + "1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{end}}\n" + "{{ range $i, $result := .Results }}" + - "### {{add $i 1}}. workspace: `{{$result.Workspace}}` dir: `{{$result.RepoRelDir}}`\n" + + "### {{add $i 1}}. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{$result.Rendered}}\n\n" + "---\n{{end}}{{ if gt (len .Results) 0 }}* :fast_forward: To **apply** all unapplied plans from this pull request, comment:\n" + " * `atlantis apply`{{end}}" + @@ -202,10 +204,10 @@ var multiProjectPlanTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap var multiProjectApplyTmpl = template.Must(template.New("").Funcs(sprig.TxtFuncMap()).Parse( "Ran {{.Command}} for {{ len .Results }} projects:\n" + "{{ range $result := .Results }}" + - "1. workspace: `{{$result.Workspace}}` dir: `{{$result.RepoRelDir}}`\n" + + "1. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{end}}\n" + "{{ range $i, $result := .Results }}" + - "### {{add $i 1}}. workspace: `{{$result.Workspace}}` dir: `{{$result.RepoRelDir}}`\n" + + "### {{add $i 1}}. {{ if $result.ProjectName }}project: `{{$result.ProjectName}}` {{ end }}dir: `{{$result.RepoRelDir}}` workspace: `{{$result.Workspace}}`\n" + "{{$result.Rendered}}\n\n" + "---\n{{end}}" + logTmpl)) diff --git a/server/events/markdown_renderer_test.go b/server/events/markdown_renderer_test.go index 3fb1c3a6ed..07d6c7b8d4 100644 --- a/server/events/markdown_renderer_test.go +++ b/server/events/markdown_renderer_test.go @@ -48,20 +48,19 @@ func TestRenderErr(t *testing.T) { r := events.MarkdownRenderer{} for _, c := range cases { - t.Run(c.Description, func(t *testing.T) { - res := events.CommandResult{ - Error: c.Error, - } - for _, verbose := range []bool{true, false} { - t.Log("testing " + c.Description) + res := events.CommandResult{ + Error: c.Error, + } + for _, verbose := range []bool{true, false} { + t.Run(fmt.Sprintf("%s_%t", c.Description, verbose), func(t *testing.T) { s := r.Render(res, c.Command, "log", verbose, models.Github) if !verbose { Equals(t, c.Expected, s) } else { Equals(t, c.Expected+"
Log\n

\n\n```\nlog```\n

\n", s) } - } - }) + }) + } } } @@ -88,25 +87,23 @@ func TestRenderFailure(t *testing.T) { r := events.MarkdownRenderer{} for _, c := range cases { - t.Run(c.Description, func(t *testing.T) { - res := events.CommandResult{ - Failure: c.Failure, - } - for _, verbose := range []bool{true, false} { - t.Log("testing " + c.Description) + res := events.CommandResult{ + Failure: c.Failure, + } + for _, verbose := range []bool{true, false} { + t.Run(fmt.Sprintf("%s_%t", c.Description, verbose), func(t *testing.T) { s := r.Render(res, c.Command, "log", verbose, models.Github) if !verbose { Equals(t, c.Expected, s) } else { Equals(t, c.Expected+"
Log\n

\n\n```\nlog```\n

\n", s) } - } - }) + }) + } } } func TestRenderErrAndFailure(t *testing.T) { - t.Log("if there is an error and a failure, the error should be printed") r := events.MarkdownRenderer{} res := events.CommandResult{ Error: errors.New("error"), @@ -147,7 +144,41 @@ func TestRenderProjectResults(t *testing.T) { }, }, models.Github, - `Ran Plan in dir: $path$ workspace: $workspace$ + `Ran Plan for dir: $path$ workspace: $workspace$ + +$$$diff +terraform-output +$$$ + +* :arrow_forward: To **apply** this plan, comment: + * $atlantis apply -d path -w workspace$ +* :put_litter_in_its_place: To **delete** this plan click [here](lock-url) +* :repeat: To **plan** this project again, comment: + * $atlantis plan -d path -w workspace$ + +--- +* :fast_forward: To **apply** all unapplied plans from this pull request, comment: + * $atlantis apply$ +`, + }, + { + "single successful plan with project name", + events.PlanCommand, + []events.ProjectResult{ + { + PlanSuccess: &events.PlanSuccess{ + TerraformOutput: "terraform-output", + LockURL: "lock-url", + RePlanCmd: "atlantis plan -d path -w workspace", + ApplyCmd: "atlantis apply -d path -w workspace", + }, + Workspace: "workspace", + RepoRelDir: "path", + ProjectName: "projectname", + }, + }, + models.Github, + `Ran Plan for project: $projectname$ dir: $path$ workspace: $workspace$ $$$diff terraform-output @@ -175,7 +206,27 @@ $$$ }, }, models.Github, - `Ran Apply in dir: $path$ workspace: $workspace$ + `Ran Apply for dir: $path$ workspace: $workspace$ + +$$$diff +success +$$$ + +`, + }, + { + "single successful apply with project name", + events.ApplyCommand, + []events.ProjectResult{ + { + ApplySuccess: "success", + Workspace: "workspace", + RepoRelDir: "path", + ProjectName: "projectname", + }, + }, + models.Github, + `Ran Apply for project: $projectname$ dir: $path$ workspace: $workspace$ $$$diff success @@ -198,8 +249,9 @@ $$$ }, }, { - Workspace: "workspace", - RepoRelDir: "path2", + Workspace: "workspace", + RepoRelDir: "path2", + ProjectName: "projectname", PlanSuccess: &events.PlanSuccess{ TerraformOutput: "terraform-output2", LockURL: "lock-url2", @@ -210,10 +262,10 @@ $$$ }, models.Github, `Ran Plan for 2 projects: -1. workspace: $workspace$ dir: $path$ -1. workspace: $workspace$ dir: $path2$ +1. dir: $path$ workspace: $workspace$ +1. project: $projectname$ dir: $path2$ workspace: $workspace$ -### 1. workspace: $workspace$ dir: $path$ +### 1. dir: $path$ workspace: $workspace$ $$$diff terraform-output $$$ @@ -225,7 +277,7 @@ $$$ * $atlantis plan -d path -w workspace$ --- -### 2. workspace: $workspace$ dir: $path2$ +### 2. project: $projectname$ dir: $path2$ workspace: $workspace$ $$$diff terraform-output2 $$$ @@ -248,6 +300,7 @@ $$$ { RepoRelDir: "path", Workspace: "workspace", + ProjectName: "projectname", ApplySuccess: "success", }, { @@ -258,16 +311,16 @@ $$$ }, models.Github, `Ran Apply for 2 projects: -1. workspace: $workspace$ dir: $path$ -1. workspace: $workspace$ dir: $path2$ +1. project: $projectname$ dir: $path$ workspace: $workspace$ +1. dir: $path2$ workspace: $workspace$ -### 1. workspace: $workspace$ dir: $path$ +### 1. project: $projectname$ dir: $path$ workspace: $workspace$ $$$diff success $$$ --- -### 2. workspace: $workspace$ dir: $path2$ +### 2. dir: $path2$ workspace: $workspace$ $$$diff success2 $$$ @@ -287,7 +340,7 @@ $$$ }, }, models.Github, - `Ran Plan in dir: $path$ workspace: $workspace$ + `Ran Plan for dir: $path$ workspace: $workspace$ **Plan Error** $$$ @@ -307,7 +360,7 @@ $$$ }, }, models.Github, - `Ran Plan in dir: $path$ workspace: $workspace$ + `Ran Plan for dir: $path$ workspace: $workspace$ **Plan Failed**: failure @@ -333,18 +386,19 @@ $$$ Failure: "failure", }, { - Workspace: "workspace", - RepoRelDir: "path3", - Error: errors.New("error"), + Workspace: "workspace", + RepoRelDir: "path3", + ProjectName: "projectname", + Error: errors.New("error"), }, }, models.Github, `Ran Plan for 3 projects: -1. workspace: $workspace$ dir: $path$ -1. workspace: $workspace$ dir: $path2$ -1. workspace: $workspace$ dir: $path3$ +1. dir: $path$ workspace: $workspace$ +1. dir: $path2$ workspace: $workspace$ +1. project: $projectname$ dir: $path3$ workspace: $workspace$ -### 1. workspace: $workspace$ dir: $path$ +### 1. dir: $path$ workspace: $workspace$ $$$diff terraform-output $$$ @@ -356,11 +410,11 @@ $$$ * $atlantis plan -d path -w workspace$ --- -### 2. workspace: $workspace$ dir: $path2$ +### 2. dir: $path2$ workspace: $workspace$ **Plan Failed**: failure --- -### 3. workspace: $workspace$ dir: $path3$ +### 3. project: $projectname$ dir: $path3$ workspace: $workspace$ **Plan Error** $$$ error @@ -393,21 +447,21 @@ $$$ }, models.Github, `Ran Apply for 3 projects: -1. workspace: $workspace$ dir: $path$ -1. workspace: $workspace$ dir: $path2$ -1. workspace: $workspace$ dir: $path3$ +1. dir: $path$ workspace: $workspace$ +1. dir: $path2$ workspace: $workspace$ +1. dir: $path3$ workspace: $workspace$ -### 1. workspace: $workspace$ dir: $path$ +### 1. dir: $path$ workspace: $workspace$ $$$diff success $$$ --- -### 2. workspace: $workspace$ dir: $path2$ +### 2. dir: $path2$ workspace: $workspace$ **Apply Failed**: failure --- -### 3. workspace: $workspace$ dir: $path3$ +### 3. dir: $path3$ workspace: $workspace$ **Apply Error** $$$ error @@ -439,21 +493,21 @@ $$$ }, models.Github, `Ran Apply for 3 projects: -1. workspace: $workspace$ dir: $path$ -1. workspace: $workspace$ dir: $path2$ -1. workspace: $workspace$ dir: $path3$ +1. dir: $path$ workspace: $workspace$ +1. dir: $path2$ workspace: $workspace$ +1. dir: $path3$ workspace: $workspace$ -### 1. workspace: $workspace$ dir: $path$ +### 1. dir: $path$ workspace: $workspace$ $$$diff success $$$ --- -### 2. workspace: $workspace$ dir: $path2$ +### 2. dir: $path2$ workspace: $workspace$ **Apply Failed**: failure --- -### 3. workspace: $workspace$ dir: $path3$ +### 3. dir: $path3$ workspace: $workspace$ **Apply Error** $$$ error @@ -569,7 +623,7 @@ func TestRenderProjectResults_WrappedErr(t *testing.T) { }, events.PlanCommand, "log", false, c.VCSHost) var exp string if c.ShouldWrap { - exp = `Ran Plan in dir: $.$ workspace: $default$ + exp = `Ran Plan for dir: $.$ workspace: $default$ **Plan Error**
Show Output @@ -581,7 +635,7 @@ $$$ ` } else { - exp = `Ran Plan in dir: $.$ workspace: $default$ + exp = `Ran Plan for dir: $.$ workspace: $default$ **Plan Error** $$$ @@ -698,7 +752,7 @@ func TestRenderProjectResults_WrapSingleProject(t *testing.T) { switch cmd { case events.PlanCommand: if c.ShouldWrap { - exp = `Ran Plan in dir: $.$ workspace: $default$ + exp = `Ran Plan for dir: $.$ workspace: $default$
Show Output @@ -718,7 +772,7 @@ $$$ * $atlantis apply$ ` } else { - exp = `Ran Plan in dir: $.$ workspace: $default$ + exp = `Ran Plan for dir: $.$ workspace: $default$ $$$diff ` + c.Output + ` @@ -737,7 +791,7 @@ $$$ } case events.ApplyCommand: if c.ShouldWrap { - exp = `Ran Apply in dir: $.$ workspace: $default$ + exp = `Ran Apply for dir: $.$ workspace: $default$
Show Output @@ -748,7 +802,7 @@ $$$ ` } else { - exp = `Ran Apply in dir: $.$ workspace: $default$ + exp = `Ran Apply for dir: $.$ workspace: $default$ $$$diff ` + c.Output + ` @@ -783,10 +837,10 @@ func TestRenderProjectResults_MultiProjectApplyWrapped(t *testing.T) { }, }, events.ApplyCommand, "log", false, models.Github) exp := `Ran Apply for 2 projects: -1. workspace: $staging$ dir: $.$ -1. workspace: $production$ dir: $.$ +1. dir: $.$ workspace: $staging$ +1. dir: $.$ workspace: $production$ -### 1. workspace: $staging$ dir: $.$ +### 1. dir: $.$ workspace: $staging$
Show Output $$$diff @@ -795,7 +849,7 @@ $$$
--- -### 2. workspace: $production$ dir: $.$ +### 2. dir: $.$ workspace: $production$
Show Output $$$diff @@ -838,10 +892,10 @@ func TestRenderProjectResults_MultiProjectPlanWrapped(t *testing.T) { }, }, events.PlanCommand, "log", false, models.Github) exp := `Ran Plan for 2 projects: -1. workspace: $staging$ dir: $.$ -1. workspace: $production$ dir: $.$ +1. dir: $.$ workspace: $staging$ +1. dir: $.$ workspace: $production$ -### 1. workspace: $staging$ dir: $.$ +### 1. dir: $.$ workspace: $staging$
Show Output $$$diff @@ -856,7 +910,7 @@ $$$
--- -### 2. workspace: $production$ dir: $.$ +### 2. dir: $.$ workspace: $production$
Show Output $$$diff diff --git a/server/events/models/models.go b/server/events/models/models.go index b95172e0e1..18b232bb4e 100644 --- a/server/events/models/models.go +++ b/server/events/models/models.go @@ -315,3 +315,12 @@ func SplitRepoFullName(repoFullName string) (owner string, repo string) { } return repoFullName[:lastSlashIdx], repoFullName[lastSlashIdx+1:] } + +// GetProjectName returns the name of the project this context is for. If no +// name is configured, it returns an empty string. +func (p *ProjectCommandContext) GetProjectName() string { + if p.ProjectConfig != nil { + return p.ProjectConfig.GetName() + } + return "" +} diff --git a/server/events/project_command_runner.go b/server/events/project_command_runner.go index 04f07c0cce..8784e87de6 100644 --- a/server/events/project_command_runner.go +++ b/server/events/project_command_runner.go @@ -100,6 +100,7 @@ func (p *DefaultProjectCommandRunner) Plan(ctx models.ProjectCommandContext) Pro Failure: failure, RepoRelDir: ctx.RepoRelDir, Workspace: ctx.Workspace, + ProjectName: ctx.GetProjectName(), } } @@ -112,6 +113,7 @@ func (p *DefaultProjectCommandRunner) Apply(ctx models.ProjectCommandContext) Pr ApplySuccess: applyOut, RepoRelDir: ctx.RepoRelDir, Workspace: ctx.Workspace, + ProjectName: ctx.GetProjectName(), } } diff --git a/server/events/project_result.go b/server/events/project_result.go index 5efc429997..730c75924d 100644 --- a/server/events/project_result.go +++ b/server/events/project_result.go @@ -25,6 +25,7 @@ type ProjectResult struct { Failure string PlanSuccess *PlanSuccess ApplySuccess string + ProjectName string } // Status returns the vcs commit status of this project result. diff --git a/server/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt b/server/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt index 10104480cf..a6aee0e769 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `production` workspace: `default` +Ran Apply for dir: `production` workspace: `default` ```diff module.null.null_resource.this: Creating... diff --git a/server/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt b/server/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt index 60df81d716..4d98c17f95 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `staging` workspace: `default` +Ran Apply for dir: `staging` workspace: `default` ```diff module.null.null_resource.this: Creating... 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 09151ceef4..90891f1a08 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt @@ -1,8 +1,8 @@ Ran Plan for 2 projects: -1. workspace: `default` dir: `staging` -1. workspace: `default` dir: `production` +1. dir: `staging` workspace: `default` +1. dir: `production` workspace: `default` -### 1. workspace: `default` dir: `staging` +### 1. dir: `staging` workspace: `default` ```diff An execution plan has been generated and is shown below. @@ -24,7 +24,7 @@ Plan: 1 to add, 0 to change, 0 to destroy. * `atlantis plan -d staging` --- -### 2. workspace: `default` dir: `production` +### 2. dir: `production` workspace: `default` ```diff An execution plan has been generated and is shown below. diff --git a/server/testfixtures/test-repos/modules-yaml/exp-output-plan-production.txt b/server/testfixtures/test-repos/modules-yaml/exp-output-plan-production.txt index ff3295cf55..f08e2c50ae 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-plan-production.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-plan-production.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `production` workspace: `default` +Ran Plan for dir: `production` workspace: `default` ```diff Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be diff --git a/server/testfixtures/test-repos/modules-yaml/exp-output-plan-staging.txt b/server/testfixtures/test-repos/modules-yaml/exp-output-plan-staging.txt index 7cd5e0a61c..de773736db 100644 --- a/server/testfixtures/test-repos/modules-yaml/exp-output-plan-staging.txt +++ b/server/testfixtures/test-repos/modules-yaml/exp-output-plan-staging.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `staging` workspace: `default` +Ran Plan for dir: `staging` workspace: `default` ```diff Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be diff --git a/server/testfixtures/test-repos/modules/exp-output-apply-production.txt b/server/testfixtures/test-repos/modules/exp-output-apply-production.txt index 10104480cf..a6aee0e769 100644 --- a/server/testfixtures/test-repos/modules/exp-output-apply-production.txt +++ b/server/testfixtures/test-repos/modules/exp-output-apply-production.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `production` workspace: `default` +Ran Apply for dir: `production` workspace: `default` ```diff module.null.null_resource.this: Creating... diff --git a/server/testfixtures/test-repos/modules/exp-output-apply-staging.txt b/server/testfixtures/test-repos/modules/exp-output-apply-staging.txt index 60df81d716..4d98c17f95 100644 --- a/server/testfixtures/test-repos/modules/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/modules/exp-output-apply-staging.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `staging` workspace: `default` +Ran Apply for dir: `staging` workspace: `default` ```diff module.null.null_resource.this: Creating... diff --git a/server/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt b/server/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt index 7b66ebe2a4..e5bd5103d6 100644 --- a/server/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt +++ b/server/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `staging` workspace: `default` +Ran Plan for dir: `staging` workspace: `default` ```diff diff --git a/server/testfixtures/test-repos/modules/exp-output-plan-production.txt b/server/testfixtures/test-repos/modules/exp-output-plan-production.txt index af4c691fa1..0731962ff7 100644 --- a/server/testfixtures/test-repos/modules/exp-output-plan-production.txt +++ b/server/testfixtures/test-repos/modules/exp-output-plan-production.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `production` workspace: `default` +Ran Plan for dir: `production` workspace: `default` ```diff diff --git a/server/testfixtures/test-repos/modules/exp-output-plan-staging.txt b/server/testfixtures/test-repos/modules/exp-output-plan-staging.txt index 7b66ebe2a4..e5bd5103d6 100644 --- a/server/testfixtures/test-repos/modules/exp-output-plan-staging.txt +++ b/server/testfixtures/test-repos/modules/exp-output-plan-staging.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `staging` workspace: `default` +Ran Plan for dir: `staging` workspace: `default` ```diff 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 8b8b4f450c..05e2162fa3 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,8 +1,8 @@ Ran Apply for 2 projects: -1. workspace: `default` dir: `.` -1. workspace: `staging` dir: `.` +1. dir: `.` workspace: `default` +1. dir: `.` workspace: `staging` -### 1. workspace: `default` dir: `.` +### 1. dir: `.` workspace: `default` ```diff null_resource.simple: null_resource.simple: @@ -17,7 +17,7 @@ workspace = default ``` --- -### 2. workspace: `staging` dir: `.` +### 2. dir: `.` workspace: `staging`
Show Output ```diff diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt index 1738f6f594..0bb8ea3c5e 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for dir: `.` workspace: `default` ```diff null_resource.simple: diff --git a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt index e18fd05b4d..6724319de6 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `staging` +Ran Apply for dir: `.` workspace: `staging`
Show Output 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 99e843eb4c..f19ef044ce 100644 --- a/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt @@ -1,8 +1,8 @@ Ran Plan for 2 projects: -1. workspace: `default` dir: `.` -1. workspace: `staging` dir: `.` +1. dir: `.` workspace: `default` +1. dir: `.` workspace: `staging` -### 1. workspace: `default` dir: `.` +### 1. dir: `.` workspace: `default`
Show Output ```diff @@ -31,7 +31,7 @@ postplan
--- -### 2. workspace: `staging` dir: `.` +### 2. dir: `.` workspace: `staging` ```diff An execution plan has been generated and is shown below. 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 1a0ab13c93..c6432b58bd 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,8 +1,8 @@ Ran Apply for 2 projects: -1. workspace: `default` dir: `.` -1. workspace: `new_workspace` dir: `.` +1. dir: `.` workspace: `default` +1. dir: `.` workspace: `new_workspace` -### 1. workspace: `default` dir: `.` +### 1. dir: `.` workspace: `default`
Show Output ```diff @@ -24,7 +24,7 @@ workspace = default
--- -### 2. workspace: `new_workspace` dir: `.` +### 2. dir: `.` workspace: `new_workspace`
Show Output ```diff diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt index 5173c8dc93..826036aca5 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt index 83db19f6fa..e1048ce5ed 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `new_workspace` +Ran Apply for dir: `.` workspace: `new_workspace`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-apply-var.txt b/server/testfixtures/test-repos/simple/exp-output-apply-var.txt index fe0acaddd5..30752a67bc 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply-var.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply-var.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-apply.txt b/server/testfixtures/test-repos/simple/exp-output-apply.txt index 0efc493ee9..da5671e1c7 100644 --- a/server/testfixtures/test-repos/simple/exp-output-apply.txt +++ b/server/testfixtures/test-repos/simple/exp-output-apply.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt index 6392c9448d..85ed283bba 100644 --- a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt +++ b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `new_workspace` +Ran Plan for dir: `.` workspace: `new_workspace`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt index f7be31abd6..73862ca01c 100644 --- a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt +++ b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `default` +Ran Plan for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt index b5f1d96d31..29e86fb150 100644 --- a/server/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt +++ b/server/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `default` +Ran Plan for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/simple/exp-output-autoplan.txt b/server/testfixtures/test-repos/simple/exp-output-autoplan.txt index ac179bd9ea..f44ade708a 100644 --- a/server/testfixtures/test-repos/simple/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/simple/exp-output-autoplan.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `default` +Ran Plan for dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt index 2f1c7775d3..d6a7f5e258 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for project: `default` dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt index b5cf2a93b4..77dfb0b020 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for project: `staging` dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt index 42153cc17d..f308a1aa11 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `default` +Ran Plan for project: `default` dir: `.` workspace: `default` ```diff diff --git a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt index 7ec4dc94f5..b50326c4aa 100644 --- a/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt +++ b/server/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt @@ -1,4 +1,4 @@ -Ran Plan in dir: `.` workspace: `default` +Ran Plan for project: `staging` dir: `.` workspace: `default` ```diff diff --git a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt index 2f1c7775d3..d6a7f5e258 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for project: `default` dir: `.` workspace: `default`
Show Output diff --git a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt index b5cf2a93b4..77dfb0b020 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt @@ -1,4 +1,4 @@ -Ran Apply in dir: `.` workspace: `default` +Ran Apply for project: `staging` dir: `.` workspace: `default`
Show Output 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 f8492d5ba4..2faecf2963 100644 --- a/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt +++ b/server/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt @@ -1,8 +1,8 @@ Ran Plan for 2 projects: -1. workspace: `default` dir: `.` -1. workspace: `default` dir: `.` +1. project: `default` dir: `.` workspace: `default` +1. project: `staging` dir: `.` workspace: `default` -### 1. workspace: `default` dir: `.` +### 1. project: `default` dir: `.` workspace: `default` ```diff An execution plan has been generated and is shown below. @@ -26,7 +26,7 @@ workspace=default * `atlantis plan -p default` --- -### 2. workspace: `default` dir: `.` +### 2. project: `staging` dir: `.` workspace: `default` ```diff An execution plan has been generated and is shown below.