mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-30 14:56:19 +00:00
## What changed?
Add time-skipping configuration support.
(1) Feature flag in dynamic config
- frontend.TimeSkippingEnabled (namespace bool, default false) gates the
feature
(2) Frontend validation (validateTimeSkippingConfig)
- StartWorkflowExecution
- SignalWithStartWorkflowExecution
- ExecuteMultiOperation (via the shared prepareStartWorkflowRequest
path)
(3) Persistence
- TimeSkippingInfo proto added to WorkflowExecutionInfo
- MutableState stores the config when a workflow starts or options are
updated
(4) Tests
- New timeskipping functional tests in tests/timeskipping_test.go
## Why?
first step of the time skipping project
## How did you test it?
- [x] built
- [x] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
---------
Co-authored-by: Yichao Yang <[email protected]>
45 lines
1.8 KiB
Go
45 lines
1.8 KiB
Go
package signalwithstartworkflow
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.temporal.io/api/workflowservice/v1"
|
|
"go.temporal.io/server/api/historyservice/v1"
|
|
"go.temporal.io/server/common"
|
|
"go.temporal.io/server/common/namespace"
|
|
)
|
|
|
|
func ConvertToStartRequest(
|
|
namespaceID namespace.ID,
|
|
request *workflowservice.SignalWithStartWorkflowExecutionRequest,
|
|
now time.Time,
|
|
) *historyservice.StartWorkflowExecutionRequest {
|
|
req := &workflowservice.StartWorkflowExecutionRequest{
|
|
Namespace: request.GetNamespace(),
|
|
WorkflowId: request.GetWorkflowId(),
|
|
WorkflowType: request.GetWorkflowType(),
|
|
TaskQueue: request.GetTaskQueue(),
|
|
Input: request.GetInput(),
|
|
WorkflowExecutionTimeout: request.GetWorkflowExecutionTimeout(),
|
|
WorkflowRunTimeout: request.GetWorkflowRunTimeout(),
|
|
WorkflowTaskTimeout: request.GetWorkflowTaskTimeout(),
|
|
Identity: request.GetIdentity(),
|
|
RequestId: request.GetRequestId(),
|
|
WorkflowIdReusePolicy: request.GetWorkflowIdReusePolicy(),
|
|
WorkflowIdConflictPolicy: request.GetWorkflowIdConflictPolicy(),
|
|
RetryPolicy: request.GetRetryPolicy(),
|
|
CronSchedule: request.GetCronSchedule(),
|
|
Memo: request.GetMemo(),
|
|
SearchAttributes: request.GetSearchAttributes(),
|
|
Header: request.GetHeader(),
|
|
WorkflowStartDelay: request.GetWorkflowStartDelay(),
|
|
UserMetadata: request.UserMetadata,
|
|
Links: request.GetLinks(),
|
|
VersioningOverride: request.GetVersioningOverride(),
|
|
Priority: request.GetPriority(),
|
|
TimeSkippingConfig: request.GetTimeSkippingConfig(),
|
|
}
|
|
|
|
return common.CreateHistoryStartWorkflowRequest(namespaceID.String(), req, nil, nil, now)
|
|
}
|