Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IWF-335: support skipping update methods for reset #486

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gen/iwfidl/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@ components:
skipSignalReapply: true
workflowRunId: workflowRunId
workflowId: workflowId
skipUpdateReapply: true
stateExecutionId: stateExecutionId
properties:
workflowId:
Expand All @@ -1448,6 +1449,8 @@ components:
type: string
skipSignalReapply:
type: boolean
skipUpdateReapply:
type: boolean
required:
- resetType
- workflowId
Expand Down
26 changes: 26 additions & 0 deletions gen/iwfidl/docs/WorkflowResetRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Type | Description | Notes
**StateId** | Pointer to **string** | | [optional]
**StateExecutionId** | Pointer to **string** | | [optional]
**SkipSignalReapply** | Pointer to **bool** | | [optional]
**SkipUpdateReapply** | Pointer to **bool** | | [optional]

## Methods

Expand Down Expand Up @@ -248,6 +249,31 @@ SetSkipSignalReapply sets SkipSignalReapply field to given value.

HasSkipSignalReapply returns a boolean if a field has been set.

### GetSkipUpdateReapply

`func (o *WorkflowResetRequest) GetSkipUpdateReapply() bool`

GetSkipUpdateReapply returns the SkipUpdateReapply field if non-nil, zero value otherwise.

### GetSkipUpdateReapplyOk

`func (o *WorkflowResetRequest) GetSkipUpdateReapplyOk() (*bool, bool)`

GetSkipUpdateReapplyOk returns a tuple with the SkipUpdateReapply field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetSkipUpdateReapply

`func (o *WorkflowResetRequest) SetSkipUpdateReapply(v bool)`

SetSkipUpdateReapply sets SkipUpdateReapply field to given value.

### HasSkipUpdateReapply

`func (o *WorkflowResetRequest) HasSkipUpdateReapply() bool`

HasSkipUpdateReapply returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
36 changes: 36 additions & 0 deletions gen/iwfidl/model_workflow_reset_request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions service/client/temporal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,12 @@ func (t *temporalClient) ResetWorkflow(
}

requestId := uuid.New().String()
resetReapplyType := enums.RESET_REAPPLY_TYPE_SIGNAL
var resetReapplyExcludeTypes []enums.ResetReapplyExcludeType
if request.GetSkipSignalReapply() {
resetReapplyType = enums.RESET_REAPPLY_TYPE_NONE
resetReapplyExcludeTypes = append(resetReapplyExcludeTypes, enums.RESET_REAPPLY_EXCLUDE_TYPE_SIGNAL)
}
if request.GetSkipUpdateReapply() {
resetReapplyExcludeTypes = append(resetReapplyExcludeTypes, enums.RESET_REAPPLY_EXCLUDE_TYPE_UPDATE)
}

resp, err := t.tClient.ResetWorkflowExecution(ctx, &workflowservice.ResetWorkflowExecutionRequest{
Expand All @@ -448,7 +451,7 @@ func (t *temporalClient) ResetWorkflow(
Reason: request.GetReason(),
WorkflowTaskFinishEventId: resetEventId,
RequestId: requestId,
ResetReapplyType: resetReapplyType,
ResetReapplyExcludeTypes: resetReapplyExcludeTypes,
})

if err != nil {
Expand Down
Loading