Skip to content

Commit ccb28ef

Browse files
authoredDec 12, 2024··
Versioning 3 (#1744)
1 parent 3ed8816 commit ccb28ef

34 files changed

+2893
-76
lines changed
 

‎.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ jobs:
8888
- name: Docker compose - integration tests
8989
if: ${{ matrix.testDockerCompose }}
9090
run: go run . integration-test
91+
env:
92+
# TODO(antlai-temporal): Remove this flag once server 1.26.2 released.
93+
DISABLE_DEPLOYMENT_TESTS: "1"
9194
working-directory: ./internal/cmd/build
9295

9396
cloud-test:

‎client/client.go

+132
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,36 @@ import (
4646
"go.temporal.io/sdk/internal/common/metrics"
4747
)
4848

49+
// DeploymentReachability specifies which category of tasks may reach a worker
50+
// associated with a deployment, simplifying safe decommission.
51+
// NOTE: Experimental
52+
type DeploymentReachability = internal.DeploymentReachability
53+
54+
const (
55+
// DeploymentReachabilityUnspecified - Reachability level not specified.
56+
// NOTE: Experimental
57+
DeploymentReachabilityUnspecified = internal.DeploymentReachabilityUnspecified
58+
59+
// DeploymentReachabilityReachable - The deployment is reachable by new
60+
// and/or open workflows. The deployment cannot be decommissioned safely.
61+
// NOTE: Experimental
62+
DeploymentReachabilityReachable = internal.DeploymentReachabilityReachable
63+
64+
// DeploymentReachabilityClosedWorkflows - The deployment is not reachable
65+
// by new or open workflows, but might be still needed by
66+
// Queries sent to closed workflows. The deployment can be decommissioned
67+
// safely if user does not query closed workflows.
68+
// NOTE: Experimental
69+
DeploymentReachabilityClosedWorkflows = internal.DeploymentReachabilityClosedWorkflows
70+
71+
// DeploymentReachabilityUnreachable - The deployment is not reachable by
72+
// any workflow because all the workflows who needed this
73+
// deployment are out of the retention period. The deployment can be
74+
// decommissioned safely.
75+
// NOTE: Experimental
76+
DeploymentReachabilityUnreachable = internal.DeploymentReachabilityUnreachable
77+
)
78+
4979
// TaskReachability specifies which category of tasks may reach a worker on a versioned task queue.
5080
// Used both in a reachability query and its response.
5181
//
@@ -273,6 +303,97 @@ type (
273303
// NOTE: Experimental
274304
UpdateWithStartWorkflowOptions = internal.UpdateWithStartWorkflowOptions
275305

306+
// Deployment identifies a set of workers. This identifier combines
307+
// the deployment series name with their Build ID.
308+
// NOTE: Experimental
309+
Deployment = internal.Deployment
310+
311+
// DeploymentTaskQueueInfo describes properties of the Task Queues involved
312+
// in a deployment.
313+
// NOTE: Experimental
314+
DeploymentTaskQueueInfo = internal.DeploymentTaskQueueInfo
315+
316+
// DeploymentInfo holds information associated with
317+
// workers in this deployment.
318+
// Workers can poll multiple task queues in a single deployment,
319+
// which are listed in this message.
320+
// NOTE: Experimental
321+
DeploymentInfo = internal.DeploymentInfo
322+
323+
// DeploymentListEntry is a subset of fields from DeploymentInfo.
324+
// NOTE: Experimental
325+
DeploymentListEntry = internal.DeploymentListEntry
326+
327+
// DeploymentListIterator is an iterator for deployments.
328+
// NOTE: Experimental
329+
DeploymentListIterator = internal.DeploymentListIterator
330+
331+
// DeploymentListOptions are the parameters for configuring listing deployments.
332+
// NOTE: Experimental
333+
DeploymentListOptions = internal.DeploymentListOptions
334+
335+
// DeploymentReachabilityInfo extends DeploymentInfo with reachability information.
336+
// NOTE: Experimental
337+
DeploymentReachabilityInfo = internal.DeploymentReachabilityInfo
338+
339+
// DeploymentMetadataUpdate modifies user-defined metadata entries that describe
340+
// a deployment.
341+
// NOTE: Experimental
342+
DeploymentMetadataUpdate = internal.DeploymentMetadataUpdate
343+
344+
// DeploymentDescribeOptions provides options for [DeploymentClient.Describe].
345+
// NOTE: Experimental
346+
DeploymentDescribeOptions = internal.DeploymentDescribeOptions
347+
348+
// DeploymentDescription is the response type for [DeploymentClient.Describe].
349+
// NOTE: Experimental
350+
DeploymentDescription = internal.DeploymentDescription
351+
352+
// DeploymentGetReachabilityOptions provides options for [DeploymentClient.GetReachability].
353+
// NOTE: Experimental
354+
DeploymentGetReachabilityOptions = internal.DeploymentGetReachabilityOptions
355+
356+
// DeploymentGetCurrentOptions provides options for [DeploymentClient.GetCurrent].
357+
// NOTE: Experimental
358+
DeploymentGetCurrentOptions = internal.DeploymentGetCurrentOptions
359+
360+
// DeploymentGetCurrentResponse is the response type for [DeploymentClient.GetCurrent].
361+
// NOTE: Experimental
362+
DeploymentGetCurrentResponse = internal.DeploymentGetCurrentResponse
363+
364+
// DeploymentSetCurrentOptions provides options for [DeploymentClient.SetCurrent].
365+
// NOTE: Experimental
366+
DeploymentSetCurrentOptions = internal.DeploymentSetCurrentOptions
367+
368+
// DeploymentSetCurrentResponse is the response type for [DeploymentClient.SetCurrent].
369+
// NOTE: Experimental
370+
DeploymentSetCurrentResponse = internal.DeploymentSetCurrentResponse
371+
372+
// DeploymentClient is the server interface to manage deployments.
373+
// NOTE: Experimental
374+
DeploymentClient = internal.DeploymentClient
375+
376+
// UpdateWorkflowExecutionOptionsRequest is a request for [Client.UpdateWorkflowExecutionOptions].
377+
// NOTE: Experimental
378+
UpdateWorkflowExecutionOptionsRequest = internal.UpdateWorkflowExecutionOptionsRequest
379+
380+
// WorkflowExecutionOptions contains a set of properties of an existing workflow
381+
// that can be overriden using [UpdateWorkflowExecutionOptions].
382+
// NOTE: Experimental
383+
WorkflowExecutionOptions = internal.WorkflowExecutionOptions
384+
385+
// WorkflowExecutionOptionsChanges describes changes to [WorkflowExecutionOptions]
386+
// in the [UpdateWorkflowExecutionOptions] API.
387+
// NOTE: Experimental
388+
WorkflowExecutionOptionsChanges = internal.WorkflowExecutionOptionsChanges
389+
390+
// VersioningOverride is a property in [WorkflowExecutionOptions] that changes the versioning
391+
// configuration of a specific workflow execution.
392+
// If set, it takes precedence over the Versioning Behavior provided with workflow type registration, or
393+
// default worker options.
394+
// NOTE: Experimental
395+
VersioningOverride = internal.VersioningOverride
396+
276397
// WorkflowUpdateHandle represents a running or completed workflow
277398
// execution update and gives the holder access to the outcome of the same.
278399
WorkflowUpdateHandle = internal.WorkflowUpdateHandle
@@ -837,6 +958,13 @@ type (
837958
// - WorkflowUpdateServiceTimeoutOrCanceledError
838959
UpdateWorkflow(ctx context.Context, options UpdateWorkflowOptions) (WorkflowUpdateHandle, error)
839960

961+
// UpdateWorkflowExecutionOptions partially overrides the [WorkflowExecutionOptions] of an existing workflow execution
962+
// and returns the new [WorkflowExecutionOptions] after applying the changes.
963+
// It is intended for building tools that can selectively apply ad-hoc workflow configuration changes.
964+
// Use [DescribeWorkflowExecution] to get similar information without modifying options.
965+
// NOTE: Experimental
966+
UpdateWorkflowExecutionOptions(ctx context.Context, options UpdateWorkflowExecutionOptionsRequest) (WorkflowExecutionOptions, error)
967+
840968
// UpdateWithStartWorkflow issues an update-with-start request. A
841969
// WorkflowIDConflictPolicy must be set in the options. If the specified
842970
// workflow execution is not running, then a new workflow execution is
@@ -867,6 +995,10 @@ type (
867995
// Schedule creates a new shedule client with the same gRPC connection as this client.
868996
ScheduleClient() ScheduleClient
869997

998+
// DeploymentClient create a new deployment client with the same gRPC connection as this client.
999+
// NOTE: Experimental
1000+
DeploymentClient() DeploymentClient
1001+
8701002
// Close client and clean up underlying resources.
8711003
//
8721004
// If this client was created via NewClientFromExisting or this client has

‎internal/client.go

+17
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ type (
341341
// - serviceerror.NotFound
342342
DescribeWorkflowExecution(ctx context.Context, workflowID, runID string) (*workflowservice.DescribeWorkflowExecutionResponse, error)
343343

344+
// UpdateWorkflowExecutionOptions partially overrides the [WorkflowExecutionOptions] of an existing workflow execution
345+
// and returns the new [WorkflowExecutionOptions] after applying the changes.
346+
// It is intended for building tools that can selectively apply ad-hoc workflow configuration changes.
347+
// NOTE: Experimental
348+
UpdateWorkflowExecutionOptions(ctx context.Context, options UpdateWorkflowExecutionOptionsRequest) (WorkflowExecutionOptions, error)
349+
344350
// DescribeTaskQueue returns information about the target taskqueue, right now this API returns the
345351
// pollers which polled this taskqueue in last few minutes.
346352
// The errors it can return:
@@ -429,6 +435,9 @@ type (
429435
// Schedule creates a new shedule client with the same gRPC connection as this client.
430436
ScheduleClient() ScheduleClient
431437

438+
// DeploymentClient creates a new deployment client with the same gRPC connection as this client.
439+
DeploymentClient() DeploymentClient
440+
432441
// Close client and clean up underlying resources.
433442
Close()
434443
}
@@ -757,6 +766,14 @@ type (
757766
// NOTE: Experimental
758767
StaticDetails string
759768

769+
// VersioningOverride - Sets the versioning configuration of a specific workflow execution, ignoring current
770+
// server or worker default policies. This enables running canary tests without affecting existing workflows.
771+
// To unset the override after the workflow is running, use [UpdateWorkflowExecutionOptions].
772+
// Optional: defaults to no override.
773+
//
774+
// NOTE: Experimental
775+
VersioningOverride VersioningOverride
776+
760777
// request ID. Only settable by the SDK - e.g. [temporalnexus.workflowRunOperation].
761778
requestID string
762779
// workflow completion callback. Only settable by the SDK - e.g. [temporalnexus.workflowRunOperation].

‎internal/cmd/build/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (b *builder) integrationTest() error {
145145
Namespace: "integration-test-namespace",
146146
},
147147
CachedDownload: testsuite.CachedDownload{
148-
Version: "v1.1.0",
148+
Version: "v1.2.0-versioning.0",
149149
},
150150
LogLevel: "warn",
151151
ExtraArgs: []string{
@@ -160,6 +160,7 @@ func (b *builder) integrationTest() error {
160160
"--dynamic-config-value", "system.forceSearchAttributesCacheRefreshOnRead=true",
161161
"--dynamic-config-value", "worker.buildIdScavengerEnabled=true",
162162
"--dynamic-config-value", "worker.removableBuildIdDurationSinceDefault=1",
163+
"--dynamic-config-value", "system.enableDeployments=true",
163164
// All of the below is required for Nexus tests.
164165
"--http-port", "7243",
165166
"--dynamic-config-value", "system.enableNexus=true",

0 commit comments

Comments
 (0)
Please sign in to comment.