From b490226258b17a54aab79e2e3d895323856c291f Mon Sep 17 00:00:00 2001 From: Shawna Monero Date: Wed, 7 Aug 2024 21:36:06 -0700 Subject: [PATCH] does it still work? --- .../event/modified_pull_request_handler.go | 4 --- .../modified_pull_request_handler_test.go | 27 ------------------- 2 files changed, 31 deletions(-) diff --git a/server/neptune/gateway/event/modified_pull_request_handler.go b/server/neptune/gateway/event/modified_pull_request_handler.go index 11c00b7ac..67598b581 100644 --- a/server/neptune/gateway/event/modified_pull_request_handler.go +++ b/server/neptune/gateway/event/modified_pull_request_handler.go @@ -19,10 +19,6 @@ import ( "github.com/runatlantis/atlantis/server/models" ) -type legacyHandler interface { - Handle(ctx context.Context, request *http.BufferedRequest, event PullRequest, allRoots []*valid.MergedProjectCfg) error -} - type prSignaler interface { SignalWithStartWorkflow(ctx context.Context, rootCfgs []*valid.MergedProjectCfg, prRequest pr.Request) (client.WorkflowRun, error) } diff --git a/server/neptune/gateway/event/modified_pull_request_handler_test.go b/server/neptune/gateway/event/modified_pull_request_handler_test.go index 391d020dc..97f13593f 100644 --- a/server/neptune/gateway/event/modified_pull_request_handler_test.go +++ b/server/neptune/gateway/event/modified_pull_request_handler_test.go @@ -106,11 +106,6 @@ func TestModifiedPullHandler_Handle_BranchStrategy(t *testing.T) { pull := event.PullRequest{ Pull: pullRequest, } - legacyHandler := &mockLegacyHandler{ - expectedEvent: pull, - expectedAllRoots: []*valid.MergedProjectCfg{legacyRoot}, - expectedT: t, - } prRequest := pr.Request{ Revision: "sha", Repo: testRepo, @@ -143,7 +138,6 @@ func TestModifiedPullHandler_Handle_BranchStrategy(t *testing.T) { } err := pullHandler.Handle(context.Background(), &http.BufferedRequest{}, pull) assert.NoError(t, err) - assert.True(t, legacyHandler.called) assert.True(t, signaler.called) } @@ -191,11 +185,6 @@ func TestModifiedPullHandler_Handle_MergeStrategy(t *testing.T) { pr := event.PullRequest{ Pull: pullRequest, } - legacyHandler := &mockLegacyHandler{ - expectedEvent: pr, - expectedAllRoots: []*valid.MergedProjectCfg{root}, - expectedT: t, - } pullHandler := event.ModifiedPullHandler{ Logger: logger, Scheduler: &sync.SynchronousScheduler{Logger: logger}, @@ -210,7 +199,6 @@ func TestModifiedPullHandler_Handle_MergeStrategy(t *testing.T) { } err := pullHandler.Handle(context.Background(), &http.BufferedRequest{}, pr) assert.NoError(t, err) - assert.True(t, legacyHandler.called) assert.True(t, signaler.called) } @@ -231,21 +219,6 @@ func (r *mockConfigBuilder) Build(_ context.Context, commit *config.RepoCommit, return r.rootConfigs, r.error } -type mockLegacyHandler struct { - expectedEvent event.PullRequest - expectedAllRoots []*valid.MergedProjectCfg - expectedT *testing.T - error error - called bool -} - -func (l *mockLegacyHandler) Handle(ctx context.Context, _ *http.BufferedRequest, event event.PullRequest, allRoots []*valid.MergedProjectCfg) error { - l.called = true - assert.Equal(l.expectedT, l.expectedEvent, event) - assert.Equal(l.expectedT, l.expectedAllRoots, allRoots) - return l.error -} - type mockPRSignaler struct { called bool error error