Skip to content

Commit

Permalink
Remove unused param from reapplyContinueAsNewWorkflowEvents() (#6606)
Browse files Browse the repository at this point in the history
  • Loading branch information
gow authored Oct 5, 2024
1 parent e6e61ed commit 3207d6a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions service/history/ndc/workflow_resetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func (r *workflowResetterImpl) ResetWorkflow(
var currentWorkflowEventsSeq []*persistence.WorkflowEvents
var reapplyEventsFn workflowResetReapplyEventsFn
currentMutableState := currentWorkflow.GetMutableState()
currentUpdateRegistry := currentWorkflow.GetContext().UpdateRegistry(ctx, nil)
if currentMutableState.IsWorkflowExecutionRunning() {
if err := r.terminateWorkflow(
currentMutableState,
Expand All @@ -157,7 +156,6 @@ func (r *workflowResetterImpl) ResetWorkflow(
lastVisitedRunID, err := r.reapplyContinueAsNewWorkflowEvents(
ctx,
resetMutableState,
currentUpdateRegistry,
currentWorkflow,
namespaceID,
workflowID,
Expand Down Expand Up @@ -185,7 +183,6 @@ func (r *workflowResetterImpl) ResetWorkflow(
_, err := r.reapplyContinueAsNewWorkflowEvents(
ctx,
resetMutableState,
currentUpdateRegistry,
currentWorkflow,
namespaceID,
workflowID,
Expand Down Expand Up @@ -575,7 +572,6 @@ func (r *workflowResetterImpl) terminateWorkflow(
func (r *workflowResetterImpl) reapplyContinueAsNewWorkflowEvents(
ctx context.Context,
resetMutableState workflow.MutableState,
currentUpdateRegistry update.Registry,
currentWorkflow Workflow,
namespaceID namespace.ID,
workflowID string,
Expand Down
9 changes: 0 additions & 9 deletions service/history/ndc/workflow_resetter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import (
"go.temporal.io/server/service/history/tests"
"go.temporal.io/server/service/history/workflow"
wcache "go.temporal.io/server/service/history/workflow/cache"
"go.temporal.io/server/service/history/workflow/update"
"go.uber.org/mock/gomock"
"google.golang.org/protobuf/types/known/timestamppb"
)
Expand Down Expand Up @@ -602,9 +601,6 @@ func (s *workflowResetterSuite) TestReapplyContinueAsNewWorkflowEvents_WithOutCo
}, nil)

mutableState := workflow.NewMockMutableState(s.controller)
mutableState.EXPECT().VisitUpdates(gomock.Any()).Return()
mutableState.EXPECT().GetCurrentVersion().Return(int64(0))
currentUpdateRegistry := update.NewRegistry(mutableState)
currentWorkflow := NewMockWorkflow(s.controller)
smReg := hsm.NewRegistry()
s.NoError(workflow.RegisterStateMachine(smReg))
Expand All @@ -615,7 +611,6 @@ func (s *workflowResetterSuite) TestReapplyContinueAsNewWorkflowEvents_WithOutCo
lastVisitedRunID, err := s.workflowResetter.reapplyContinueAsNewWorkflowEvents(
ctx,
mutableState,
currentUpdateRegistry,
currentWorkflow,
s.namespaceID,
s.workflowID,
Expand Down Expand Up @@ -732,10 +727,7 @@ func (s *workflowResetterSuite) TestReapplyContinueAsNewWorkflowEvents_WithConti
s.NoError(err)

mutableState := workflow.NewMockMutableState(s.controller)
mutableState.EXPECT().VisitUpdates(gomock.Any()).Return()
mutableState.EXPECT().GetCurrentVersion().Return(int64(0))
mutableState.EXPECT().GetWorkflowKey().Return(definition.WorkflowKey{RunID: "random-run-id"})
currentUpdateRegistry := update.NewRegistry(mutableState)
currentWorkflow := NewMockWorkflow(s.controller)
currentWorkflow.EXPECT().GetMutableState().Return(mutableState)
smReg := hsm.NewRegistry()
Expand All @@ -747,7 +739,6 @@ func (s *workflowResetterSuite) TestReapplyContinueAsNewWorkflowEvents_WithConti
lastVisitedRunID, err := s.workflowResetter.reapplyContinueAsNewWorkflowEvents(
ctx,
mutableState,
currentUpdateRegistry,
currentWorkflow,
s.namespaceID,
s.workflowID,
Expand Down

0 comments on commit 3207d6a

Please sign in to comment.