From fa88f07f5e6f7f45969606e8d0cf0bed84deac05 Mon Sep 17 00:00:00 2001 From: Tiffany Chiang Date: Mon, 2 Dec 2024 11:34:13 -0500 Subject: [PATCH] run linter --- cmd/server_test.go | 3 +- server/config/parser_validator_test.go | 3 +- .../controllers/events/events_controller.go | 3 +- .../events/events_controller_e2e_test.go | 16 +++--- .../events/handlers/pull_request.go | 3 +- .../controllers/github_app_controller.go | 3 +- server/legacy/controllers/locks_controller.go | 3 +- .../controllers/locks_controller_test.go | 8 ++- .../controllers/websocket/instrumented_mux.go | 3 +- server/legacy/core/db/boltdb_test.go | 3 +- server/legacy/core/locking/locking_test.go | 3 +- .../legacy/core/runtime/apply_step_runner.go | 3 +- .../core/runtime/apply_step_runner_test.go | 1 - .../core/runtime/env_step_runner_test.go | 3 +- .../core/runtime/init_step_runner_test.go | 1 - .../core/runtime/plan_step_runner_test.go | 6 +-- .../plan_type_step_runner_delegate_test.go | 3 +- .../core/runtime/policy/conftest_executor.go | 9 ++-- .../runtime/policy_check_step_runner_test.go | 3 +- .../core/terraform/async_client_test.go | 3 +- .../legacy/core/terraform/terraform_client.go | 1 - server/legacy/events/command_runner_test.go | 18 +++---- .../legacy/events/github_app_working_dir.go | 3 +- .../legacy/events/project_command_builder.go | 5 +- .../events/project_command_builder_test.go | 3 +- server/legacy/events/project_finder.go | 3 +- server/legacy/events/pull_closed_executor.go | 6 +-- .../events/pull_closed_executor_test.go | 17 +++---- .../legacy/events/vcs/common/common_test.go | 1 - server/legacy/events/vcs/github_client.go | 3 +- .../events/vcs/github_client_internal_test.go | 3 +- .../events/vcs/github_client_lyft_test.go | 3 +- .../legacy/events/vcs/github_client_test.go | 1 - server/legacy/events/webhooks/slack.go | 3 +- .../events/webhooks/slack_client_test.go | 3 +- server/legacy/events/webhooks/webhooks.go | 3 +- server/legacy/jobs/job_store.go | 3 +- server/legacy/jobs/job_store_test.go | 8 ++- .../jobs/project_command_output_handler.go | 3 +- .../project_command_output_handler_test.go | 7 +-- .../runtime/destroy_plan_step_runner_test.go | 4 +- .../audit_project_commands_wrapper_test.go | 3 +- .../legacy/lyft/gateway/events_controller.go | 9 ++-- server/legacy/server.go | 49 +++++++++---------- server/legacy/server_test.go | 3 +- server/models/models.go | 3 +- server/neptune/adhoc/server.go | 15 +++--- server/neptune/exec/exec_test.go | 3 +- server/neptune/gateway/api/deploy.go | 1 + .../config/root_config_builder_test.go | 5 +- server/neptune/gateway/deploy/deployer.go | 3 +- server/neptune/gateway/deploy/root_finder.go | 6 +-- .../gateway/deploy/root_finder_test.go | 5 +- .../gateway/event/check_run_handler.go | 7 ++- .../gateway/event/check_run_handler_test.go | 7 ++- .../event/modified_pull_request_handler.go | 10 ++-- .../event/pull_request_review_handler.go | 14 +++--- .../event/pull_request_review_handler_test.go | 5 +- .../gateway/event/push_event_handler.go | 3 +- server/neptune/lyft/activities/audit.go | 1 - server/neptune/lyft/activities/github.go | 3 +- server/neptune/lyft/feature/retriever.go | 1 + server/neptune/lyft/notifier/sns.go | 3 +- server/neptune/sync/crons/ratelimit_stats.go | 3 +- server/neptune/template/loader.go | 3 +- server/neptune/temporal/client.go | 3 +- server/neptune/temporal/propagator.go | 2 +- .../neptune/temporalworker/config/config.go | 1 - .../neptune/temporalworker/job/store_test.go | 3 +- server/neptune/temporalworker/server.go | 9 ++-- .../neptune/workflows/activities/conftest.go | 3 +- .../workflows/activities/conftest/summary.go | 3 +- .../activities/conftest/summary_test.go | 3 +- .../workflows/activities/conftest_test.go | 5 +- server/neptune/workflows/activities/github.go | 8 ++- .../activities/github/markdown/renderer.go | 4 +- .../workflows/activities/github/middleware.go | 5 +- server/neptune/workflows/activities/main.go | 3 +- .../activities/temporal/heartbeat.go | 3 +- .../neptune/workflows/activities/terraform.go | 8 ++- .../workflows/activities/terraform_test.go | 3 +- server/neptune/workflows/deploy_test.go | 5 +- .../deploy/revision/notifier/slack.go | 2 +- .../deploy/revision/notifier/slack_test.go | 2 +- .../deploy/revision/queue/deployer.go | 8 ++- .../deploy/revision/queue/deployer_test.go | 5 +- .../internal/deploy/revision/queue/queue.go | 2 +- .../deploy/revision/queue/queue_test.go | 2 +- .../internal/deploy/revision/queue/updater.go | 5 +- .../deploy/revision/queue/updater_test.go | 5 +- .../internal/deploy/revision/queue/worker.go | 11 ++--- .../revision/queue/worker_state_test.go | 9 ++-- .../deploy/revision/queue/worker_test.go | 2 +- .../internal/deploy/revision/revision.go | 8 ++- .../internal/deploy/revision/revision_test.go | 5 +- .../internal/deploy/terraform/deployment.go | 6 +-- .../internal/deploy/terraform/state.go | 2 +- .../internal/deploy/terraform/state_test.go | 3 +- .../workflows/internal/deploy/workflow.go | 2 +- .../workflows/internal/notifier/github.go | 1 + .../internal/notifier/github_cache_test.go | 2 +- .../internal/notifier/github_test.go | 2 +- .../internal/pr/revision/policy/dismisser.go | 3 +- .../pr/revision/policy/dismisser_test.go | 5 +- .../pr/revision/policy/filter_test.go | 3 +- .../pr/revision/policy/handler_test.go | 5 +- .../internal/pr/revision/processor_test.go | 5 +- .../workflows/internal/pr/revision/root.go | 5 +- .../workflows/internal/pr/revision/state.go | 1 + .../internal/pr/revision/state_test.go | 4 +- .../neptune/workflows/internal/pr/runner.go | 4 +- .../workflows/internal/pr/runner_test.go | 5 +- .../neptune/workflows/internal/pr/shutdown.go | 1 + .../workflows/internal/pr/shutdown_test.go | 5 +- .../neptune/workflows/internal/pr/workflow.go | 5 +- .../workflows/internal/temporal/selector.go | 3 +- .../internal/terraform/job/runner.go | 6 +-- .../internal/terraform/job/runner_test.go | 2 +- .../internal/terraform/state/store.go | 2 +- .../internal/terraform/state/workflow.go | 2 +- .../workflows/internal/terraform/workflow.go | 10 ++-- .../internal/terraform/workflow_test.go | 8 ++- server/vcs/markdown/markdown_renderer.go | 3 +- server/vcs/markdown/template_resolver.go | 6 +-- .../github/converter/comment_event.go | 3 +- .../github/converter/comment_event_test.go | 3 +- .../github/converter/pr_review_event_test.go | 3 +- .../provider/github/converter/pull_event.go | 3 +- .../github/converter/pull_event_test.go | 5 +- .../provider/github/converter/pull_test.go | 3 +- .../provider/github/git_cred_writer_test.go | 2 +- server/vcs/provider/github/list_iterator.go | 3 +- .../vcs/provider/github/list_iterator_test.go | 5 +- server/vcs/provider/github/pr_fetcher.go | 3 +- .../vcs/provider/github/repo_fetcher_test.go | 3 +- server/vcs/provider/github/request/handler.go | 12 ++--- .../vcs/provider/github/request/validator.go | 3 +- server/vcs/provider/github/team_fetcher.go | 1 + 138 files changed, 275 insertions(+), 374 deletions(-) diff --git a/cmd/server_test.go b/cmd/server_test.go index f26d1e151..fb863c9c3 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -21,14 +21,13 @@ import ( "strings" "testing" - "github.com/stretchr/testify/assert" - homedir "github.com/mitchellh/go-homedir" server "github.com/runatlantis/atlantis/server/legacy" "github.com/runatlantis/atlantis/server/legacy/events/vcs/fixtures" . "github.com/runatlantis/atlantis/testing" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/stretchr/testify/assert" "gopkg.in/yaml.v2" ) diff --git a/server/config/parser_validator_test.go b/server/config/parser_validator_test.go index bc17034a6..6a8be9ee1 100644 --- a/server/config/parser_validator_test.go +++ b/server/config/parser_validator_test.go @@ -7,10 +7,9 @@ import ( "strings" "testing" - "github.com/runatlantis/atlantis/server/config/raw" - "github.com/hashicorp/go-version" "github.com/runatlantis/atlantis/server/config" + "github.com/runatlantis/atlantis/server/config/raw" "github.com/runatlantis/atlantis/server/config/valid" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/controllers/events/events_controller.go b/server/legacy/controllers/events/events_controller.go index 1578226a1..234ab6a6a 100644 --- a/server/legacy/controllers/events/events_controller.go +++ b/server/legacy/controllers/events/events_controller.go @@ -18,12 +18,11 @@ import ( "fmt" "net/http" - httputils "github.com/runatlantis/atlantis/server/legacy/http" - requestErrors "github.com/runatlantis/atlantis/server/legacy/controllers/events/errors" "github.com/runatlantis/atlantis/server/legacy/controllers/events/handlers" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/vcs" + httputils "github.com/runatlantis/atlantis/server/legacy/http" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" key "github.com/runatlantis/atlantis/server/neptune/context" diff --git a/server/legacy/controllers/events/events_controller_e2e_test.go b/server/legacy/controllers/events/events_controller_e2e_test.go index c2c3db631..28e2da749 100644 --- a/server/legacy/controllers/events/events_controller_e2e_test.go +++ b/server/legacy/controllers/events/events_controller_e2e_test.go @@ -26,29 +26,27 @@ import ( "github.com/runatlantis/atlantis/server/legacy/core/locking" "github.com/runatlantis/atlantis/server/legacy/core/runtime" runtime_models "github.com/runatlantis/atlantis/server/legacy/core/runtime/models" - "github.com/runatlantis/atlantis/server/legacy/jobs" - lyftCommand "github.com/runatlantis/atlantis/server/legacy/lyft/command" - event_types "github.com/runatlantis/atlantis/server/neptune/gateway/event" - github_converter "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" - "github.com/runatlantis/atlantis/server/vcs/provider/github/request" - ffclient "github.com/thomaspoignant/go-feature-flag" - "github.com/runatlantis/atlantis/server/legacy/core/runtime/policy" "github.com/runatlantis/atlantis/server/legacy/core/terraform" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/command" - "github.com/runatlantis/atlantis/server/vcs/markdown" - "github.com/runatlantis/atlantis/server/legacy/events/vcs" lyft_vcs "github.com/runatlantis/atlantis/server/legacy/events/vcs/lyft" "github.com/runatlantis/atlantis/server/legacy/events/vcs/types" "github.com/runatlantis/atlantis/server/legacy/events/webhooks" + "github.com/runatlantis/atlantis/server/legacy/jobs" + lyftCommand "github.com/runatlantis/atlantis/server/legacy/lyft/command" "github.com/runatlantis/atlantis/server/legacy/wrappers" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/models" + event_types "github.com/runatlantis/atlantis/server/neptune/gateway/event" "github.com/runatlantis/atlantis/server/neptune/lyft/feature" + "github.com/runatlantis/atlantis/server/vcs/markdown" + github_converter "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" + "github.com/runatlantis/atlantis/server/vcs/provider/github/request" . "github.com/runatlantis/atlantis/testing" + ffclient "github.com/thomaspoignant/go-feature-flag" ) const ( diff --git a/server/legacy/controllers/events/handlers/pull_request.go b/server/legacy/controllers/events/handlers/pull_request.go index d3ffdb38f..91ebbf952 100644 --- a/server/legacy/controllers/events/handlers/pull_request.go +++ b/server/legacy/controllers/events/handlers/pull_request.go @@ -4,13 +4,12 @@ import ( "context" "fmt" - contextInternal "github.com/runatlantis/atlantis/server/neptune/context" - "github.com/runatlantis/atlantis/server/legacy/controllers/events/errors" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/http" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + contextInternal "github.com/runatlantis/atlantis/server/neptune/context" event_types "github.com/runatlantis/atlantis/server/neptune/gateway/event" ) diff --git a/server/legacy/controllers/github_app_controller.go b/server/legacy/controllers/github_app_controller.go index a3678728a..08f06112a 100644 --- a/server/legacy/controllers/github_app_controller.go +++ b/server/legacy/controllers/github_app_controller.go @@ -6,11 +6,10 @@ import ( "net/http" "net/url" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/runatlantis/atlantis/server/legacy/controllers/templates" "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" ) // GithubAppController handles the creation and setup of a new GitHub app diff --git a/server/legacy/controllers/locks_controller.go b/server/legacy/controllers/locks_controller.go index 11e1245d2..ebcc86c55 100644 --- a/server/legacy/controllers/locks_controller.go +++ b/server/legacy/controllers/locks_controller.go @@ -5,10 +5,9 @@ import ( "net/http" "net/url" + "github.com/gorilla/mux" "github.com/runatlantis/atlantis/server/legacy/controllers/templates" "github.com/runatlantis/atlantis/server/legacy/core/db" - - "github.com/gorilla/mux" "github.com/runatlantis/atlantis/server/legacy/core/locking" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/vcs" diff --git a/server/legacy/controllers/locks_controller_test.go b/server/legacy/controllers/locks_controller_test.go index 8c54e7289..fd8f234e4 100644 --- a/server/legacy/controllers/locks_controller_test.go +++ b/server/legacy/controllers/locks_controller_test.go @@ -11,17 +11,15 @@ import ( "testing" "time" + "github.com/gorilla/mux" + . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/legacy/controllers" "github.com/runatlantis/atlantis/server/legacy/controllers/templates" tMocks "github.com/runatlantis/atlantis/server/legacy/controllers/templates/mocks" "github.com/runatlantis/atlantis/server/legacy/core/db" "github.com/runatlantis/atlantis/server/legacy/core/locking" - - "github.com/gorilla/mux" - . "github.com/petergtz/pegomock" - "github.com/runatlantis/atlantis/server/legacy/events" - "github.com/runatlantis/atlantis/server/legacy/core/locking/mocks" + "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/command" mocks2 "github.com/runatlantis/atlantis/server/legacy/events/mocks" vcsmocks "github.com/runatlantis/atlantis/server/legacy/events/vcs/mocks" diff --git a/server/legacy/controllers/websocket/instrumented_mux.go b/server/legacy/controllers/websocket/instrumented_mux.go index 66d7c90d0..d1644417b 100644 --- a/server/legacy/controllers/websocket/instrumented_mux.go +++ b/server/legacy/controllers/websocket/instrumented_mux.go @@ -1,8 +1,9 @@ package websocket import ( - "github.com/uber-go/tally/v4" "net/http" + + "github.com/uber-go/tally/v4" ) type InstrumentedMultiplexor struct { diff --git a/server/legacy/core/db/boltdb_test.go b/server/legacy/core/db/boltdb_test.go index 74ac8b6ee..9c9e4adbe 100644 --- a/server/legacy/core/db/boltdb_test.go +++ b/server/legacy/core/db/boltdb_test.go @@ -18,9 +18,8 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/legacy/core/db" - "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/legacy/core/db" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/models" . "github.com/runatlantis/atlantis/testing" diff --git a/server/legacy/core/locking/locking_test.go b/server/legacy/core/locking/locking_test.go index feec86e74..415e5fdde 100644 --- a/server/legacy/core/locking/locking_test.go +++ b/server/legacy/core/locking/locking_test.go @@ -15,11 +15,10 @@ package locking_test import ( "errors" + "strings" "testing" "time" - "strings" - . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/legacy/core/locking" "github.com/runatlantis/atlantis/server/legacy/core/locking/mocks" diff --git a/server/legacy/core/runtime/apply_step_runner.go b/server/legacy/core/runtime/apply_step_runner.go index fe3dfad98..84f9a9693 100644 --- a/server/legacy/core/runtime/apply_step_runner.go +++ b/server/legacy/core/runtime/apply_step_runner.go @@ -8,9 +8,8 @@ import ( "reflect" "strings" - "github.com/pkg/errors" - version "github.com/hashicorp/go-version" + "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/legacy/core/runtime/apply_step_runner_test.go b/server/legacy/core/runtime/apply_step_runner_test.go index 25c4ee723..15afba82b 100644 --- a/server/legacy/core/runtime/apply_step_runner_test.go +++ b/server/legacy/core/runtime/apply_step_runner_test.go @@ -21,7 +21,6 @@ import ( "github.com/runatlantis/atlantis/server/legacy/events/mocks/matchers" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" - . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/core/runtime/env_step_runner_test.go b/server/legacy/core/runtime/env_step_runner_test.go index cf50bb656..dfaa92e1b 100644 --- a/server/legacy/core/runtime/env_step_runner_test.go +++ b/server/legacy/core/runtime/env_step_runner_test.go @@ -5,13 +5,12 @@ import ( "testing" "github.com/hashicorp/go-version" + . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" - - . "github.com/petergtz/pegomock" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/core/runtime/init_step_runner_test.go b/server/legacy/core/runtime/init_step_runner_test.go index 8def8fc18..c48e7aeed 100644 --- a/server/legacy/core/runtime/init_step_runner_test.go +++ b/server/legacy/core/runtime/init_step_runner_test.go @@ -11,7 +11,6 @@ import ( version "github.com/hashicorp/go-version" . "github.com/petergtz/pegomock" "github.com/pkg/errors" - "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks" matchers2 "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks/matchers" diff --git a/server/legacy/core/runtime/plan_step_runner_test.go b/server/legacy/core/runtime/plan_step_runner_test.go index 0a9d717ae..73ac4418c 100644 --- a/server/legacy/core/runtime/plan_step_runner_test.go +++ b/server/legacy/core/runtime/plan_step_runner_test.go @@ -9,19 +9,17 @@ import ( "testing" "github.com/hashicorp/go-version" - "github.com/runatlantis/atlantis/server/legacy/events/command" - mocks2 "github.com/runatlantis/atlantis/server/legacy/events/mocks" - . "github.com/petergtz/pegomock" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/core/terraform/helpers" "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks" matchers2 "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks/matchers" + "github.com/runatlantis/atlantis/server/legacy/events/command" + mocks2 "github.com/runatlantis/atlantis/server/legacy/events/mocks" "github.com/runatlantis/atlantis/server/legacy/events/mocks/matchers" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" - . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/core/runtime/plan_type_step_runner_delegate_test.go b/server/legacy/core/runtime/plan_type_step_runner_delegate_test.go index 0247ef0f2..7d43a01de 100644 --- a/server/legacy/core/runtime/plan_type_step_runner_delegate_test.go +++ b/server/legacy/core/runtime/plan_type_step_runner_delegate_test.go @@ -9,11 +9,10 @@ import ( "github.com/hashicorp/go-version" . "github.com/petergtz/pegomock" - . "github.com/runatlantis/atlantis/testing" - "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/core/runtime/mocks" "github.com/runatlantis/atlantis/server/legacy/events/command" + . "github.com/runatlantis/atlantis/testing" ) var planFileContents = ` diff --git a/server/legacy/core/runtime/policy/conftest_executor.go b/server/legacy/core/runtime/policy/conftest_executor.go index 70479ebb3..c71a91c5f 100644 --- a/server/legacy/core/runtime/policy/conftest_executor.go +++ b/server/legacy/core/runtime/policy/conftest_executor.go @@ -7,17 +7,16 @@ import ( "strings" "github.com/palantir/go-githubapp/githubapp" + "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/config/valid" runtime_models "github.com/runatlantis/atlantis/server/legacy/core/runtime/models" "github.com/runatlantis/atlantis/server/legacy/events" + "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" + "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/runatlantis/atlantis/server/vcs/provider/github" - - "github.com/pkg/errors" - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/legacy/events/command" - "github.com/runatlantis/atlantis/server/models" ) type policyFilter interface { diff --git a/server/legacy/core/runtime/policy_check_step_runner_test.go b/server/legacy/core/runtime/policy_check_step_runner_test.go index a99660d3c..330966fc0 100644 --- a/server/legacy/core/runtime/policy_check_step_runner_test.go +++ b/server/legacy/core/runtime/policy_check_step_runner_test.go @@ -4,14 +4,13 @@ import ( "context" "testing" - "github.com/stretchr/testify/assert" - "github.com/hashicorp/go-version" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/stretchr/testify/assert" ) const ( diff --git a/server/legacy/core/terraform/async_client_test.go b/server/legacy/core/terraform/async_client_test.go index 58bd566be..21cf920c0 100644 --- a/server/legacy/core/terraform/async_client_test.go +++ b/server/legacy/core/terraform/async_client_test.go @@ -14,10 +14,9 @@ import ( "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks" "github.com/runatlantis/atlantis/server/legacy/events/command" jobmocks "github.com/runatlantis/atlantis/server/legacy/jobs/mocks" - "github.com/stretchr/testify/assert" - "github.com/runatlantis/atlantis/server/logging" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" ) func TestDefaultClient_RunCommandAsync_Success(t *testing.T) { diff --git a/server/legacy/core/terraform/terraform_client.go b/server/legacy/core/terraform/terraform_client.go index 868ed1d3b..8fcaf030b 100644 --- a/server/legacy/core/terraform/terraform_client.go +++ b/server/legacy/core/terraform/terraform_client.go @@ -28,7 +28,6 @@ import ( "github.com/hashicorp/go-getter" "github.com/hashicorp/go-version" "github.com/pkg/errors" - "github.com/runatlantis/atlantis/server/legacy/core/runtime/cache" runtime_models "github.com/runatlantis/atlantis/server/legacy/core/runtime/models" "github.com/runatlantis/atlantis/server/legacy/events/command" diff --git a/server/legacy/events/command_runner_test.go b/server/legacy/events/command_runner_test.go index 3fe4db789..3760d1820 100644 --- a/server/legacy/events/command_runner_test.go +++ b/server/legacy/events/command_runner_test.go @@ -21,28 +21,26 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" - "github.com/uber-go/tally/v4" - + . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/core/db" - "github.com/runatlantis/atlantis/server/legacy/events/command" - "github.com/runatlantis/atlantis/server/legacy/events/vcs" - lyft_vcs "github.com/runatlantis/atlantis/server/legacy/events/vcs/lyft" - "github.com/runatlantis/atlantis/server/logging" - "github.com/runatlantis/atlantis/server/metrics" - - . "github.com/petergtz/pegomock" lockingmocks "github.com/runatlantis/atlantis/server/legacy/core/locking/mocks" "github.com/runatlantis/atlantis/server/legacy/events" + "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/legacy/events/mocks" eventmocks "github.com/runatlantis/atlantis/server/legacy/events/mocks" "github.com/runatlantis/atlantis/server/legacy/events/mocks/matchers" + "github.com/runatlantis/atlantis/server/legacy/events/vcs" + lyft_vcs "github.com/runatlantis/atlantis/server/legacy/events/vcs/lyft" vcsmocks "github.com/runatlantis/atlantis/server/legacy/events/vcs/mocks" + "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/models/fixtures" "github.com/runatlantis/atlantis/server/vcs/markdown" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" + "github.com/uber-go/tally/v4" ) var projectCommandBuilder *mocks.MockProjectCommandBuilder diff --git a/server/legacy/events/github_app_working_dir.go b/server/legacy/events/github_app_working_dir.go index 705957a8d..07df58695 100644 --- a/server/legacy/events/github_app_working_dir.go +++ b/server/legacy/events/github_app_working_dir.go @@ -4,13 +4,12 @@ import ( "fmt" "strings" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - "github.com/mitchellh/go-homedir" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/vcs/provider/github" ) // GithubAppWorkingDir implements WorkingDir. diff --git a/server/legacy/events/project_command_builder.go b/server/legacy/events/project_command_builder.go index 58669e3b0..cbcd9ec71 100644 --- a/server/legacy/events/project_command_builder.go +++ b/server/legacy/events/project_command_builder.go @@ -4,13 +4,12 @@ import ( "fmt" "os" - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/logging" - "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/legacy/events/vcs" + "github.com/runatlantis/atlantis/server/logging" ) const ( diff --git a/server/legacy/events/project_command_builder_test.go b/server/legacy/events/project_command_builder_test.go index 412555569..032451791 100644 --- a/server/legacy/events/project_command_builder_test.go +++ b/server/legacy/events/project_command_builder_test.go @@ -8,8 +8,6 @@ import ( "strings" "testing" - "github.com/stretchr/testify/assert" - . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/config" "github.com/runatlantis/atlantis/server/config/valid" @@ -23,6 +21,7 @@ import ( "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/models" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" "github.com/uber-go/tally/v4" ) diff --git a/server/legacy/events/project_finder.go b/server/legacy/events/project_finder.go index 0579a9936..ef5cff6c0 100644 --- a/server/legacy/events/project_finder.go +++ b/server/legacy/events/project_finder.go @@ -21,10 +21,9 @@ import ( "path/filepath" "strings" - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/docker/docker/pkg/fileutils" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/legacy/events/pull_closed_executor.go b/server/legacy/events/pull_closed_executor.go index 66d43951d..8a696bbae 100644 --- a/server/legacy/events/pull_closed_executor.go +++ b/server/legacy/events/pull_closed_executor.go @@ -21,14 +21,12 @@ import ( "strings" "text/template" - "github.com/runatlantis/atlantis/server/legacy/core/db" - - "github.com/runatlantis/atlantis/server/logging" - "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/legacy/core/db" "github.com/runatlantis/atlantis/server/legacy/core/locking" "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/legacy/jobs" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/legacy/events/pull_closed_executor_test.go b/server/legacy/events/pull_closed_executor_test.go index d73577e34..b1bc9d97c 100644 --- a/server/legacy/events/pull_closed_executor_test.go +++ b/server/legacy/events/pull_closed_executor_test.go @@ -18,28 +18,25 @@ import ( "os" "testing" - "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" - "github.com/uber-go/tally/v4" - + . "github.com/petergtz/pegomock" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/legacy/core/db" - "github.com/runatlantis/atlantis/server/logging" - bolt "go.etcd.io/bbolt" - - "github.com/runatlantis/atlantis/server/legacy/jobs" - "github.com/stretchr/testify/assert" - - . "github.com/petergtz/pegomock" lockmocks "github.com/runatlantis/atlantis/server/legacy/core/locking/mocks" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/legacy/events/mocks" "github.com/runatlantis/atlantis/server/legacy/events/mocks/matchers" + "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" vcsmocks "github.com/runatlantis/atlantis/server/legacy/events/vcs/mocks" + "github.com/runatlantis/atlantis/server/legacy/jobs" jobmocks "github.com/runatlantis/atlantis/server/legacy/jobs/mocks" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/models/fixtures" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" + "github.com/uber-go/tally/v4" + bolt "go.etcd.io/bbolt" ) func TestCleanUpPullWorkspaceErrorf(t *testing.T) { diff --git a/server/legacy/events/vcs/common/common_test.go b/server/legacy/events/vcs/common/common_test.go index e4189d1cd..94c7eb870 100644 --- a/server/legacy/events/vcs/common/common_test.go +++ b/server/legacy/events/vcs/common/common_test.go @@ -18,7 +18,6 @@ import ( "testing" "github.com/runatlantis/atlantis/server/legacy/events/vcs/common" - . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/events/vcs/github_client.go b/server/legacy/events/vcs/github_client.go index cb86d2808..88a8731f1 100644 --- a/server/legacy/events/vcs/github_client.go +++ b/server/legacy/events/vcs/github_client.go @@ -22,8 +22,6 @@ import ( "strings" "time" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/Laisky/graphql" "github.com/google/go-github/v45/github" "github.com/pkg/errors" @@ -32,6 +30,7 @@ import ( "github.com/runatlantis/atlantis/server/legacy/events/vcs/types" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/shurcooL/githubv4" ) diff --git a/server/legacy/events/vcs/github_client_internal_test.go b/server/legacy/events/vcs/github_client_internal_test.go index c68691d5d..d5b631d0c 100644 --- a/server/legacy/events/vcs/github_client_internal_test.go +++ b/server/legacy/events/vcs/github_client_internal_test.go @@ -16,9 +16,8 @@ package vcs import ( "testing" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/events/vcs/github_client_lyft_test.go b/server/legacy/events/vcs/github_client_lyft_test.go index 8fafe82d0..0dc59c173 100644 --- a/server/legacy/events/vcs/github_client_lyft_test.go +++ b/server/legacy/events/vcs/github_client_lyft_test.go @@ -9,11 +9,10 @@ import ( "strings" "testing" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/stretchr/testify/assert" ) diff --git a/server/legacy/events/vcs/github_client_test.go b/server/legacy/events/vcs/github_client_test.go index ecd67c1ad..1eab26dae 100644 --- a/server/legacy/events/vcs/github_client_test.go +++ b/server/legacy/events/vcs/github_client_test.go @@ -17,7 +17,6 @@ import ( "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" . "github.com/runatlantis/atlantis/testing" - "github.com/shurcooL/githubv4" ) diff --git a/server/legacy/events/webhooks/slack.go b/server/legacy/events/webhooks/slack.go index 3ef2371c0..daadd9718 100644 --- a/server/legacy/events/webhooks/slack.go +++ b/server/legacy/events/webhooks/slack.go @@ -14,9 +14,8 @@ package webhooks import ( - "regexp" - "fmt" + "regexp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/logging" diff --git a/server/legacy/events/webhooks/slack_client_test.go b/server/legacy/events/webhooks/slack_client_test.go index 1d9f32d84..d9882fda1 100644 --- a/server/legacy/events/webhooks/slack_client_test.go +++ b/server/legacy/events/webhooks/slack_client_test.go @@ -19,11 +19,10 @@ import ( "testing" "github.com/nlopes/slack" + . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/legacy/events/webhooks" "github.com/runatlantis/atlantis/server/legacy/events/webhooks/mocks" "github.com/runatlantis/atlantis/server/models" - - . "github.com/petergtz/pegomock" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/events/webhooks/webhooks.go b/server/legacy/events/webhooks/webhooks.go index d2e9461ed..90fb4fbe1 100644 --- a/server/legacy/events/webhooks/webhooks.go +++ b/server/legacy/events/webhooks/webhooks.go @@ -14,11 +14,10 @@ package webhooks import ( + "errors" "fmt" "regexp" - "errors" - "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/legacy/jobs/job_store.go b/server/legacy/jobs/job_store.go index ddcb6d1b5..84f78aef1 100644 --- a/server/legacy/jobs/job_store.go +++ b/server/legacy/jobs/job_store.go @@ -5,9 +5,8 @@ import ( "fmt" "sync" - "github.com/uber-go/tally/v4" - "github.com/pkg/errors" + "github.com/uber-go/tally/v4" ) type JobStatus int diff --git a/server/legacy/jobs/job_store_test.go b/server/legacy/jobs/job_store_test.go index 7e003ad6e..79292cf95 100644 --- a/server/legacy/jobs/job_store_test.go +++ b/server/legacy/jobs/job_store_test.go @@ -5,16 +5,14 @@ import ( "fmt" "testing" - "github.com/uber-go/tally/v4" - + . "github.com/petergtz/pegomock" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/legacy/jobs" "github.com/runatlantis/atlantis/server/legacy/jobs/mocks" "github.com/runatlantis/atlantis/server/legacy/jobs/mocks/matchers" - "github.com/stretchr/testify/assert" - - . "github.com/petergtz/pegomock" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" + "github.com/uber-go/tally/v4" ) func TestJobStore_Get(t *testing.T) { diff --git a/server/legacy/jobs/project_command_output_handler.go b/server/legacy/jobs/project_command_output_handler.go index e09a9a730..39a87e2af 100644 --- a/server/legacy/jobs/project_command_output_handler.go +++ b/server/legacy/jobs/project_command_output_handler.go @@ -5,9 +5,8 @@ import ( "fmt" "sync" - "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" - "github.com/runatlantis/atlantis/server/legacy/events/command" + "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/legacy/jobs/project_command_output_handler_test.go b/server/legacy/jobs/project_command_output_handler_test.go index fd64575eb..1e42009d0 100644 --- a/server/legacy/jobs/project_command_output_handler_test.go +++ b/server/legacy/jobs/project_command_output_handler_test.go @@ -5,19 +5,16 @@ import ( "sync" "testing" - "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" - "github.com/stretchr/testify/assert" - . "github.com/petergtz/pegomock" - "github.com/runatlantis/atlantis/server/legacy/events/command" + "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" "github.com/runatlantis/atlantis/server/legacy/jobs" "github.com/runatlantis/atlantis/server/legacy/jobs/mocks" "github.com/runatlantis/atlantis/server/legacy/jobs/mocks/matchers" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" - . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" ) func createTestProjectCmdContext(t *testing.T) command.ProjectContext { diff --git a/server/legacy/lyft/core/runtime/destroy_plan_step_runner_test.go b/server/legacy/lyft/core/runtime/destroy_plan_step_runner_test.go index e30d0e134..c97a31dff 100644 --- a/server/legacy/lyft/core/runtime/destroy_plan_step_runner_test.go +++ b/server/legacy/lyft/core/runtime/destroy_plan_step_runner_test.go @@ -8,15 +8,13 @@ import ( "testing" "github.com/hashicorp/go-version" + . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/legacy/core/runtime" "github.com/runatlantis/atlantis/server/legacy/core/terraform/mocks" - "github.com/runatlantis/atlantis/server/legacy/events/command" lyftRuntime "github.com/runatlantis/atlantis/server/legacy/lyft/core/runtime" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" - - . "github.com/petergtz/pegomock" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/legacy/lyft/decorators/audit_project_commands_wrapper_test.go b/server/legacy/lyft/decorators/audit_project_commands_wrapper_test.go index cbc904a53..f1281c2a4 100644 --- a/server/legacy/lyft/decorators/audit_project_commands_wrapper_test.go +++ b/server/legacy/lyft/decorators/audit_project_commands_wrapper_test.go @@ -5,8 +5,6 @@ import ( "errors" "testing" - . "github.com/runatlantis/atlantis/testing" - . "github.com/petergtz/pegomock" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/events/command" @@ -17,6 +15,7 @@ import ( "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/models" + . "github.com/runatlantis/atlantis/testing" ) func TestAuditProjectCommandsWrapper(t *testing.T) { diff --git a/server/legacy/lyft/gateway/events_controller.go b/server/legacy/lyft/gateway/events_controller.go index 9bdfc60b0..c6ccde27d 100644 --- a/server/legacy/lyft/gateway/events_controller.go +++ b/server/legacy/lyft/gateway/events_controller.go @@ -4,26 +4,23 @@ import ( "context" "net/http" - "github.com/runatlantis/atlantis/server/neptune/gateway/pr" - "github.com/palantir/go-githubapp/githubapp" "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/legacy/events/command" - - "github.com/runatlantis/atlantis/server/vcs/provider/github" - events_controllers "github.com/runatlantis/atlantis/server/legacy/controllers/events" "github.com/runatlantis/atlantis/server/legacy/controllers/events/handlers" "github.com/runatlantis/atlantis/server/legacy/events" + "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/config" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" gateway_handlers "github.com/runatlantis/atlantis/server/neptune/gateway/event" + "github.com/runatlantis/atlantis/server/neptune/gateway/pr" "github.com/runatlantis/atlantis/server/neptune/gateway/requirement" "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/runatlantis/atlantis/server/neptune/sync" + "github.com/runatlantis/atlantis/server/vcs/provider/github" converters "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/runatlantis/atlantis/server/vcs/provider/github/request" "github.com/uber-go/tally/v4" diff --git a/server/legacy/server.go b/server/legacy/server.go index 942479243..e44877d3a 100644 --- a/server/legacy/server.go +++ b/server/legacy/server.go @@ -31,50 +31,45 @@ import ( "syscall" "time" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - - "github.com/palantir/go-githubapp/githubapp" - "github.com/runatlantis/atlantis/server/neptune/template" - middleware "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - - "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" - "github.com/runatlantis/atlantis/server/neptune/storage" - assetfs "github.com/elazarl/go-bindata-assetfs" - "github.com/runatlantis/atlantis/server/legacy/instrumentation" - "github.com/runatlantis/atlantis/server/static" - - "github.com/mitchellh/go-homedir" - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/legacy/core/db" - "github.com/runatlantis/atlantis/server/legacy/core/runtime/policy" - "github.com/runatlantis/atlantis/server/legacy/jobs" - "github.com/runatlantis/atlantis/server/legacy/lyft/aws" - "github.com/runatlantis/atlantis/server/legacy/lyft/aws/sns" - lyftCommands "github.com/runatlantis/atlantis/server/legacy/lyft/command" - lyftRuntime "github.com/runatlantis/atlantis/server/legacy/lyft/core/runtime" - "github.com/runatlantis/atlantis/server/legacy/lyft/scheduled" - "github.com/runatlantis/atlantis/server/legacy/wrappers" - "github.com/runatlantis/atlantis/server/metrics" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/uber-go/tally/v4" - "github.com/gorilla/mux" + "github.com/mitchellh/go-homedir" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" cfgParser "github.com/runatlantis/atlantis/server/config" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/controllers" "github.com/runatlantis/atlantis/server/legacy/controllers/templates" "github.com/runatlantis/atlantis/server/legacy/controllers/websocket" + "github.com/runatlantis/atlantis/server/legacy/core/db" "github.com/runatlantis/atlantis/server/legacy/core/locking" "github.com/runatlantis/atlantis/server/legacy/core/runtime" + "github.com/runatlantis/atlantis/server/legacy/core/runtime/policy" "github.com/runatlantis/atlantis/server/legacy/core/terraform" "github.com/runatlantis/atlantis/server/legacy/events" "github.com/runatlantis/atlantis/server/legacy/events/command" + "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" "github.com/runatlantis/atlantis/server/legacy/events/vcs" lyft_vcs "github.com/runatlantis/atlantis/server/legacy/events/vcs/lyft" "github.com/runatlantis/atlantis/server/legacy/events/webhooks" + "github.com/runatlantis/atlantis/server/legacy/instrumentation" + "github.com/runatlantis/atlantis/server/legacy/jobs" + "github.com/runatlantis/atlantis/server/legacy/lyft/aws" + "github.com/runatlantis/atlantis/server/legacy/lyft/aws/sns" + lyftCommands "github.com/runatlantis/atlantis/server/legacy/lyft/command" + lyftRuntime "github.com/runatlantis/atlantis/server/legacy/lyft/core/runtime" + "github.com/runatlantis/atlantis/server/legacy/lyft/scheduled" + "github.com/runatlantis/atlantis/server/legacy/wrappers" "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/metrics" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" + "github.com/runatlantis/atlantis/server/neptune/storage" + "github.com/runatlantis/atlantis/server/neptune/template" + middleware "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" + "github.com/runatlantis/atlantis/server/static" "github.com/runatlantis/atlantis/server/vcs/markdown" + "github.com/runatlantis/atlantis/server/vcs/provider/github" + "github.com/uber-go/tally/v4" "github.com/urfave/cli" "github.com/urfave/negroni" ) diff --git a/server/legacy/server_test.go b/server/legacy/server_test.go index c95b27a0d..c81d8e6f4 100644 --- a/server/legacy/server_test.go +++ b/server/legacy/server_test.go @@ -23,14 +23,13 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/logging" - "github.com/gorilla/mux" . "github.com/petergtz/pegomock" server "github.com/runatlantis/atlantis/server/legacy" "github.com/runatlantis/atlantis/server/legacy/controllers/templates" tMocks "github.com/runatlantis/atlantis/server/legacy/controllers/templates/mocks" "github.com/runatlantis/atlantis/server/legacy/core/locking/mocks" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/models/models.go b/server/models/models.go index ff81ecfa6..610b9ea9f 100644 --- a/server/models/models.go +++ b/server/models/models.go @@ -26,10 +26,9 @@ import ( "strings" "time" + "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/vcs" - - "github.com/pkg/errors" ) type PullReqStatus struct { diff --git a/server/neptune/adhoc/server.go b/server/neptune/adhoc/server.go index 7db4248d5..14c9f0c24 100644 --- a/server/neptune/adhoc/server.go +++ b/server/neptune/adhoc/server.go @@ -13,17 +13,11 @@ import ( "syscall" "time" - "github.com/palantir/go-githubapp/githubapp" - "github.com/runatlantis/atlantis/server/legacy/events/vcs" - "github.com/runatlantis/atlantis/server/neptune/sync/crons" - ghClient "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" - assetfs "github.com/elazarl/go-bindata-assetfs" "github.com/gorilla/mux" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/legacy/events/vcs" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" adhoc "github.com/runatlantis/atlantis/server/neptune/adhoc/adhocexecutionhelpers" @@ -33,12 +27,17 @@ import ( "github.com/runatlantis/atlantis/server/neptune/gateway/event/preworkflow" neptune_http "github.com/runatlantis/atlantis/server/neptune/http" internalSync "github.com/runatlantis/atlantis/server/neptune/sync" + "github.com/runatlantis/atlantis/server/neptune/sync/crons" "github.com/runatlantis/atlantis/server/neptune/temporal" neptune "github.com/runatlantis/atlantis/server/neptune/temporalworker/config" "github.com/runatlantis/atlantis/server/neptune/temporalworker/job" "github.com/runatlantis/atlantis/server/neptune/workflows" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + ghClient "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/static" + "github.com/runatlantis/atlantis/server/vcs/provider/github" + "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/uber-go/tally/v4" "github.com/urfave/negroni" "go.temporal.io/sdk/client" diff --git a/server/neptune/exec/exec_test.go b/server/neptune/exec/exec_test.go index 2ce74be73..07c9ead78 100644 --- a/server/neptune/exec/exec_test.go +++ b/server/neptune/exec/exec_test.go @@ -2,10 +2,11 @@ package exec_test import ( "context" + "testing" + "github.com/runatlantis/atlantis/server/logging" subprocess_exec "github.com/runatlantis/atlantis/server/neptune/exec" "github.com/stretchr/testify/assert" - "testing" ) func TestCmd_RunWithNewProcessGroup(t *testing.T) { diff --git a/server/neptune/gateway/api/deploy.go b/server/neptune/gateway/api/deploy.go index 549262d19..d3f7bb5e7 100644 --- a/server/neptune/gateway/api/deploy.go +++ b/server/neptune/gateway/api/deploy.go @@ -2,6 +2,7 @@ package api import ( "context" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/neptune/gateway/api/request" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" diff --git a/server/neptune/gateway/config/root_config_builder_test.go b/server/neptune/gateway/config/root_config_builder_test.go index 29d233e5b..0cbb3456f 100644 --- a/server/neptune/gateway/config/root_config_builder_test.go +++ b/server/neptune/gateway/config/root_config_builder_test.go @@ -5,14 +5,13 @@ import ( "errors" "testing" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - "github.com/uber-go/tally/v4" - "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/config" + "github.com/runatlantis/atlantis/server/vcs/provider/github" "github.com/stretchr/testify/assert" + "github.com/uber-go/tally/v4" ) var rcb config.Builder diff --git a/server/neptune/gateway/deploy/deployer.go b/server/neptune/gateway/deploy/deployer.go index 94963122f..6d28dd5fd 100644 --- a/server/neptune/gateway/deploy/deployer.go +++ b/server/neptune/gateway/deploy/deployer.go @@ -3,13 +3,12 @@ package deploy import ( "context" - "github.com/runatlantis/atlantis/server/neptune/gateway/config" - "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" contextInternal "github.com/runatlantis/atlantis/server/neptune/context" + "github.com/runatlantis/atlantis/server/neptune/gateway/config" "github.com/runatlantis/atlantis/server/neptune/workflows" "github.com/runatlantis/atlantis/server/vcs/provider/github" "go.temporal.io/sdk/client" diff --git a/server/neptune/gateway/deploy/root_finder.go b/server/neptune/gateway/deploy/root_finder.go index 8e16c961e..04120aa03 100644 --- a/server/neptune/gateway/deploy/root_finder.go +++ b/server/neptune/gateway/deploy/root_finder.go @@ -6,12 +6,10 @@ import ( "path/filepath" "strings" - "github.com/runatlantis/atlantis/server/logging" - - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/docker/docker/pkg/fileutils" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/config/valid" + "github.com/runatlantis/atlantis/server/logging" ) // RepoRootFinder implements rootFinder. diff --git a/server/neptune/gateway/deploy/root_finder_test.go b/server/neptune/gateway/deploy/root_finder_test.go index 2c86eae8d..4b3b7f2ec 100644 --- a/server/neptune/gateway/deploy/root_finder_test.go +++ b/server/neptune/gateway/deploy/root_finder_test.go @@ -19,12 +19,11 @@ import ( "path/filepath" "testing" - "github.com/runatlantis/atlantis/server/logging" - "github.com/stretchr/testify/assert" - "github.com/runatlantis/atlantis/server/config/valid" + "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" ) func TestDefaultProjectFinder_FindRoots(t *testing.T) { diff --git a/server/neptune/gateway/event/check_run_handler.go b/server/neptune/gateway/event/check_run_handler.go index fe3a36e4e..47b03f82e 100644 --- a/server/neptune/gateway/event/check_run_handler.go +++ b/server/neptune/gateway/event/check_run_handler.go @@ -6,15 +6,14 @@ import ( "regexp" "strings" - "github.com/runatlantis/atlantis/server/config/valid" - contextInternal "github.com/runatlantis/atlantis/server/neptune/context" - "go.temporal.io/sdk/client" - "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + contextInternal "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" "github.com/runatlantis/atlantis/server/neptune/workflows" + "go.temporal.io/sdk/client" ) const ( diff --git a/server/neptune/gateway/event/check_run_handler_test.go b/server/neptune/gateway/event/check_run_handler_test.go index b1e7b1b0c..2d35895a0 100644 --- a/server/neptune/gateway/event/check_run_handler_test.go +++ b/server/neptune/gateway/event/check_run_handler_test.go @@ -5,14 +5,13 @@ import ( "testing" "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/models" - "github.com/runatlantis/atlantis/server/neptune/sync" - "go.temporal.io/sdk/client" - "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" "github.com/runatlantis/atlantis/server/neptune/gateway/event" + "github.com/runatlantis/atlantis/server/neptune/sync" "github.com/stretchr/testify/assert" + "go.temporal.io/sdk/client" ) func TestCheckRunHandler(t *testing.T) { diff --git a/server/neptune/gateway/event/modified_pull_request_handler.go b/server/neptune/gateway/event/modified_pull_request_handler.go index 8973705ef..5f926b9e9 100644 --- a/server/neptune/gateway/event/modified_pull_request_handler.go +++ b/server/neptune/gateway/event/modified_pull_request_handler.go @@ -5,18 +5,16 @@ import ( "time" "github.com/hashicorp/go-multierror" - + "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config/valid" + "github.com/runatlantis/atlantis/server/legacy/http" + "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/config" "github.com/runatlantis/atlantis/server/neptune/gateway/pr" "github.com/runatlantis/atlantis/server/neptune/gateway/requirement" "github.com/runatlantis/atlantis/server/vcs/provider/github" "go.temporal.io/sdk/client" - - "github.com/pkg/errors" - "github.com/runatlantis/atlantis/server/legacy/http" - "github.com/runatlantis/atlantis/server/logging" - "github.com/runatlantis/atlantis/server/models" ) type legacyHandler interface { diff --git a/server/neptune/gateway/event/pull_request_review_handler.go b/server/neptune/gateway/event/pull_request_review_handler.go index 45a644d8c..4d98df476 100644 --- a/server/neptune/gateway/event/pull_request_review_handler.go +++ b/server/neptune/gateway/event/pull_request_review_handler.go @@ -4,19 +4,17 @@ import ( "context" "time" - "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/neptune/gateway/config" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - - "github.com/runatlantis/atlantis/server/neptune/gateway/pr" - "github.com/uber-go/tally/v4" - "go.temporal.io/api/serviceerror" - "github.com/hashicorp/go-multierror" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/http" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/neptune/gateway/config" + "github.com/runatlantis/atlantis/server/neptune/gateway/pr" + "github.com/runatlantis/atlantis/server/vcs/provider/github" + "github.com/uber-go/tally/v4" + "go.temporal.io/api/serviceerror" ) const ( diff --git a/server/neptune/gateway/event/pull_request_review_handler_test.go b/server/neptune/gateway/event/pull_request_review_handler_test.go index 2ca37ccf3..65e7f99a8 100644 --- a/server/neptune/gateway/event/pull_request_review_handler_test.go +++ b/server/neptune/gateway/event/pull_request_review_handler_test.go @@ -8,13 +8,12 @@ import ( "testing" "github.com/runatlantis/atlantis/server/config/valid" - "github.com/runatlantis/atlantis/server/neptune/gateway/config" - "github.com/runatlantis/atlantis/server/neptune/gateway/pr" - buffered "github.com/runatlantis/atlantis/server/legacy/http" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/neptune/gateway/config" "github.com/runatlantis/atlantis/server/neptune/gateway/event" + "github.com/runatlantis/atlantis/server/neptune/gateway/pr" "github.com/runatlantis/atlantis/server/neptune/sync" "github.com/stretchr/testify/assert" "github.com/uber-go/tally/v4" diff --git a/server/neptune/gateway/event/push_event_handler.go b/server/neptune/gateway/event/push_event_handler.go index 519bd75a3..4c25280e4 100644 --- a/server/neptune/gateway/event/push_event_handler.go +++ b/server/neptune/gateway/event/push_event_handler.go @@ -3,14 +3,13 @@ package event import ( "context" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/deploy" "github.com/runatlantis/atlantis/server/neptune/sync" "github.com/runatlantis/atlantis/server/neptune/workflows" "github.com/runatlantis/atlantis/server/vcs" + "github.com/runatlantis/atlantis/server/vcs/provider/github" ) type PushAction string diff --git a/server/neptune/lyft/activities/audit.go b/server/neptune/lyft/activities/audit.go index b4cdd3b55..04eeb5348 100644 --- a/server/neptune/lyft/activities/audit.go +++ b/server/neptune/lyft/activities/audit.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws/session" awsSns "github.com/aws/aws-sdk-go/service/sns" - "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/neptune/lyft/activities/sns" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" diff --git a/server/neptune/lyft/activities/github.go b/server/neptune/lyft/activities/github.go index c9ee83ae7..73ac4b235 100644 --- a/server/neptune/lyft/activities/github.go +++ b/server/neptune/lyft/activities/github.go @@ -5,9 +5,8 @@ import ( "fmt" "net/http" - "github.com/palantir/go-githubapp/githubapp" - "github.com/google/go-github/v45/github" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" internal "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" ) diff --git a/server/neptune/lyft/feature/retriever.go b/server/neptune/lyft/feature/retriever.go index 57f7e23b0..210716003 100644 --- a/server/neptune/lyft/feature/retriever.go +++ b/server/neptune/lyft/feature/retriever.go @@ -2,6 +2,7 @@ package feature import ( "context" + "github.com/pkg/errors" gh "github.com/runatlantis/atlantis/server/vcs/provider/github" ) diff --git a/server/neptune/lyft/notifier/sns.go b/server/neptune/lyft/notifier/sns.go index 07f602483..6d34caa1d 100644 --- a/server/neptune/lyft/notifier/sns.go +++ b/server/neptune/lyft/notifier/sns.go @@ -2,13 +2,12 @@ package notifier import ( "context" + "strconv" "github.com/runatlantis/atlantis/server/neptune/lyft/activities" t "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "go.temporal.io/sdk/workflow" - - "strconv" ) type auditActivity interface { diff --git a/server/neptune/sync/crons/ratelimit_stats.go b/server/neptune/sync/crons/ratelimit_stats.go index 9382ab014..5d3db177c 100644 --- a/server/neptune/sync/crons/ratelimit_stats.go +++ b/server/neptune/sync/crons/ratelimit_stats.go @@ -2,11 +2,12 @@ package crons import ( "context" + "net/http" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/metrics" "github.com/uber-go/tally/v4" - "net/http" ) const ( diff --git a/server/neptune/template/loader.go b/server/neptune/template/loader.go index 7d88f215f..c446bf093 100644 --- a/server/neptune/template/loader.go +++ b/server/neptune/template/loader.go @@ -2,12 +2,11 @@ package template import ( "bytes" + _ "embed" // embedding files "fmt" "html/template" "os" - _ "embed" // embedding files - "github.com/Masterminds/sprig/v3" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/models" diff --git a/server/neptune/temporal/client.go b/server/neptune/temporal/client.go index 8fd8f4bca..3f3fb682d 100644 --- a/server/neptune/temporal/client.go +++ b/server/neptune/temporal/client.go @@ -8,10 +8,9 @@ import ( "io" "time" + "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/metrics" contextInternal "github.com/runatlantis/atlantis/server/neptune/context" - - "github.com/runatlantis/atlantis/server/config/valid" "github.com/uber-go/tally/v4" "go.temporal.io/sdk/client" temporaltally "go.temporal.io/sdk/contrib/tally" diff --git a/server/neptune/temporal/propagator.go b/server/neptune/temporal/propagator.go index 078f5330d..eca4f75e1 100644 --- a/server/neptune/temporal/propagator.go +++ b/server/neptune/temporal/propagator.go @@ -2,9 +2,9 @@ package temporal import ( "context" - internalContext "github.com/runatlantis/atlantis/server/neptune/context" "github.com/pkg/errors" + internalContext "github.com/runatlantis/atlantis/server/neptune/context" "go.temporal.io/sdk/converter" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/temporalworker/config/config.go b/server/neptune/temporalworker/config/config.go index 1cccf2a4f..a49ca8bdb 100644 --- a/server/neptune/temporalworker/config/config.go +++ b/server/neptune/temporalworker/config/config.go @@ -4,7 +4,6 @@ import ( "net/url" "github.com/hashicorp/go-version" - "github.com/palantir/go-githubapp/githubapp" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" diff --git a/server/neptune/temporalworker/job/store_test.go b/server/neptune/temporalworker/job/store_test.go index 5bacc89f4..eadd4da06 100644 --- a/server/neptune/temporalworker/job/store_test.go +++ b/server/neptune/temporalworker/job/store_test.go @@ -8,9 +8,8 @@ import ( "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/neptune/temporalworker/job" - "github.com/stretchr/testify/assert" - . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" ) type testStorageBackend struct { diff --git a/server/neptune/temporalworker/server.go b/server/neptune/temporalworker/server.go index a35c283e4..aac4994bc 100644 --- a/server/neptune/temporalworker/server.go +++ b/server/neptune/temporalworker/server.go @@ -13,13 +13,9 @@ import ( "syscall" "time" - "github.com/palantir/go-githubapp/githubapp" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - ghClient "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - "github.com/runatlantis/atlantis/server/vcs/provider/github" - assetfs "github.com/elazarl/go-bindata-assetfs" "github.com/gorilla/mux" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/logging" @@ -27,6 +23,7 @@ import ( neptune_http "github.com/runatlantis/atlantis/server/neptune/http" lyftActivities "github.com/runatlantis/atlantis/server/neptune/lyft/activities" "github.com/runatlantis/atlantis/server/neptune/lyft/executor" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/runatlantis/atlantis/server/neptune/lyft/notifier" lyftWorkflows "github.com/runatlantis/atlantis/server/neptune/lyft/workflows" internalSync "github.com/runatlantis/atlantis/server/neptune/sync" @@ -37,8 +34,10 @@ import ( "github.com/runatlantis/atlantis/server/neptune/temporalworker/job" "github.com/runatlantis/atlantis/server/neptune/workflows" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + ghClient "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "github.com/runatlantis/atlantis/server/static" + "github.com/runatlantis/atlantis/server/vcs/provider/github" "github.com/uber-go/tally/v4" "github.com/urfave/negroni" "go.temporal.io/sdk/interceptor" diff --git a/server/neptune/workflows/activities/conftest.go b/server/neptune/workflows/activities/conftest.go index 4402b41d8..f508fd8ce 100644 --- a/server/neptune/workflows/activities/conftest.go +++ b/server/neptune/workflows/activities/conftest.go @@ -4,11 +4,12 @@ import ( "bytes" "context" "fmt" + "strings" + "github.com/hashicorp/go-version" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/temporal" "go.temporal.io/sdk/activity" - "strings" ) type asyncClient interface { diff --git a/server/neptune/workflows/activities/conftest/summary.go b/server/neptune/workflows/activities/conftest/summary.go index 7b1cc0231..d2eb935dd 100644 --- a/server/neptune/workflows/activities/conftest/summary.go +++ b/server/neptune/workflows/activities/conftest/summary.go @@ -2,8 +2,9 @@ package conftest import ( "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "strings" + + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" ) type ValidateSummary struct { diff --git a/server/neptune/workflows/activities/conftest/summary_test.go b/server/neptune/workflows/activities/conftest/summary_test.go index 5d8d509ce..4892f0354 100644 --- a/server/neptune/workflows/activities/conftest/summary_test.go +++ b/server/neptune/workflows/activities/conftest/summary_test.go @@ -1,9 +1,10 @@ package conftest import ( + "testing" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "gopkg.in/go-playground/assert.v1" - "testing" ) func TestNewValidateSummaryFromResults(t *testing.T) { diff --git a/server/neptune/workflows/activities/conftest_test.go b/server/neptune/workflows/activities/conftest_test.go index 5d3d264d6..b45681133 100644 --- a/server/neptune/workflows/activities/conftest_test.go +++ b/server/neptune/workflows/activities/conftest_test.go @@ -1,12 +1,13 @@ package activities import ( + "strings" + "testing" + "github.com/hashicorp/go-version" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" - "strings" - "testing" ) func TestConftest_RequestValidation(t *testing.T) { diff --git a/server/neptune/workflows/activities/github.go b/server/neptune/workflows/activities/github.go index 8ec4962d4..cf62ed723 100644 --- a/server/neptune/workflows/activities/github.go +++ b/server/neptune/workflows/activities/github.go @@ -8,17 +8,15 @@ import ( "os" "path/filepath" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - - key "github.com/runatlantis/atlantis/server/neptune/context" - "go.temporal.io/sdk/activity" - "github.com/google/go-github/v45/github" "github.com/hashicorp/go-getter" "github.com/pkg/errors" + key "github.com/runatlantis/atlantis/server/neptune/context" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" internal "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/temporal" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "go.temporal.io/sdk/activity" ) var HashiGetter = func(ctx context.Context, dst, src string) error { diff --git a/server/neptune/workflows/activities/github/markdown/renderer.go b/server/neptune/workflows/activities/github/markdown/renderer.go index da4f822a0..11b64d91b 100644 --- a/server/neptune/workflows/activities/github/markdown/renderer.go +++ b/server/neptune/workflows/activities/github/markdown/renderer.go @@ -4,10 +4,10 @@ import ( "bytes" _ "embed" //embedding files "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "html/template" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" ) diff --git a/server/neptune/workflows/activities/github/middleware.go b/server/neptune/workflows/activities/github/middleware.go index f27c794da..c0020c459 100644 --- a/server/neptune/workflows/activities/github/middleware.go +++ b/server/neptune/workflows/activities/github/middleware.go @@ -1,11 +1,12 @@ package github import ( + "net/http" + "strconv" + "github.com/gregjones/httpcache" "github.com/palantir/go-githubapp/githubapp" "github.com/uber-go/tally/v4" - "net/http" - "strconv" ) const ( diff --git a/server/neptune/workflows/activities/main.go b/server/neptune/workflows/activities/main.go index 65e3f26ab..9ceea33c1 100644 --- a/server/neptune/workflows/activities/main.go +++ b/server/neptune/workflows/activities/main.go @@ -6,13 +6,12 @@ import ( "os" "path/filepath" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/hashicorp/go-version" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/core/runtime/cache" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/runatlantis/atlantis/server/neptune/storage" "github.com/runatlantis/atlantis/server/neptune/temporalworker/config" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" diff --git a/server/neptune/workflows/activities/temporal/heartbeat.go b/server/neptune/workflows/activities/temporal/heartbeat.go index 7d37481bf..41077dd8f 100644 --- a/server/neptune/workflows/activities/temporal/heartbeat.go +++ b/server/neptune/workflows/activities/temporal/heartbeat.go @@ -2,8 +2,9 @@ package temporal import ( "context" - "go.temporal.io/sdk/activity" "time" + + "go.temporal.io/sdk/activity" ) const HeartbeatTimeout = 5 * time.Second diff --git a/server/neptune/workflows/activities/terraform.go b/server/neptune/workflows/activities/terraform.go index 7c880149c..9c006ff0b 100644 --- a/server/neptune/workflows/activities/terraform.go +++ b/server/neptune/workflows/activities/terraform.go @@ -10,17 +10,15 @@ import ( "strings" "sync" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" - - key "github.com/runatlantis/atlantis/server/neptune/context" - "go.temporal.io/sdk/activity" - "github.com/hashicorp/go-version" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" + key "github.com/runatlantis/atlantis/server/neptune/context" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/file" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/temporal" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "go.temporal.io/sdk/activity" ) const ( diff --git a/server/neptune/workflows/activities/terraform_test.go b/server/neptune/workflows/activities/terraform_test.go index 4dbaea4e4..bb6c709aa 100644 --- a/server/neptune/workflows/activities/terraform_test.go +++ b/server/neptune/workflows/activities/terraform_test.go @@ -7,9 +7,8 @@ import ( "sync" "testing" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" - "github.com/hashicorp/go-version" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/file" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/stretchr/testify/assert" diff --git a/server/neptune/workflows/deploy_test.go b/server/neptune/workflows/deploy_test.go index 8b26ec19e..3dd1d8a48 100644 --- a/server/neptune/workflows/deploy_test.go +++ b/server/neptune/workflows/deploy_test.go @@ -9,17 +9,16 @@ import ( "testing" "time" - "github.com/hashicorp/go-version" - "github.com/runatlantis/atlantis/server/neptune/lyft/feature" - "github.com/google/go-github/v45/github" "github.com/graymeta/stow" "github.com/graymeta/stow/local" + "github.com/hashicorp/go-version" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/config/raw" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/core/runtime/cache" + "github.com/runatlantis/atlantis/server/neptune/lyft/feature" "github.com/runatlantis/atlantis/server/neptune/temporalworker/config" "github.com/runatlantis/atlantis/server/neptune/workflows" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" diff --git a/server/neptune/workflows/internal/deploy/revision/notifier/slack.go b/server/neptune/workflows/internal/deploy/revision/notifier/slack.go index 76505839f..6c199295b 100644 --- a/server/neptune/workflows/internal/deploy/revision/notifier/slack.go +++ b/server/neptune/workflows/internal/deploy/revision/notifier/slack.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/slack-go/slack" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/workflows/internal/deploy/revision/notifier/slack_test.go b/server/neptune/workflows/internal/deploy/revision/notifier/slack_test.go index c98491d91..b95266e92 100644 --- a/server/neptune/workflows/internal/deploy/revision/notifier/slack_test.go +++ b/server/neptune/workflows/internal/deploy/revision/notifier/slack_test.go @@ -8,10 +8,10 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" terraformActivities "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" "github.com/slack-go/slack" "github.com/stretchr/testify/assert" diff --git a/server/neptune/workflows/internal/deploy/revision/queue/deployer.go b/server/neptune/workflows/internal/deploy/revision/queue/deployer.go index 002a3a063..a1c2c1d34 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/deployer.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/deployer.go @@ -4,18 +4,16 @@ import ( "context" "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" - - key "github.com/runatlantis/atlantis/server/neptune/context" - "github.com/pkg/errors" + key "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" terraformActivities "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" + "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/workflows/internal/deploy/revision/queue/deployer_test.go b/server/neptune/workflows/internal/deploy/revision/queue/deployer_test.go index 9989e8dbc..7125ee97e 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/deployer_test.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/deployer_test.go @@ -7,9 +7,6 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" @@ -18,6 +15,8 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" + "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "go.temporal.io/sdk/temporal" diff --git a/server/neptune/workflows/internal/deploy/revision/queue/queue.go b/server/neptune/workflows/internal/deploy/revision/queue/queue.go index 36efa748e..051cecce2 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/queue.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/queue.go @@ -7,10 +7,10 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" activity "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" "go.temporal.io/sdk/workflow" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" ) type Deploy struct { diff --git a/server/neptune/workflows/internal/deploy/revision/queue/queue_test.go b/server/neptune/workflows/internal/deploy/revision/queue/queue_test.go index 52e4beb2b..9cbac7bf9 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/queue_test.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/queue_test.go @@ -5,13 +5,13 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" activity "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/test" "github.com/stretchr/testify/assert" "go.temporal.io/sdk/workflow" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" ) func noopCallback(ctx workflow.Context, q *queue.Deploy) {} diff --git a/server/neptune/workflows/internal/deploy/revision/queue/updater.go b/server/neptune/workflows/internal/deploy/revision/queue/updater.go index 56ad9a04a..7bc6f4355 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/updater.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/updater.go @@ -4,11 +4,10 @@ import ( "fmt" key "github.com/runatlantis/atlantis/server/neptune/context" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" - "go.temporal.io/sdk/workflow" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" + "go.temporal.io/sdk/workflow" ) type CheckRunClient interface { diff --git a/server/neptune/workflows/internal/deploy/revision/queue/updater_test.go b/server/neptune/workflows/internal/deploy/revision/queue/updater_test.go index 7d69b9d04..b5a6bb3ff 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/updater_test.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/updater_test.go @@ -4,20 +4,19 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" tfActivity "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" ) type testCheckRunClient struct { diff --git a/server/neptune/workflows/internal/deploy/revision/queue/worker.go b/server/neptune/workflows/internal/deploy/revision/queue/worker.go index 0272a6c58..35318307d 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/worker.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/worker.go @@ -3,22 +3,19 @@ package queue import ( "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - - key "github.com/runatlantis/atlantis/server/neptune/context" - - metricNames "github.com/runatlantis/atlantis/server/metrics" - "github.com/pkg/errors" + metricNames "github.com/runatlantis/atlantis/server/metrics" internalContext "github.com/runatlantis/atlantis/server/neptune/context" + key "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" tfModel "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" ) type queue interface { diff --git a/server/neptune/workflows/internal/deploy/revision/queue/worker_state_test.go b/server/neptune/workflows/internal/deploy/revision/queue/worker_state_test.go index 169e895b2..ff0a94847 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/worker_state_test.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/worker_state_test.go @@ -9,14 +9,13 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" - "github.com/stretchr/testify/assert" - "go.temporal.io/sdk/testsuite" - "go.temporal.io/sdk/workflow" - + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" internalTerraform "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" + "github.com/stretchr/testify/assert" + "go.temporal.io/sdk/testsuite" + "go.temporal.io/sdk/workflow" ) type testBlockingDeployer struct{} diff --git a/server/neptune/workflows/internal/deploy/revision/queue/worker_test.go b/server/neptune/workflows/internal/deploy/revision/queue/worker_test.go index 01fe172f9..8f0362e85 100644 --- a/server/neptune/workflows/internal/deploy/revision/queue/worker_test.go +++ b/server/neptune/workflows/internal/deploy/revision/queue/worker_test.go @@ -12,11 +12,11 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" internalTerraform "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" terraformWorkflow "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/server/neptune/workflows/internal/deploy/revision/revision.go b/server/neptune/workflows/internal/deploy/revision/revision.go index fdc4f62cb..44a32e2d7 100644 --- a/server/neptune/workflows/internal/deploy/revision/revision.go +++ b/server/neptune/workflows/internal/deploy/revision/revision.go @@ -4,20 +4,18 @@ import ( "context" "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - + "github.com/google/uuid" "github.com/runatlantis/atlantis/server/metrics" key "github.com/runatlantis/atlantis/server/neptune/context" - - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" activity "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/request" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/request/converter" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/workflows/internal/deploy/revision/revision_test.go b/server/neptune/workflows/internal/deploy/revision/revision_test.go index d5226a5e0..084579b4a 100644 --- a/server/neptune/workflows/internal/deploy/revision/revision_test.go +++ b/server/neptune/workflows/internal/deploy/revision/revision_test.go @@ -6,16 +6,15 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/request" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" terraformWorkflow "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" diff --git a/server/neptune/workflows/internal/deploy/terraform/deployment.go b/server/neptune/workflows/internal/deploy/terraform/deployment.go index 6357eceb3..069c1b3b3 100644 --- a/server/neptune/workflows/internal/deploy/terraform/deployment.go +++ b/server/neptune/workflows/internal/deploy/terraform/deployment.go @@ -1,14 +1,12 @@ package terraform import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - + "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/deployment" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" - - "github.com/google/uuid" ) type NotificationConfig struct { diff --git a/server/neptune/workflows/internal/deploy/terraform/state.go b/server/neptune/workflows/internal/deploy/terraform/state.go index 97d36d437..8d806199a 100644 --- a/server/neptune/workflows/internal/deploy/terraform/state.go +++ b/server/neptune/workflows/internal/deploy/terraform/state.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/workflows/internal/deploy/terraform/state_test.go b/server/neptune/workflows/internal/deploy/terraform/state_test.go index 4f4041966..e1f75f551 100644 --- a/server/neptune/workflows/internal/deploy/terraform/state_test.go +++ b/server/neptune/workflows/internal/deploy/terraform/state_test.go @@ -7,13 +7,12 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/lock" internalTerraform "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" "github.com/stretchr/testify/assert" diff --git a/server/neptune/workflows/internal/deploy/workflow.go b/server/neptune/workflows/internal/deploy/workflow.go index 986317743..fcafeaa06 100644 --- a/server/neptune/workflows/internal/deploy/workflow.go +++ b/server/neptune/workflows/internal/deploy/workflow.go @@ -1,7 +1,6 @@ package deploy import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "time" "github.com/pkg/errors" @@ -12,6 +11,7 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/revision/queue" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/deploy/terraform" workflowMetrics "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/sideeffect" temporalInternal "github.com/runatlantis/atlantis/server/neptune/workflows/internal/temporal" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" diff --git a/server/neptune/workflows/internal/notifier/github.go b/server/neptune/workflows/internal/notifier/github.go index 45a7cd081..5f9a8d99f 100644 --- a/server/neptune/workflows/internal/notifier/github.go +++ b/server/neptune/workflows/internal/notifier/github.go @@ -3,6 +3,7 @@ package notifier import ( "context" "fmt" + "github.com/google/uuid" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" diff --git a/server/neptune/workflows/internal/notifier/github_cache_test.go b/server/neptune/workflows/internal/notifier/github_cache_test.go index a38f8efa6..0dba225b9 100644 --- a/server/neptune/workflows/internal/notifier/github_cache_test.go +++ b/server/neptune/workflows/internal/notifier/github_cache_test.go @@ -2,12 +2,12 @@ package notifier_test import ( "context" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "testing" "time" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "go.temporal.io/sdk/testsuite" diff --git a/server/neptune/workflows/internal/notifier/github_test.go b/server/neptune/workflows/internal/notifier/github_test.go index e638ad608..d00385d48 100644 --- a/server/neptune/workflows/internal/notifier/github_test.go +++ b/server/neptune/workflows/internal/notifier/github_test.go @@ -1,7 +1,6 @@ package notifier_test import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "net/url" "testing" "time" @@ -10,6 +9,7 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github/markdown" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" diff --git a/server/neptune/workflows/internal/pr/revision/policy/dismisser.go b/server/neptune/workflows/internal/pr/revision/policy/dismisser.go index efb7e8d4e..de2866fb9 100644 --- a/server/neptune/workflows/internal/pr/revision/policy/dismisser.go +++ b/server/neptune/workflows/internal/pr/revision/policy/dismisser.go @@ -2,11 +2,12 @@ package policy import ( "context" + "sort" + "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "go.temporal.io/sdk/workflow" - "sort" ) type dismisserGithubActivities interface { diff --git a/server/neptune/workflows/internal/pr/revision/policy/dismisser_test.go b/server/neptune/workflows/internal/pr/revision/policy/dismisser_test.go index 86385a82f..0ab76c9e7 100644 --- a/server/neptune/workflows/internal/pr/revision/policy/dismisser_test.go +++ b/server/neptune/workflows/internal/pr/revision/policy/dismisser_test.go @@ -2,6 +2,9 @@ package policy_test import ( "context" + "testing" + "time" + "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" gh "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" @@ -10,8 +13,6 @@ import ( "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "testing" - "time" ) type dismissRequest struct { diff --git a/server/neptune/workflows/internal/pr/revision/policy/filter_test.go b/server/neptune/workflows/internal/pr/revision/policy/filter_test.go index 67073c796..2a4b5ddde 100644 --- a/server/neptune/workflows/internal/pr/revision/policy/filter_test.go +++ b/server/neptune/workflows/internal/pr/revision/policy/filter_test.go @@ -1,11 +1,12 @@ package policy_test import ( + "testing" + "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision/policy" "github.com/stretchr/testify/assert" - "testing" ) func TestFilter_FilterOutTeamA(t *testing.T) { diff --git a/server/neptune/workflows/internal/pr/revision/policy/handler_test.go b/server/neptune/workflows/internal/pr/revision/policy/handler_test.go index fcdbf1615..d1e66f035 100644 --- a/server/neptune/workflows/internal/pr/revision/policy/handler_test.go +++ b/server/neptune/workflows/internal/pr/revision/policy/handler_test.go @@ -2,6 +2,9 @@ package policy_test import ( "context" + "testing" + "time" + "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" gh "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" @@ -13,8 +16,6 @@ import ( "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "testing" - "time" ) type request struct { diff --git a/server/neptune/workflows/internal/pr/revision/processor_test.go b/server/neptune/workflows/internal/pr/revision/processor_test.go index f7d248cd4..511e2ef50 100644 --- a/server/neptune/workflows/internal/pr/revision/processor_test.go +++ b/server/neptune/workflows/internal/pr/revision/processor_test.go @@ -1,6 +1,9 @@ package revision_test import ( + "testing" + "time" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" terraformActivities "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" @@ -11,8 +14,6 @@ import ( "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "testing" - "time" ) const ( diff --git a/server/neptune/workflows/internal/pr/revision/root.go b/server/neptune/workflows/internal/pr/revision/root.go index a06021b65..eacb9e3ce 100644 --- a/server/neptune/workflows/internal/pr/revision/root.go +++ b/server/neptune/workflows/internal/pr/revision/root.go @@ -1,12 +1,11 @@ package revision import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" - "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" + "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" ) type RootInfo struct { diff --git a/server/neptune/workflows/internal/pr/revision/state.go b/server/neptune/workflows/internal/pr/revision/state.go index 633d7f15a..cdaa87d02 100644 --- a/server/neptune/workflows/internal/pr/revision/state.go +++ b/server/neptune/workflows/internal/pr/revision/state.go @@ -2,6 +2,7 @@ package revision import ( "fmt" + "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/metrics" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" diff --git a/server/neptune/workflows/internal/pr/revision/state_test.go b/server/neptune/workflows/internal/pr/revision/state_test.go index e4ffad9a1..06dd0139b 100644 --- a/server/neptune/workflows/internal/pr/revision/state_test.go +++ b/server/neptune/workflows/internal/pr/revision/state_test.go @@ -1,8 +1,6 @@ package revision_test import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "net/url" "testing" "time" @@ -10,6 +8,8 @@ import ( "github.com/google/uuid" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" diff --git a/server/neptune/workflows/internal/pr/runner.go b/server/neptune/workflows/internal/pr/runner.go index 8de8e9d4c..c1cbfc805 100644 --- a/server/neptune/workflows/internal/pr/runner.go +++ b/server/neptune/workflows/internal/pr/runner.go @@ -2,14 +2,14 @@ package pr import ( "context" - tfModel "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" - "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "time" metricNames "github.com/runatlantis/atlantis/server/metrics" internalContext "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + tfModel "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" workflowMetrics "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" + "github.com/runatlantis/atlantis/server/neptune/workflows/internal/notifier" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision/policy" temporalInternal "github.com/runatlantis/atlantis/server/neptune/workflows/internal/temporal" diff --git a/server/neptune/workflows/internal/pr/runner_test.go b/server/neptune/workflows/internal/pr/runner_test.go index 050ab318e..84035c52c 100644 --- a/server/neptune/workflows/internal/pr/runner_test.go +++ b/server/neptune/workflows/internal/pr/runner_test.go @@ -2,6 +2,9 @@ package pr import ( "context" + "testing" + "time" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" @@ -9,8 +12,6 @@ import ( "github.com/stretchr/testify/mock" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "testing" - "time" ) type request struct { diff --git a/server/neptune/workflows/internal/pr/shutdown.go b/server/neptune/workflows/internal/pr/shutdown.go index d94121142..de22742ab 100644 --- a/server/neptune/workflows/internal/pr/shutdown.go +++ b/server/neptune/workflows/internal/pr/shutdown.go @@ -2,6 +2,7 @@ package pr import ( "context" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "go.temporal.io/sdk/workflow" diff --git a/server/neptune/workflows/internal/pr/shutdown_test.go b/server/neptune/workflows/internal/pr/shutdown_test.go index be39fb7a8..d9f2e2126 100644 --- a/server/neptune/workflows/internal/pr/shutdown_test.go +++ b/server/neptune/workflows/internal/pr/shutdown_test.go @@ -2,6 +2,9 @@ package pr_test import ( "context" + "testing" + "time" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr" @@ -9,8 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" - "testing" - "time" ) type request struct { diff --git a/server/neptune/workflows/internal/pr/workflow.go b/server/neptune/workflows/internal/pr/workflow.go index 06e7c4712..8054874fd 100644 --- a/server/neptune/workflows/internal/pr/workflow.go +++ b/server/neptune/workflows/internal/pr/workflow.go @@ -1,12 +1,13 @@ package pr import ( + "strconv" + "time" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities" workflowMetrics "github.com/runatlantis/atlantis/server/neptune/workflows/internal/metrics" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision" "go.temporal.io/sdk/workflow" - "strconv" - "time" ) const TaskQueue = "pr" diff --git a/server/neptune/workflows/internal/temporal/selector.go b/server/neptune/workflows/internal/temporal/selector.go index fb7eda644..174cabdd4 100644 --- a/server/neptune/workflows/internal/temporal/selector.go +++ b/server/neptune/workflows/internal/temporal/selector.go @@ -1,8 +1,9 @@ package temporal import ( - "go.temporal.io/sdk/workflow" "time" + + "go.temporal.io/sdk/workflow" ) // SelectorWithTimeout makes it a bit easier to add Timeout futures diff --git a/server/neptune/workflows/internal/terraform/job/runner.go b/server/neptune/workflows/internal/terraform/job/runner.go index c55686c72..55b357fb2 100644 --- a/server/neptune/workflows/internal/terraform/job/runner.go +++ b/server/neptune/workflows/internal/terraform/job/runner.go @@ -3,12 +3,10 @@ package job import ( "context" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" - - key "github.com/runatlantis/atlantis/server/neptune/context" - "github.com/pkg/errors" + key "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/execute" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "go.temporal.io/sdk/temporal" diff --git a/server/neptune/workflows/internal/terraform/job/runner_test.go b/server/neptune/workflows/internal/terraform/job/runner_test.go index 7c4e4f378..e8a197f55 100644 --- a/server/neptune/workflows/internal/terraform/job/runner_test.go +++ b/server/neptune/workflows/internal/terraform/job/runner_test.go @@ -2,11 +2,11 @@ package job_test import ( "context" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "testing" "time" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/command" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/execute" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" terraform_model "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" diff --git a/server/neptune/workflows/internal/terraform/state/store.go b/server/neptune/workflows/internal/terraform/state/store.go index 049d45fda..52b814182 100644 --- a/server/neptune/workflows/internal/terraform/state/store.go +++ b/server/neptune/workflows/internal/terraform/state/store.go @@ -2,12 +2,12 @@ package state import ( "fmt" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "net/url" "time" "github.com/gorilla/mux" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" ) diff --git a/server/neptune/workflows/internal/terraform/state/workflow.go b/server/neptune/workflows/internal/terraform/state/workflow.go index 43056f898..854be2da7 100644 --- a/server/neptune/workflows/internal/terraform/state/workflow.go +++ b/server/neptune/workflows/internal/terraform/state/workflow.go @@ -1,10 +1,10 @@ package state import ( - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "net/url" "time" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/plugins" diff --git a/server/neptune/workflows/internal/terraform/workflow.go b/server/neptune/workflows/internal/terraform/workflow.go index 0c547c4d1..2053637f5 100644 --- a/server/neptune/workflows/internal/terraform/workflow.go +++ b/server/neptune/workflows/internal/terraform/workflow.go @@ -6,19 +6,17 @@ import ( "net/url" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" - - key "github.com/runatlantis/atlantis/server/neptune/context" - "go.temporal.io/api/enums/v1" - "go.temporal.io/sdk/client" - "github.com/pkg/errors" + key "github.com/runatlantis/atlantis/server/neptune/context" "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/sideeffect" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/gate" runner "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/job" "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" + "go.temporal.io/api/enums/v1" + "go.temporal.io/sdk/client" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" ) diff --git a/server/neptune/workflows/internal/terraform/workflow_test.go b/server/neptune/workflows/internal/terraform/workflow_test.go index f0fbc97b7..e47204277 100644 --- a/server/neptune/workflows/internal/terraform/workflow_test.go +++ b/server/neptune/workflows/internal/terraform/workflow_test.go @@ -8,12 +8,8 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" - - "go.temporal.io/sdk/activity" - "go.temporal.io/sdk/client" - "github.com/runatlantis/atlantis/server/neptune/workflows/activities" + "github.com/runatlantis/atlantis/server/neptune/workflows/activities/conftest" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/execute" "github.com/runatlantis/atlantis/server/neptune/workflows/activities/github" terraformModel "github.com/runatlantis/atlantis/server/neptune/workflows/activities/terraform" @@ -22,6 +18,8 @@ import ( "github.com/runatlantis/atlantis/server/neptune/workflows/internal/terraform/state" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "go.temporal.io/sdk/activity" + "go.temporal.io/sdk/client" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/testsuite" "go.temporal.io/sdk/workflow" diff --git a/server/vcs/markdown/markdown_renderer.go b/server/vcs/markdown/markdown_renderer.go index ae0d479d6..00d8ef038 100644 --- a/server/vcs/markdown/markdown_renderer.go +++ b/server/vcs/markdown/markdown_renderer.go @@ -15,12 +15,11 @@ package markdown import ( "bytes" + _ "embed" // embedding files "fmt" "strings" "text/template" - _ "embed" // embedding files - "github.com/runatlantis/atlantis/server/legacy/events/command" "github.com/runatlantis/atlantis/server/models" "golang.org/x/text/cases" diff --git a/server/vcs/markdown/template_resolver.go b/server/vcs/markdown/template_resolver.go index e790fe4d7..5bf8b7909 100644 --- a/server/vcs/markdown/template_resolver.go +++ b/server/vcs/markdown/template_resolver.go @@ -1,17 +1,15 @@ package markdown import ( + _ "embed" // embedding files "os" "strings" "text/template" - "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" - - _ "embed" // embedding files - "github.com/Masterminds/sprig/v3" "github.com/runatlantis/atlantis/server/config/valid" "github.com/runatlantis/atlantis/server/legacy/events/command" + "github.com/runatlantis/atlantis/server/legacy/events/terraform/filter" "github.com/runatlantis/atlantis/server/models" ) diff --git a/server/vcs/provider/github/converter/comment_event.go b/server/vcs/provider/github/converter/comment_event.go index def80623c..1d8a53f8e 100644 --- a/server/vcs/provider/github/converter/comment_event.go +++ b/server/vcs/provider/github/converter/comment_event.go @@ -4,9 +4,8 @@ import ( "fmt" "time" - "github.com/palantir/go-githubapp/githubapp" - "github.com/google/go-github/v45/github" + "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/event" diff --git a/server/vcs/provider/github/converter/comment_event_test.go b/server/vcs/provider/github/converter/comment_event_test.go index ccaf74574..5585ded87 100644 --- a/server/vcs/provider/github/converter/comment_event_test.go +++ b/server/vcs/provider/github/converter/comment_event_test.go @@ -3,12 +3,11 @@ package converter_test import ( "testing" - "github.com/runatlantis/atlantis/server/vcs" - "github.com/google/go-github/v45/github" "github.com/mohae/deepcopy" "github.com/pkg/errors" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/vcs" "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/stretchr/testify/assert" ) diff --git a/server/vcs/provider/github/converter/pr_review_event_test.go b/server/vcs/provider/github/converter/pr_review_event_test.go index 80f01fb2b..010309baa 100644 --- a/server/vcs/provider/github/converter/pr_review_event_test.go +++ b/server/vcs/provider/github/converter/pr_review_event_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/vcs" - "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/event" + "github.com/runatlantis/atlantis/server/vcs" "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/stretchr/testify/assert" ) diff --git a/server/vcs/provider/github/converter/pull_event.go b/server/vcs/provider/github/converter/pull_event.go index 48ac95624..662c4c8e1 100644 --- a/server/vcs/provider/github/converter/pull_event.go +++ b/server/vcs/provider/github/converter/pull_event.go @@ -5,10 +5,9 @@ import ( "fmt" "time" + "github.com/google/go-github/v45/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" - - "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/gateway/event" ) diff --git a/server/vcs/provider/github/converter/pull_event_test.go b/server/vcs/provider/github/converter/pull_event_test.go index 8d1bcd6a5..60c78d9d8 100644 --- a/server/vcs/provider/github/converter/pull_event_test.go +++ b/server/vcs/provider/github/converter/pull_event_test.go @@ -4,14 +4,13 @@ import ( "context" "testing" - "github.com/runatlantis/atlantis/server/vcs" - "github.com/stretchr/testify/assert" - "github.com/google/go-github/v45/github" "github.com/mohae/deepcopy" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/vcs" "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" . "github.com/runatlantis/atlantis/testing" + "github.com/stretchr/testify/assert" ) var PullEvent = github.PullRequestEvent{ diff --git a/server/vcs/provider/github/converter/pull_test.go b/server/vcs/provider/github/converter/pull_test.go index b05b1a61a..cdc7cb923 100644 --- a/server/vcs/provider/github/converter/pull_test.go +++ b/server/vcs/provider/github/converter/pull_test.go @@ -4,11 +4,10 @@ import ( "testing" "time" - "github.com/runatlantis/atlantis/server/vcs" - "github.com/google/go-github/v45/github" "github.com/mohae/deepcopy" "github.com/runatlantis/atlantis/server/models" + "github.com/runatlantis/atlantis/server/vcs" "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/stretchr/testify/assert" ) diff --git a/server/vcs/provider/github/git_cred_writer_test.go b/server/vcs/provider/github/git_cred_writer_test.go index c7f6bdc52..f23dde2d0 100644 --- a/server/vcs/provider/github/git_cred_writer_test.go +++ b/server/vcs/provider/github/git_cred_writer_test.go @@ -2,13 +2,13 @@ package github_test import ( "fmt" - "github.com/runatlantis/atlantis/server/vcs/provider/github" "os" "os/exec" "path/filepath" "testing" "github.com/runatlantis/atlantis/server/logging" + "github.com/runatlantis/atlantis/server/vcs/provider/github" . "github.com/runatlantis/atlantis/testing" ) diff --git a/server/vcs/provider/github/list_iterator.go b/server/vcs/provider/github/list_iterator.go index f5db50700..94c564c7d 100644 --- a/server/vcs/provider/github/list_iterator.go +++ b/server/vcs/provider/github/list_iterator.go @@ -3,9 +3,10 @@ package github import ( "context" "fmt" + "net/http" + gh "github.com/google/go-github/v45/github" "github.com/pkg/errors" - "net/http" ) func Iterate[T interface{}]( diff --git a/server/vcs/provider/github/list_iterator_test.go b/server/vcs/provider/github/list_iterator_test.go index 57afa2c65..003b59874 100644 --- a/server/vcs/provider/github/list_iterator_test.go +++ b/server/vcs/provider/github/list_iterator_test.go @@ -2,11 +2,12 @@ package github_test import ( "context" + "net/http" + "testing" + gh "github.com/google/go-github/v45/github" "github.com/runatlantis/atlantis/server/vcs/provider/github" "github.com/stretchr/testify/assert" - "net/http" - "testing" ) const ( diff --git a/server/vcs/provider/github/pr_fetcher.go b/server/vcs/provider/github/pr_fetcher.go index 8f5cf907a..3782411c0 100644 --- a/server/vcs/provider/github/pr_fetcher.go +++ b/server/vcs/provider/github/pr_fetcher.go @@ -3,10 +3,11 @@ package github import ( "context" "fmt" + "net/http" + gh "github.com/google/go-github/v45/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors" - "net/http" ) type PRFetcher struct { diff --git a/server/vcs/provider/github/repo_fetcher_test.go b/server/vcs/provider/github/repo_fetcher_test.go index a93d36bc0..6af33bc72 100644 --- a/server/vcs/provider/github/repo_fetcher_test.go +++ b/server/vcs/provider/github/repo_fetcher_test.go @@ -12,13 +12,12 @@ import ( "strings" "testing" - "github.com/uber-go/tally/v4" - "github.com/runatlantis/atlantis/server/legacy/events/vcs/fixtures" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/vcs/provider/github" "github.com/stretchr/testify/assert" + "github.com/uber-go/tally/v4" ) type testTokenGetter struct { diff --git a/server/vcs/provider/github/request/handler.go b/server/vcs/provider/github/request/handler.go index fcfb51456..e1259f72d 100644 --- a/server/vcs/provider/github/request/handler.go +++ b/server/vcs/provider/github/request/handler.go @@ -4,17 +4,15 @@ import ( "context" "fmt" - "github.com/palantir/go-githubapp/githubapp" - "github.com/runatlantis/atlantis/server/legacy/http" - - "github.com/runatlantis/atlantis/server/legacy/controllers/events/handlers" - contextInternal "github.com/runatlantis/atlantis/server/neptune/context" - "github.com/runatlantis/atlantis/server/neptune/gateway/event" - "github.com/google/go-github/v45/github" + "github.com/palantir/go-githubapp/githubapp" "github.com/runatlantis/atlantis/server/legacy/controllers/events/errors" + "github.com/runatlantis/atlantis/server/legacy/controllers/events/handlers" + "github.com/runatlantis/atlantis/server/legacy/http" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/metrics" + contextInternal "github.com/runatlantis/atlantis/server/neptune/context" + "github.com/runatlantis/atlantis/server/neptune/gateway/event" "github.com/runatlantis/atlantis/server/vcs/provider/github/converter" "github.com/uber-go/tally/v4" ) diff --git a/server/vcs/provider/github/request/validator.go b/server/vcs/provider/github/request/validator.go index 569dda258..836360f1d 100644 --- a/server/vcs/provider/github/request/validator.go +++ b/server/vcs/provider/github/request/validator.go @@ -18,9 +18,8 @@ import ( "fmt" "io" - "github.com/runatlantis/atlantis/server/legacy/http" - "github.com/google/go-github/v45/github" + "github.com/runatlantis/atlantis/server/legacy/http" ) type requestValidator interface { diff --git a/server/vcs/provider/github/team_fetcher.go b/server/vcs/provider/github/team_fetcher.go index 05a471523..0c5e5a339 100644 --- a/server/vcs/provider/github/team_fetcher.go +++ b/server/vcs/provider/github/team_fetcher.go @@ -2,6 +2,7 @@ package github import ( "context" + gh "github.com/google/go-github/v45/github" "github.com/palantir/go-githubapp/githubapp" "github.com/pkg/errors"