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

add start delay #78

Merged
merged 6 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
83 changes: 44 additions & 39 deletions gen/iwfidl/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -485,10 +485,10 @@ components:
type: object
WorkflowRetryPolicy:
example:
maximumAttempts: 7
initialIntervalSeconds: 3
maximumIntervalSeconds: 4
backoffCoefficient: 2.027123
maximumAttempts: 1
initialIntervalSeconds: 2
maximumIntervalSeconds: 7
backoffCoefficient: 4.145608
properties:
initialIntervalSeconds:
type: integer
Expand Down Expand Up @@ -573,22 +573,23 @@ components:
type: object
WorkflowStartOptions:
example:
workflowStartDelaySeconds: 3
retryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 3
maximumIntervalSeconds: 4
backoffCoefficient: 2.027123
maximumAttempts: 1
initialIntervalSeconds: 2
maximumIntervalSeconds: 7
backoffCoefficient: 4.145608
workflowConfigOverride:
disableSystemSearchAttribute: true
continueAsNewThreshold: 1
continueAsNewPageSizeInBytes: 6
continueAsNewThreshold: 6
continueAsNewPageSizeInBytes: 7
idReusePolicy: null
searchAttributes:
- stringValue: stringValue
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -597,7 +598,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -609,6 +610,9 @@ components:
$ref: '#/components/schemas/IDReusePolicy'
cronSchedule:
type: string
workflowStartDelaySeconds:
format: int32
type: integer
retryPolicy:
$ref: '#/components/schemas/WorkflowRetryPolicy'
searchAttributes:
Expand Down Expand Up @@ -741,22 +745,23 @@ components:
persistenceLoadingType: null
iwfWorkflowType: iwfWorkflowType
workflowStartOptions:
workflowStartDelaySeconds: 3
retryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 3
maximumIntervalSeconds: 4
backoffCoefficient: 2.027123
maximumAttempts: 1
initialIntervalSeconds: 2
maximumIntervalSeconds: 7
backoffCoefficient: 4.145608
workflowConfigOverride:
disableSystemSearchAttribute: true
continueAsNewThreshold: 1
continueAsNewPageSizeInBytes: 6
continueAsNewThreshold: 6
continueAsNewPageSizeInBytes: 7
idReusePolicy: null
searchAttributes:
- stringValue: stringValue
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -765,7 +770,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -923,7 +928,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -932,7 +937,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1249,7 +1254,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1258,7 +1263,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1305,7 +1310,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1314,7 +1319,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1494,7 +1499,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1503,7 +1508,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1559,8 +1564,8 @@ components:
example:
workflowConfig:
disableSystemSearchAttribute: true
continueAsNewThreshold: 1
continueAsNewPageSizeInBytes: 6
continueAsNewThreshold: 6
continueAsNewPageSizeInBytes: 7
workflowRunId: workflowRunId
workflowId: workflowId
properties:
Expand All @@ -1581,7 +1586,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1590,7 +1595,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1737,7 +1742,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1746,7 +1751,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -1798,7 +1803,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand All @@ -1807,7 +1812,7 @@ components:
valueType: null
integerValue: 1
boolValue: true
doubleValue: 1.0246457001441578
doubleValue: 1.4894159098541704
stringArrayValue:
- stringArrayValue
- stringArrayValue
Expand Down Expand Up @@ -2396,8 +2401,8 @@ components:
WorkflowConfig:
example:
disableSystemSearchAttribute: true
continueAsNewThreshold: 1
continueAsNewPageSizeInBytes: 6
continueAsNewThreshold: 6
continueAsNewPageSizeInBytes: 7
properties:
disableSystemSearchAttribute:
type: boolean
Expand Down
26 changes: 26 additions & 0 deletions gen/iwfidl/docs/WorkflowStartOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**IdReusePolicy** | Pointer to [**IDReusePolicy**](IDReusePolicy.md) | | [optional]
**CronSchedule** | Pointer to **string** | | [optional]
**WorkflowStartDelaySeconds** | Pointer to **int32** | | [optional]
**RetryPolicy** | Pointer to [**WorkflowRetryPolicy**](WorkflowRetryPolicy.md) | | [optional]
**SearchAttributes** | Pointer to [**[]SearchAttribute**](SearchAttribute.md) | | [optional]
**WorkflowConfigOverride** | Pointer to [**WorkflowConfig**](WorkflowConfig.md) | | [optional]
Expand Down Expand Up @@ -80,6 +81,31 @@ SetCronSchedule sets CronSchedule field to given value.

HasCronSchedule returns a boolean if a field has been set.

### GetWorkflowStartDelaySeconds

`func (o *WorkflowStartOptions) GetWorkflowStartDelaySeconds() int32`

GetWorkflowStartDelaySeconds returns the WorkflowStartDelaySeconds field if non-nil, zero value otherwise.

### GetWorkflowStartDelaySecondsOk

`func (o *WorkflowStartOptions) GetWorkflowStartDelaySecondsOk() (*int32, bool)`

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

### SetWorkflowStartDelaySeconds

`func (o *WorkflowStartOptions) SetWorkflowStartDelaySeconds(v int32)`

SetWorkflowStartDelaySeconds sets WorkflowStartDelaySeconds field to given value.

### HasWorkflowStartDelaySeconds

`func (o *WorkflowStartOptions) HasWorkflowStartDelaySeconds() bool`

HasWorkflowStartDelaySeconds returns a boolean if a field has been set.

### GetRetryPolicy

`func (o *WorkflowStartOptions) GetRetryPolicy() WorkflowRetryPolicy`
Expand Down
48 changes: 42 additions & 6 deletions gen/iwfidl/model_workflow_start_options.go

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

2 changes: 1 addition & 1 deletion integ/workflow_uncompleted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestStateApiTimeoutWorkflow(t *testing.T) {

fmt.Println(err)

expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error (type: StateApiWaitUntil, scheduledEventID: 9, startedEventID: 10, identity: ): activity StartToClose timeout (type: StartToClose)"
expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error (type: StateApiWaitUntil, scheduledEventID: 8, startedEventID: 9, identity: ): activity StartToClose timeout (type: StartToClose)"
assert.Equal(t, expectedMsg, err.Error())

out, err2 := client.GetComplexWorkflowResults(context.Background(), wfId, "")
Expand Down
2 changes: 1 addition & 1 deletion iwf-idl
Submodule iwf-idl updated 2 files
+3 −0 iwf-sdk.yaml
+3 −0 iwf.yaml
1 change: 1 addition & 0 deletions iwf/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func (c *clientImpl) StartWorkflow(ctx context.Context, workflow ObjectWorkflow,
unregOpt.WorkflowIdReusePolicy = options.WorkflowIdReusePolicy
unregOpt.WorkflowRetryPolicy = options.WorkflowRetryPolicy
unregOpt.WorkflowCronSchedule = options.WorkflowCronSchedule
unregOpt.WorkflowStartDelaySeconds = options.WorkflowStartDelaySeconds

saTypes := c.registry.getSearchAttributeTypeStore(wfType)

Expand Down
Loading
Loading