mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
## What changed? This PR adds PostResetOperation support to reset API. With this we will be performing certain operations after reset. In this PR - Added support for performing workflow options update. - Updated WorkflowResetter interface. - Added functional test ## Why? Developers/Operators often want to perform certain operations soon after resetting a workflow. Ex: updating worker version, sending signal to workflow etc. These operations need to be performed atomically along with the reset operation. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [x] added new functional test(s)
60 lines
3.1 KiB
Go
60 lines
3.1 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: workflow_resetter.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package ndc -source workflow_resetter.go -destination workflow_resetter_mock.go
|
|
//
|
|
|
|
// Package ndc is a generated GoMock package.
|
|
package ndc
|
|
|
|
import (
|
|
context "context"
|
|
reflect "reflect"
|
|
|
|
enums "go.temporal.io/api/enums/v1"
|
|
history "go.temporal.io/api/history/v1"
|
|
workflow "go.temporal.io/api/workflow/v1"
|
|
namespace "go.temporal.io/server/common/namespace"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockWorkflowResetter is a mock of WorkflowResetter interface.
|
|
type MockWorkflowResetter struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockWorkflowResetterMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockWorkflowResetterMockRecorder is the mock recorder for MockWorkflowResetter.
|
|
type MockWorkflowResetterMockRecorder struct {
|
|
mock *MockWorkflowResetter
|
|
}
|
|
|
|
// NewMockWorkflowResetter creates a new mock instance.
|
|
func NewMockWorkflowResetter(ctrl *gomock.Controller) *MockWorkflowResetter {
|
|
mock := &MockWorkflowResetter{ctrl: ctrl}
|
|
mock.recorder = &MockWorkflowResetterMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockWorkflowResetter) EXPECT() *MockWorkflowResetterMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// ResetWorkflow mocks base method.
|
|
func (m *MockWorkflowResetter) ResetWorkflow(ctx context.Context, namespaceID namespace.ID, workflowID, baseRunID string, baseBranchToken []byte, baseRebuildLastEventID, baseRebuildLastEventVersion, baseNextEventID int64, resetRunID, resetRequestID string, baseWorkflow, currentWorkflow Workflow, resetReason string, additionalReapplyEvents []*history.HistoryEvent, resetReapplyExcludeTypes map[enums.ResetReapplyExcludeType]struct{}, allowResetWithPendingChildren bool, postResetOperations []*workflow.PostResetOperation) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "ResetWorkflow", ctx, namespaceID, workflowID, baseRunID, baseBranchToken, baseRebuildLastEventID, baseRebuildLastEventVersion, baseNextEventID, resetRunID, resetRequestID, baseWorkflow, currentWorkflow, resetReason, additionalReapplyEvents, resetReapplyExcludeTypes, allowResetWithPendingChildren, postResetOperations)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// ResetWorkflow indicates an expected call of ResetWorkflow.
|
|
func (mr *MockWorkflowResetterMockRecorder) ResetWorkflow(ctx, namespaceID, workflowID, baseRunID, baseBranchToken, baseRebuildLastEventID, baseRebuildLastEventVersion, baseNextEventID, resetRunID, resetRequestID, baseWorkflow, currentWorkflow, resetReason, additionalReapplyEvents, resetReapplyExcludeTypes, allowResetWithPendingChildren, postResetOperations any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetWorkflow", reflect.TypeOf((*MockWorkflowResetter)(nil).ResetWorkflow), ctx, namespaceID, workflowID, baseRunID, baseBranchToken, baseRebuildLastEventID, baseRebuildLastEventVersion, baseNextEventID, resetRunID, resetRequestID, baseWorkflow, currentWorkflow, resetReason, additionalReapplyEvents, resetReapplyExcludeTypes, allowResetWithPendingChildren, postResetOperations)
|
|
}
|