From 004074a29f4cf18e16cbdb93cf98dc06b4d80a3c Mon Sep 17 00:00:00 2001
From: Aayush Gupta <43479002+Aayyush@users.noreply.github.com>
Date: Thu, 30 Dec 2021 06:52:52 -0800
Subject: [PATCH] feat: streaming terraform logs in real-time (#1937)
---
go.mod | 2 +-
runatlantis.io/docs/custom-workflows.md | 18 +-
.../events/events_controller_e2e_test.go | 14 +-
.../automerge/exp-output-apply-dir1.txt | 1 +
.../automerge/exp-output-apply-dir1.txt.act | 10 -
.../automerge/exp-output-apply-dir2.txt | 1 +
.../automerge/exp-output-apply-dir2.txt.act | 10 -
.../automerge/exp-output-autoplan.txt | 2 +
.../automerge/exp-output-autoplan.txt.act | 67 ----
.../exp-output-apply-production.txt.act | 14 -
.../exp-output-apply-staging.txt.act | 14 -
.../modules-yaml/exp-output-autoplan.txt.act | 73 ----
.../exp-output-apply-production.txt.act | 14 -
.../modules/exp-output-apply-staging.txt.act | 14 -
.../exp-output-autoplan-only-staging.txt.act | 37 --
.../exp-output-plan-production.txt.act | 37 --
.../modules/exp-output-plan-staging.txt.act | 37 --
...exp-output-apply-default-workspace.txt.act | 14 -
...exp-output-apply-staging-workspace.txt.act | 14 -
.../exp-output-autoplan.txt.act | 79 -----
.../simple-yaml/exp-output-apply-all.txt.act | 43 ---
.../exp-output-apply-default.txt.act | 15 -
.../exp-output-apply-staging.txt.act | 22 --
.../simple-yaml/exp-output-autoplan.txt.act | 79 -----
.../simple/exp-output-apply-var-all.txt.act | 50 ---
...output-apply-var-default-workspace.txt.act | 22 --
...exp-output-apply-var-new-workspace.txt.act | 22 --
.../simple/exp-output-apply-var.txt.act | 22 --
.../simple/exp-output-apply.txt.act | 22 --
...output-atlantis-plan-new-workspace.txt.act | 48 ---
...utput-atlantis-plan-var-overridden.txt.act | 48 ---
.../simple/exp-output-atlantis-plan.txt.act | 48 ---
.../simple/exp-output-autoplan.txt.act | 48 ---
.../exp-output-apply-default.txt.act | 15 -
.../exp-output-apply-staging.txt.act | 15 -
.../exp-output-plan-default.txt.act | 38 --
.../exp-output-plan-staging.txt.act | 38 --
.../exp-output-apply-default.txt.act | 15 -
.../exp-output-apply-staging.txt.act | 15 -
.../tfvars-yaml/exp-output-autoplan.txt.act | 77 -----
.../exp-output-apply-all-production.txt.act | 34 --
.../exp-output-apply-all-staging.txt.act | 34 --
.../exp-output-autoplan-production.txt.act | 73 ----
.../exp-output-autoplan-staging.txt.act | 73 ----
server/controllers/jobs_controller.go | 144 ++++++++
server/controllers/templates/web_templates.go | 162 +++++++++
server/controllers/websocket/mux.go | 63 ++++
server/controllers/websocket/writer.go | 68 ++++
server/core/runtime/apply_step_runner.go | 15 +-
server/core/runtime/apply_step_runner_test.go | 78 +++--
server/core/runtime/init_step_runner.go | 4 +-
server/core/runtime/init_step_runner_test.go | 117 ++++---
server/core/runtime/plan_step_runner.go | 14 +-
server/core/runtime/plan_step_runner_test.go | 257 +++++++-------
server/core/runtime/runtime.go | 4 +-
server/core/runtime/show_step_runner.go | 4 +-
server/core/runtime/show_step_runner_test.go | 11 +-
server/core/runtime/version_step_runner.go | 2 +-
.../core/runtime/version_step_runner_test.go | 2 +-
.../terraform/mocks/mock_terraform_client.go | 25 +-
server/core/terraform/terraform_client.go | 93 +++--
.../terraform_client_internal_test.go | 165 ++++++++-
.../core/terraform/terraform_client_test.go | 75 +++-
server/events/command_runner_test.go | 1 -
server/events/commit_status_updater.go | 25 +-
.../mocks/mock_log_stream_url_generator.go | 109 ++++++
server/events/models/fixtures/fixtures.go | 15 +-
server/events/models/models.go | 26 ++
server/events/project_command_runner.go | 52 +++
server/events/project_command_runner_test.go | 159 ++++++++-
server/events/pull_closed_executor.go | 37 +-
server/events/pull_closed_executor_test.go | 127 ++++++-
server/events/terraform/ansi/strip.go | 13 +
.../handlers/mocks/matchers/chan_of_string.go | 31 ++
server/handlers/mocks/matchers/http_header.go | 33 ++
.../mocks/matchers/http_responsewriter.go | 33 ++
.../matchers/map_of_chan_of_string_to_bool.go | 31 ++
.../mocks/matchers/models_commandname.go | 33 ++
.../mocks/matchers/models_commitstatus.go | 33 ++
.../matchers/models_projectcommandcontext.go | 33 ++
.../mocks/matchers/ptr_to_http_request.go | 33 ++
.../handlers/mocks/matchers/slice_of_byte.go | 31 ++
.../mocks/matchers/slice_of_string.go | 31 ++
.../mock_project_command_output_handler.go | 325 ++++++++++++++++++
.../mocks/mock_project_job_url_generator.go | 109 ++++++
.../mocks/mock_project_status_updater.go | 117 +++++++
.../handlers/mocks/mock_resource_cleaner.go | 97 ++++++
.../project_command_output_handler.go | 232 +++++++++++++
.../project_command_output_handler_test.go | 216 ++++++++++++
server/handlers/websocket_handler.go | 61 ++++
server/middleware.go | 44 +--
server/router.go | 22 ++
server/router_test.go | 55 +++
server/server.go | 119 +++++--
94 files changed, 3197 insertions(+), 1777 deletions(-)
delete mode 100644 server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-production.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-production.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-default-workspace.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-staging-workspace.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-all.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-apply.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/simple/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-production.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-staging.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt.act
delete mode 100644 server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt.act
create mode 100644 server/controllers/jobs_controller.go
create mode 100644 server/controllers/websocket/mux.go
create mode 100644 server/controllers/websocket/writer.go
create mode 100644 server/events/mocks/mock_log_stream_url_generator.go
create mode 100644 server/events/terraform/ansi/strip.go
create mode 100644 server/handlers/mocks/matchers/chan_of_string.go
create mode 100644 server/handlers/mocks/matchers/http_header.go
create mode 100644 server/handlers/mocks/matchers/http_responsewriter.go
create mode 100644 server/handlers/mocks/matchers/map_of_chan_of_string_to_bool.go
create mode 100644 server/handlers/mocks/matchers/models_commandname.go
create mode 100644 server/handlers/mocks/matchers/models_commitstatus.go
create mode 100644 server/handlers/mocks/matchers/models_projectcommandcontext.go
create mode 100644 server/handlers/mocks/matchers/ptr_to_http_request.go
create mode 100644 server/handlers/mocks/matchers/slice_of_byte.go
create mode 100644 server/handlers/mocks/matchers/slice_of_string.go
create mode 100644 server/handlers/mocks/mock_project_command_output_handler.go
create mode 100644 server/handlers/mocks/mock_project_job_url_generator.go
create mode 100644 server/handlers/mocks/mock_project_status_updater.go
create mode 100644 server/handlers/mocks/mock_resource_cleaner.go
create mode 100644 server/handlers/project_command_output_handler.go
create mode 100644 server/handlers/project_command_output_handler_test.go
create mode 100644 server/handlers/websocket_handler.go
diff --git a/go.mod b/go.mod
index fb39557e2d..c67cda8439 100644
--- a/go.mod
+++ b/go.mod
@@ -39,7 +39,7 @@ require (
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/mux v1.8.0
- github.com/gorilla/websocket v1.4.2 // indirect
+ github.com/gorilla/websocket v1.4.2
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-getter v1.5.10
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
diff --git a/runatlantis.io/docs/custom-workflows.md b/runatlantis.io/docs/custom-workflows.md
index a8e34bcb5a..2253e221e2 100644
--- a/runatlantis.io/docs/custom-workflows.md
+++ b/runatlantis.io/docs/custom-workflows.md
@@ -128,19 +128,19 @@ workflows:
myworkflow:
plan:
steps:
- - run: terraform init -input=false -no-color
+ - run: terraform init -input=false
# If you're using workspaces you need to select the workspace using the
# $WORKSPACE environment variable.
- - run: terraform workspace select -no-color $WORKSPACE
+ - run: terraform workspace select $WORKSPACE
# You MUST output the plan using -out $PLANFILE because Atlantis expects
# plans to be in a specific location.
- - run: terraform plan -input=false -refresh -no-color -out $PLANFILE
+ - run: terraform plan -input=false -refresh -out $PLANFILE
apply:
steps:
# Again, you must use the $PLANFILE environment variable.
- - run: terraform apply -no-color $PLANFILE
+ - run: terraform apply $PLANFILE
```
### Terragrunt
@@ -176,14 +176,14 @@ workflows:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- - run: terragrunt plan -no-color -out=$PLANFILE
- - run: terragrunt show -no-color -json $PLANFILE > $SHOWFILE
+ - run: terragrunt plan -out=$PLANFILE
+ - run: terragrunt show -json $PLANFILE > $SHOWFILE
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- - run: terragrunt apply -no-color $PLANFILE
+ - run: terragrunt apply $PLANFILE
```
If using the repo's `atlantis.yaml` file you would use the following config:
@@ -201,13 +201,13 @@ workflows:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- - run: terragrunt plan -no-color -out $PLANFILE
+ - run: terragrunt plan -out $PLANFILE
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- - run: terragrunt apply -no-color $PLANFILE
+ - run: terragrunt apply $PLANFILE
```
**NOTE:** If using the repo's `atlantis.yaml` file, you will need to specify each directory that is a Terragrunt project.
diff --git a/server/controllers/events/events_controller_e2e_test.go b/server/controllers/events/events_controller_e2e_test.go
index 8c125bdd77..3496d86642 100644
--- a/server/controllers/events/events_controller_e2e_test.go
+++ b/server/controllers/events/events_controller_e2e_test.go
@@ -34,6 +34,7 @@ import (
"github.com/runatlantis/atlantis/server/events/webhooks"
"github.com/runatlantis/atlantis/server/events/yaml"
"github.com/runatlantis/atlantis/server/events/yaml/valid"
+ handlermocks "github.com/runatlantis/atlantis/server/handlers/mocks"
"github.com/runatlantis/atlantis/server/logging"
. "github.com/runatlantis/atlantis/testing"
)
@@ -816,6 +817,7 @@ func setupE2E(t *testing.T, repoDir string) (events_controllers.VCSEventsControl
e2eStatusUpdater := &events.DefaultCommitStatusUpdater{Client: e2eVCSClient, TitleBuilder: vcs.StatusTitleBuilder{TitlePrefix: "atlantis"}}
e2eGithubGetter := mocks.NewMockGithubPullGetter()
e2eGitlabGetter := mocks.NewMockGitlabMergeRequestGetter()
+ projectCmdOutputHandler := handlermocks.NewMockProjectCommandOutputHandler()
// Real dependencies.
logger := logging.NewNoopLogger(t)
@@ -830,7 +832,7 @@ func setupE2E(t *testing.T, repoDir string) (events_controllers.VCSEventsControl
GithubUser: "github-user",
GitlabUser: "gitlab-user",
}
- terraformClient, err := terraform.NewClient(logger, binDir, cacheDir, "", "", "", "default-tf-version", "https://releases.hashicorp.com", &NoopTFDownloader{}, false)
+ terraformClient, err := terraform.NewClient(logger, binDir, cacheDir, "", "", "", "default-tf-version", "https://releases.hashicorp.com", &NoopTFDownloader{}, false, projectCmdOutputHandler)
Ok(t, err)
boltdb, err := db.New(dataDir)
Ok(t, err)
@@ -1057,10 +1059,12 @@ func setupE2E(t *testing.T, repoDir string) (events_controllers.VCSEventsControl
TestingMode: true,
CommandRunner: commandRunner,
PullCleaner: &events.PullClosedExecutor{
- Locker: lockingClient,
- VCSClient: e2eVCSClient,
- WorkingDir: workingDir,
- DB: boltdb,
+ Locker: lockingClient,
+ VCSClient: e2eVCSClient,
+ WorkingDir: workingDir,
+ DB: boltdb,
+ PullClosedTemplate: &events.PullClosedEventTemplate{},
+ LogStreamResourceCleaner: projectCmdOutputHandler,
},
Logger: logger,
Parser: eventParser,
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt
index 19bf762f1b..8c358550ec 100644
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt
+++ b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt
@@ -6,5 +6,6 @@ null_resource.automerge[0]: Creation complete after *s [id=*******************]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
+
```
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt.act b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt.act
deleted file mode 100644
index 19bf762f1b..0000000000
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir1.txt.act
+++ /dev/null
@@ -1,10 +0,0 @@
-Ran Apply for dir: `dir1` workspace: `default`
-
-```diff
-null_resource.automerge[0]: Creating...
-null_resource.automerge[0]: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt
index f486966159..c4f1a9ec09 100644
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt
+++ b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt
@@ -6,5 +6,6 @@ null_resource.automerge[0]: Creation complete after *s [id=*******************]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
+
```
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt.act b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt.act
deleted file mode 100644
index f486966159..0000000000
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-apply-dir2.txt.act
+++ /dev/null
@@ -1,10 +0,0 @@
-Ran Apply for dir: `dir2` workspace: `default`
-
-```diff
-null_resource.automerge[0]: Creating...
-null_resource.automerge[0]: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt
index 8aa62370f3..5a232aa80f 100644
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt
+++ b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt
@@ -21,6 +21,7 @@ Terraform will perform the following actions:
Plan: 1 to add, 0 to change, 0 to destroy.
+
```
* :arrow_forward: To **apply** this plan, comment:
@@ -50,6 +51,7 @@ Terraform will perform the following actions:
Plan: 1 to add, 0 to change, 0 to destroy.
+
```
* :arrow_forward: To **apply** this plan, comment:
diff --git a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt.act
deleted file mode 100644
index 8aa62370f3..0000000000
--- a/server/controllers/events/testfixtures/test-repos/automerge/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,67 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `dir1` workspace: `default`
-1. dir: `dir2` workspace: `default`
-
-### 1. dir: `dir1` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.automerge[0] will be created
-+ resource "null_resource" "automerge" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir1`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir1`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `dir2` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.automerge[0] will be created
-+ resource "null_resource" "automerge" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d dir2`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d dir2`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt.act b/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt.act
deleted file mode 100644
index 4885579d1e..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-production.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `production` workspace: `default`
-
-```diff
-module.null.null_resource.this: Creating...
-module.null.null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "production"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt.act b/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt.act
deleted file mode 100644
index 44d7f37145..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-apply-staging.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `staging` workspace: `default`
-
-```diff
-module.null.null_resource.this: Creating...
-module.null.null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "staging"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt.act
deleted file mode 100644
index 6b1c2e2433..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules-yaml/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,73 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `staging` workspace: `default`
-1. dir: `production` workspace: `default`
-
-### 1. dir: `staging` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # module.null.null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `production` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # module.null.null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "production"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-production.txt.act b/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-production.txt.act
deleted file mode 100644
index 4885579d1e..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-production.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `production` workspace: `default`
-
-```diff
-module.null.null_resource.this: Creating...
-module.null.null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "production"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-staging.txt.act b/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-staging.txt.act
deleted file mode 100644
index 44d7f37145..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules/exp-output-apply-staging.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `staging` workspace: `default`
-
-```diff
-module.null.null_resource.this: Creating...
-module.null.null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "staging"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt.act b/server/controllers/events/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt.act
deleted file mode 100644
index 50f8aca13c..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules/exp-output-autoplan-only-staging.txt.act
+++ /dev/null
@@ -1,37 +0,0 @@
-Ran Plan for dir: `staging` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # module.null.null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-production.txt.act b/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-production.txt.act
deleted file mode 100644
index e238d50a49..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-production.txt.act
+++ /dev/null
@@ -1,37 +0,0 @@
-Ran Plan for dir: `production` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # module.null.null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "production"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-staging.txt.act b/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-staging.txt.act
deleted file mode 100644
index 50f8aca13c..0000000000
--- a/server/controllers/events/testfixtures/test-repos/modules/exp-output-plan-staging.txt.act
+++ /dev/null
@@ -1,37 +0,0 @@
-Ran Plan for dir: `staging` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # module.null.null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-default-workspace.txt.act b/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-default-workspace.txt.act
deleted file mode 100644
index 336a849553..0000000000
--- a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-default-workspace.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-staging-workspace.txt.act b/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-staging-workspace.txt.act
deleted file mode 100644
index b36f8209c8..0000000000
--- a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-apply-staging-workspace.txt.act
+++ /dev/null
@@ -1,14 +0,0 @@
-Ran Apply for dir: `.` workspace: `staging`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "staging"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt.act
deleted file mode 100644
index 25eddec36e..0000000000
--- a/server/controllers/events/testfixtures/test-repos/server-side-cfg/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,79 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `.` workspace: `default`
-1. dir: `.` workspace: `staging`
-
-### 1. dir: `.` workspace: `default`
-Show Output
-
-```diff
-preinit custom
-
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "default"
-
-postplan custom
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `.` workspace: `staging`
-Show Output
-
-```diff
-preinit staging
-
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt.act b/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt.act
deleted file mode 100644
index 04b926ff5e..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-all.txt.act
+++ /dev/null
@@ -1,43 +0,0 @@
-Ran Apply for 2 projects:
-
-1. dir: `.` workspace: `default`
-1. dir: `.` workspace: `staging`
-
-### 1. dir: `.` workspace: `default`
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "fromconfig"
-workspace = "default"
-
-```
-
----
-### 2. dir: `.` workspace: `staging`
-Show Output
-
-```diff
-preapply
-
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "fromfile"
-workspace = "staging"
-
-postapply
-
-```
-
-
----
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt.act b/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt.act
deleted file mode 100644
index 5e3d22778b..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-default.txt.act
+++ /dev/null
@@ -1,15 +0,0 @@
-Ran Apply for dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "fromconfig"
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt.act b/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt.act
deleted file mode 100644
index 88f2698f0b..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-apply-staging.txt.act
+++ /dev/null
@@ -1,22 +0,0 @@
-Ran Apply for dir: `.` workspace: `staging`
-
-Show Output
-
-```diff
-preapply
-
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "fromfile"
-workspace = "staging"
-
-postapply
-
-```
-
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt.act
deleted file mode 100644
index 5145516ef5..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple-yaml/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,79 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `.` workspace: `default`
-1. dir: `.` workspace: `staging`
-
-### 1. dir: `.` workspace: `default`
-Show Output
-
-```diff
-preinit
-
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "fromconfig"
-+ workspace = "default"
-
-postplan
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `.` workspace: `staging`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "fromfile"
-+ workspace = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-all.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-all.txt.act
deleted file mode 100644
index 11f65032da..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-all.txt.act
+++ /dev/null
@@ -1,50 +0,0 @@
-Ran Apply for 2 projects:
-
-1. dir: `.` workspace: `default`
-1. dir: `.` workspace: `new_workspace`
-
-### 1. dir: `.` workspace: `default`
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "default_workspace"
-workspace = "default"
-
-```
-
-
----
-### 2. dir: `.` workspace: `new_workspace`
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "new_workspace"
-workspace = "new_workspace"
-
-```
-
-
----
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt.act
deleted file mode 100644
index cfa21dde33..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-default-workspace.txt.act
+++ /dev/null
@@ -1,22 +0,0 @@
-Ran Apply for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "default_workspace"
-workspace = "default"
-
-```
-
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt.act
deleted file mode 100644
index 8c1a0bac5e..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var-new-workspace.txt.act
+++ /dev/null
@@ -1,22 +0,0 @@
-Ran Apply for dir: `.` workspace: `new_workspace`
-
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "new_workspace"
-workspace = "new_workspace"
-
-```
-
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var.txt.act
deleted file mode 100644
index 59aff5f18c..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply-var.txt.act
+++ /dev/null
@@ -1,22 +0,0 @@
-Ran Apply for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "overridden"
-workspace = "default"
-
-```
-
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply.txt.act
deleted file mode 100644
index 98ffd366e1..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-apply.txt.act
+++ /dev/null
@@ -1,22 +0,0 @@
-Ran Apply for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "default"
-workspace = "default"
-
-```
-
-
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt.act
deleted file mode 100644
index b725eb1bf6..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-new-workspace.txt.act
+++ /dev/null
@@ -1,48 +0,0 @@
-Ran Plan for dir: `.` workspace: `new_workspace`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
- # null_resource.simple2 will be created
-+ resource "null_resource" "simple2" {
- + id = (known after apply)
- }
-
- # null_resource.simple3 will be created
-+ resource "null_resource" "simple3" {
- + id = (known after apply)
- }
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "new_workspace"
-+ workspace = "new_workspace"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -w new_workspace`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -w new_workspace -- -var var=new_workspace`
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt.act
deleted file mode 100644
index bc608ceb14..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan-var-overridden.txt.act
+++ /dev/null
@@ -1,48 +0,0 @@
-Ran Plan for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
- # null_resource.simple2 will be created
-+ resource "null_resource" "simple2" {
- + id = (known after apply)
- }
-
- # null_resource.simple3 will be created
-+ resource "null_resource" "simple3" {
- + id = (known after apply)
- }
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "overridden"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=overridden`
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt.act
deleted file mode 100644
index c56cd47e14..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-atlantis-plan.txt.act
+++ /dev/null
@@ -1,48 +0,0 @@
-Ran Plan for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
- # null_resource.simple2 will be created
-+ resource "null_resource" "simple2" {
- + id = (known after apply)
- }
-
- # null_resource.simple3 will be created
-+ resource "null_resource" "simple3" {
- + id = (known after apply)
- }
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "default_workspace"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d . -- -var var=default_workspace`
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/simple/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/simple/exp-output-autoplan.txt.act
deleted file mode 100644
index b301024b0c..0000000000
--- a/server/controllers/events/testfixtures/test-repos/simple/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,48 +0,0 @@
-Ran Plan for dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
- # null_resource.simple2 will be created
-+ resource "null_resource" "simple2" {
- + id = (known after apply)
- }
-
- # null_resource.simple3 will be created
-+ resource "null_resource" "simple3" {
- + id = (known after apply)
- }
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "default"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d .`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d .`
-
-Plan: 3 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt.act
deleted file mode 100644
index ccc0bfe017..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-default.txt.act
+++ /dev/null
@@ -1,15 +0,0 @@
-Ran Apply for project: `default` dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "default"
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt.act
deleted file mode 100644
index 6d217cc7fd..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-apply-staging.txt.act
+++ /dev/null
@@ -1,15 +0,0 @@
-Ran Apply for project: `staging` dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "staging"
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt.act
deleted file mode 100644
index c97767f650..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-default.txt.act
+++ /dev/null
@@ -1,38 +0,0 @@
-Ran Plan for project: `default` dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "default"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p default`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p default`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt.act
deleted file mode 100644
index 1c367d94bc..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml-no-autoplan/exp-output-plan-staging.txt.act
+++ /dev/null
@@ -1,38 +0,0 @@
-Ran Plan for project: `staging` dir: `.` workspace: `default`
-
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "staging"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt.act
deleted file mode 100644
index ccc0bfe017..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-default.txt.act
+++ /dev/null
@@ -1,15 +0,0 @@
-Ran Apply for project: `default` dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "default"
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt.act
deleted file mode 100644
index 6d217cc7fd..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-apply-staging.txt.act
+++ /dev/null
@@ -1,15 +0,0 @@
-Ran Apply for project: `staging` dir: `.` workspace: `default`
-
-```diff
-null_resource.simple:
-null_resource.simple:
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-var = "staging"
-workspace = "default"
-
-```
-
diff --git a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt.act b/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt.act
deleted file mode 100644
index 73619713ad..0000000000
--- a/server/controllers/events/testfixtures/test-repos/tfvars-yaml/exp-output-autoplan.txt.act
+++ /dev/null
@@ -1,77 +0,0 @@
-Ran Plan for 2 projects:
-
-1. project: `default` dir: `.` workspace: `default`
-1. project: `staging` dir: `.` workspace: `default`
-
-### 1. project: `default` dir: `.` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "default"
-+ workspace = "default"
-
-workspace=default
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p default`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p default`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. project: `staging` dir: `.` workspace: `default`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.simple[0] will be created
-+ resource "null_resource" "simple" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ var = "staging"
-+ workspace = "default"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -p staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -p staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-production.txt.act b/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-production.txt.act
deleted file mode 100644
index b82518ed6b..0000000000
--- a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-production.txt.act
+++ /dev/null
@@ -1,34 +0,0 @@
-Ran Apply for 2 projects:
-
-1. dir: `production` workspace: `production`
-1. dir: `staging` workspace: `staging`
-
-### 1. dir: `production` workspace: `production`
-```diff
-null_resource.this: Creating...
-null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "production"
-
-```
-
----
-### 2. dir: `staging` workspace: `staging`
-```diff
-null_resource.this: Creating...
-null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "staging"
-
-```
-
----
-
diff --git a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-staging.txt.act b/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-staging.txt.act
deleted file mode 100644
index b82518ed6b..0000000000
--- a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-apply-all-staging.txt.act
+++ /dev/null
@@ -1,34 +0,0 @@
-Ran Apply for 2 projects:
-
-1. dir: `production` workspace: `production`
-1. dir: `staging` workspace: `staging`
-
-### 1. dir: `production` workspace: `production`
-```diff
-null_resource.this: Creating...
-null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "production"
-
-```
-
----
-### 2. dir: `staging` workspace: `staging`
-```diff
-null_resource.this: Creating...
-null_resource.this: Creation complete after *s [id=*******************]
-
-Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
-
-Outputs:
-
-workspace = "staging"
-
-```
-
----
-
diff --git a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt.act b/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt.act
deleted file mode 100644
index a8f4b695a0..0000000000
--- a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-production.txt.act
+++ /dev/null
@@ -1,73 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `production` workspace: `production`
-1. dir: `staging` workspace: `staging`
-
-### 1. dir: `production` workspace: `production`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "production"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production -w production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production -w production`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `staging` workspace: `staging`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging -w staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt.act b/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt.act
deleted file mode 100644
index a8f4b695a0..0000000000
--- a/server/controllers/events/testfixtures/test-repos/workspace-parallel-yaml/exp-output-autoplan-staging.txt.act
+++ /dev/null
@@ -1,73 +0,0 @@
-Ran Plan for 2 projects:
-
-1. dir: `production` workspace: `production`
-1. dir: `staging` workspace: `staging`
-
-### 1. dir: `production` workspace: `production`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "production"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d production -w production`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d production -w production`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-### 2. dir: `staging` workspace: `staging`
-Show Output
-
-```diff
-
-Terraform used the selected providers to generate the following execution
-plan. Resource actions are indicated with the following symbols:
-+ create
-
-Terraform will perform the following actions:
-
- # null_resource.this will be created
-+ resource "null_resource" "this" {
- + id = (known after apply)
- }
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
-Changes to Outputs:
-+ workspace = "staging"
-
-```
-
-* :arrow_forward: To **apply** this plan, comment:
- * `atlantis apply -d staging -w staging`
-* :put_litter_in_its_place: To **delete** this plan click [here](lock-url)
-* :repeat: To **plan** this project again, comment:
- * `atlantis plan -d staging -w staging`
-
-Plan: 1 to add, 0 to change, 0 to destroy.
-
----
-* :fast_forward: To **apply** all unapplied plans from this pull request, comment:
- * `atlantis apply`
-* :put_litter_in_its_place: To delete all plans and locks for the PR, comment:
- * `atlantis unlock`
diff --git a/server/controllers/jobs_controller.go b/server/controllers/jobs_controller.go
new file mode 100644
index 0000000000..872176c66d
--- /dev/null
+++ b/server/controllers/jobs_controller.go
@@ -0,0 +1,144 @@
+package controllers
+
+import (
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "strconv"
+
+ "github.com/gorilla/mux"
+ "github.com/pkg/errors"
+ "github.com/runatlantis/atlantis/server/controllers/templates"
+ "github.com/runatlantis/atlantis/server/controllers/websocket"
+ "github.com/runatlantis/atlantis/server/core/db"
+ "github.com/runatlantis/atlantis/server/events/models"
+ "github.com/runatlantis/atlantis/server/logging"
+)
+
+type JobsController struct {
+ AtlantisVersion string
+ AtlantisURL *url.URL
+ Logger logging.SimpleLogging
+ ProjectJobsTemplate templates.TemplateWriter
+ ProjectJobsErrorTemplate templates.TemplateWriter
+ Db *db.BoltDB
+ WsMux *websocket.Multiplexor
+}
+
+type ProjectInfoKeyGenerator struct{}
+
+func (g ProjectInfoKeyGenerator) Generate(r *http.Request) (string, error) {
+ projectInfo, err := newProjectInfo(r)
+
+ if err != nil {
+ return "", errors.Wrap(err, "creating project info")
+ }
+
+ return projectInfo.String(), nil
+}
+
+type pullInfo struct {
+ org string
+ repo string
+ pull int
+}
+
+func (p *pullInfo) String() string {
+ return fmt.Sprintf("%s/%s/%d", p.org, p.repo, p.pull)
+}
+
+type projectInfo struct {
+ projectName string
+ workspace string
+ pullInfo
+}
+
+func (p *projectInfo) String() string {
+ return fmt.Sprintf("%s/%s/%d/%s/%s", p.org, p.repo, p.pull, p.projectName, p.workspace)
+}
+
+func newPullInfo(r *http.Request) (*pullInfo, error) {
+ org, ok := mux.Vars(r)["org"]
+ if !ok {
+ return nil, fmt.Errorf("Internal error: no org in route")
+ }
+ repo, ok := mux.Vars(r)["repo"]
+ if !ok {
+ return nil, fmt.Errorf("Internal error: no repo in route")
+ }
+ pull, ok := mux.Vars(r)["pull"]
+ if !ok {
+ return nil, fmt.Errorf("Internal error: no pull in route")
+ }
+ pullNum, err := strconv.Atoi(pull)
+ if err != nil {
+ return nil, err
+ }
+
+ return &pullInfo{
+ org: org,
+ repo: repo,
+ pull: pullNum,
+ }, nil
+}
+
+// Gets the PR information from the HTTP request params
+func newProjectInfo(r *http.Request) (*projectInfo, error) {
+ pullInfo, err := newPullInfo(r)
+ if err != nil {
+ return nil, err
+ }
+
+ project, ok := mux.Vars(r)["project"]
+ if !ok {
+ return nil, fmt.Errorf("Internal error: no project in route")
+ }
+
+ workspace, ok := mux.Vars(r)["workspace"]
+ if !ok {
+ return nil, fmt.Errorf("Internal error: no workspace in route")
+ }
+
+ return &projectInfo{
+ pullInfo: *pullInfo,
+ projectName: project,
+ workspace: workspace,
+ }, nil
+}
+
+func (j *JobsController) GetProjectJobs(w http.ResponseWriter, r *http.Request) {
+ projectInfo, err := newProjectInfo(r)
+ if err != nil {
+ j.respond(w, logging.Error, http.StatusInternalServerError, err.Error())
+ return
+ }
+
+ viewData := templates.ProjectJobData{
+ AtlantisVersion: j.AtlantisVersion,
+ ProjectPath: projectInfo.String(),
+ CleanedBasePath: j.AtlantisURL.Path,
+ ClearMsg: models.LogStreamingClearMsg,
+ }
+
+ err = j.ProjectJobsTemplate.Execute(w, viewData)
+ if err != nil {
+ j.Logger.Err(err.Error())
+ }
+}
+
+func (j *JobsController) GetProjectJobsWS(w http.ResponseWriter, r *http.Request) {
+ err := j.WsMux.Handle(w, r)
+
+ if err != nil {
+ j.respond(w, logging.Error, http.StatusInternalServerError, err.Error())
+ return
+ }
+}
+
+func (j *JobsController) respond(w http.ResponseWriter, lvl logging.LogLevel, responseCode int, format string, args ...interface{}) {
+ response := fmt.Sprintf(format, args...)
+ j.Logger.Log(lvl, response)
+ w.WriteHeader(responseCode)
+ fmt.Fprintln(w, response)
+}
diff --git a/server/controllers/templates/web_templates.go b/server/controllers/templates/web_templates.go
index 4c120d4558..db1cd5cd96 100644
--- a/server/controllers/templates/web_templates.go
+++ b/server/controllers/templates/web_templates.go
@@ -352,6 +352,168 @@ v{{ .AtlantisVersion }}