Skip to content

change Version to struct, prevent misconfiguration of VersioningOverride #579

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

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c07b10
prevent misconfiguration of VersioningOverride and add more pinned op…
carlydf Apr 26, 2025
5077472
pushing without make proto for feedback
carlydf Apr 29, 2025
56c61ba
stash
carlydf Apr 29, 2025
aa76424
Merge branch 'master' of github.com:temporalio/api into versioning-ov…
carlydf Apr 29, 2025
d0c70f5
committing without full make proto for feedback
carlydf Apr 29, 2025
e8ee98b
make names more consistent
carlydf Apr 29, 2025
60a9f0b
make proto
carlydf Apr 29, 2025
7e3392d
deprecate old fields instead of deleting
carlydf Apr 29, 2025
7829554
restore deleted comments about meaning of unversioned
carlydf Apr 29, 2025
b808ee1
Update temporal/api/deployment/v1/message.proto
carlydf Apr 29, 2025
8f67779
Update temporal/api/workflow/v1/message.proto
carlydf Apr 29, 2025
273d580
Update temporal/api/workflowservice/v1/request_response.proto
carlydf Apr 29, 2025
16fa15a
Update temporal/api/workflowservice/v1/request_response.proto
carlydf Apr 29, 2025
5f1baff
explain field
carlydf Apr 29, 2025
9094778
Merge branch 'versioning-override' of github.com:temporalio/api into …
carlydf Apr 29, 2025
3cd94cb
address comments
carlydf Apr 29, 2025
73148cc
save
carlydf May 2, 2025
352c65e
Merge branch 'master' of github.com:temporalio/api into versioning-ov…
carlydf May 2, 2025
9ab5def
make proto
carlydf May 2, 2025
3df497a
address comments
carlydf May 2, 2025
dd4300e
clarify comments
carlydf May 2, 2025
e87bbe3
more clarifying comments
carlydf May 2, 2025
73e8b04
Update temporal/api/deployment/v1/message.proto
carlydf May 5, 2025
8261c83
Update temporal/api/deployment/v1/message.proto
carlydf May 5, 2025
0968d3b
add 'not yet supported' notes on reserved but unsupported protos
carlydf May 5, 2025
26b922e
remove unsupported enum fields
carlydf May 5, 2025
d24144e
deprecate binary checksum, build id, version stamp and replace with v…
carlydf May 7, 2025
70b74a0
Merge branch 'master' of github.com:temporalio/api into versioning-ov…
carlydf May 7, 2025
eb890b4
make proto
carlydf May 7, 2025
36ccde3
Use correct new field names in deprecation comments
carlydf May 7, 2025
8d28e6e
make proto
carlydf May 7, 2025
e4f7d7d
don't put completed version in activity events
carlydf May 8, 2025
4556b72
more minor cleanup, making things consistent
carlydf May 8, 2025
8826845
revert deployment_name deprecation
carlydf May 8, 2025
8253f9f
Merge branch 'master' of github.com:temporalio/api into versioning-ov…
carlydf May 9, 2025
4a4cf62
merge main
carlydf May 9, 2025
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
317 changes: 264 additions & 53 deletions openapi/openapiv2.json

Large diffs are not rendered by default.

441 changes: 342 additions & 99 deletions openapi/openapiv3.yaml

Large diffs are not rendered by default.

68 changes: 45 additions & 23 deletions temporal/api/deployment/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ message WorkerDeploymentOptions {
// Required. Worker Deployment name.
string deployment_name = 1;
// The Build ID of the worker. Required when `worker_versioning_mode==VERSIONED`, in which case,
// the worker will be part of a Deployment Version identified by "<deployment_name>.<build_id>".
// the worker will be part of a Deployment Version.
string build_id = 2;
// Required. Versioning Mode for this worker. Must be the same for all workers with the
// same `deployment_name` and `build_id` combination, across all Task Queues.
// When `worker_versioning_mode==VERSIONED`, the worker will be part of a Deployment Version
// identified by "<deployment_name>.<build_id>".
// When `worker_versioning_mode==VERSIONED`, the worker will be part of a Deployment Version.
temporal.api.enums.v1.WorkerVersioningMode worker_versioning_mode = 3;
}

Expand Down Expand Up @@ -95,8 +94,11 @@ message DeploymentListInfo {
// their first poller arrives to the server.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
message WorkerDeploymentVersionInfo {
// The fully-qualified string representation of the version, in the form "<deployment_name>.<build_id>".
string version = 1;
// Deprecated. Use `deployment_version`.
string version = 1 [deprecated = true];

// Required.
WorkerDeploymentVersion deployment_version = 11;
string deployment_name = 2;
google.protobuf.Timestamp create_time = 3;

Expand Down Expand Up @@ -185,40 +187,60 @@ message WorkerDeploymentInfo {
string last_modifier_identity = 5;

message WorkerDeploymentVersionSummary {
// The fully-qualified string representation of the version, in the form "<deployment_name>.<build_id>".
string version = 1;
// Deprecated. Use `deployment_version`.
string version = 1 [deprecated = true];

// Required.
WorkerDeploymentVersion deployment_version = 4;
google.protobuf.Timestamp create_time = 2;
enums.v1.VersionDrainageStatus drainage_status = 3;
}
}

// A Worker Deployment Version (Version, for short) represents a
// version of workers within a Worker Deployment. (see documentation of WorkerDeploymentVersionInfo)
// Version records are created in Temporal server automatically when their
// first poller arrives to the server.
// Experimental. Worker Deployment Versions are experimental and might significantly change in the future.
message WorkerDeploymentVersion {
// A unique identifier for this Version within the Deployment it is a part of.
// Not necessarily unique within the namespace.
// The combination of `deployment_name` and `build_id` uniquely identifies this
// Version within the namespace, because Deployment names are unique within a namespace.
string build_id = 1;

// Identifies the Worker Deployment this Version is part of.
string deployment_name = 2;
}

message VersionMetadata {
// Arbitrary key-values.
map<string, temporal.api.common.v1.Payload> entries = 1;
}

message RoutingConfig {
// Always present. Specifies which Deployment Version should should receive new workflow
// executions and tasks of existing unversioned or AutoUpgrade workflows.
// Can be one of the following:
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when a ramp
// is set (see `ramping_version`.)
string current_version = 1;
// When present, it means the traffic is being shifted from the Current Version to the Ramping
// Version.
// Must always be different from Current Version. Can be one of the following:
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Specifies which Deployment Version should receive new workflow executions and tasks of
// existing unversioned or AutoUpgrade workflows.
// Nil value means no Version in this Deployment (except Ramping Version, if present) receives traffic other than tasks of previously Pinned workflows. In absence of a Current Version, remaining traffic after any ramp (if set) goes to unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.).
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
// is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7;
// Deprecated. Use `current_deployment_version`.
string current_version = 1 [deprecated = true];

// When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
// Must always be different from `current_deployment_version` unless both are nil.
// Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Note that it is possible to ramp from one Version to another Version, or from unversioned
// workers to a particular Version, or from a particular Version to unversioned workers.
string ramping_version = 2;
temporal.api.deployment.v1.WorkerDeploymentVersion ramping_deployment_version = 9;
// Deprecated. Use `ramping_deployment_version`.
string ramping_version = 2 [deprecated = true];

// Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
// Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
// not yet "promoted" to be the Current Version, likely due to pending validations.
// A 0% value means the Ramping Version is receiving no traffic.
float ramping_version_percentage = 3;
// Last time current version was changed.
google.protobuf.Timestamp current_version_changed_time = 4;
Expand Down
69 changes: 48 additions & 21 deletions temporal/api/history/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@ message WorkflowExecutionStartedEventAttributes {
// of starting on the Current Version of its Task Queue.
// This is set only if the child workflow is starting on a Task Queue belonging to the same
// Worker Deployment Version.
string parent_pinned_worker_deployment_version = 34;
// Deprecated. Use `parent_pinned_deployment_version`.
string parent_pinned_worker_deployment_version = 34 [deprecated = true];

// When present, it means this is a child workflow of a parent that is Pinned to this Worker
// Deployment Version. In this case, child workflow will start as Pinned to this Version instead
// of starting on the Current Version of its Task Queue.
// This is set only if the child workflow is starting on a Task Queue belonging to the same
// Worker Deployment Version.
temporal.api.deployment.v1.WorkerDeploymentVersion parent_pinned_deployment_version = 36;

// Priority metadata
temporal.api.common.v1.Priority priority = 35;
Expand Down Expand Up @@ -216,11 +224,11 @@ message WorkflowTaskStartedEventAttributes {
int64 history_size_bytes = 5;
// Version info of the worker to whom this task was dispatched.
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];
// Used by server internally to properly reapply build ID redirects to an execution
// when rebuilding it from events.
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
int64 build_id_redirect_counter = 7;
int64 build_id_redirect_counter = 7 [deprecated = true];
}

message WorkflowTaskCompletedEventAttributes {
Expand All @@ -231,12 +239,13 @@ message WorkflowTaskCompletedEventAttributes {
// Identity of the worker who completed this task
string identity = 3;
// Binary ID of the worker who completed this task
string binary_checksum = 4;
// Deprecated. Replaced with `deployment_version`.
string binary_checksum = 4 [deprecated = true];
// Version info of the worker who processed this workflow task. If present, the `build_id` field
// within is also used as `binary_checksum`, which may be omitted in that case (it may also be
// populated to preserve compatibility).
// Deprecated. Use `deployment` and `versioning_behavior` instead.
temporal.api.common.v1.WorkerVersionStamp worker_version = 5;
// Deprecated. Use `deployment_version` and `versioning_behavior` instead.
temporal.api.common.v1.WorkerVersionStamp worker_version = 5 [deprecated = true];
// Data the SDK wishes to record for itself, but server need not interpret, and does not
// directly impact workflow state.
temporal.api.sdk.v1.WorkflowTaskCompletedMetadata sdk_metadata = 6;
Expand All @@ -247,7 +256,7 @@ message WorkflowTaskCompletedEventAttributes {
// The deployment that completed this task. May or may not be set for unversioned workers,
// depending on whether a value is sent by the SDK. This value updates workflow execution's
// `versioning_info.deployment`.
// Deprecated. Replaced with `worker_deployment_version`.
// Deprecated. Replaced with `deployment_version`.
temporal.api.deployment.v1.Deployment deployment = 7 [deprecated = true];
// Versioning behavior sent by the worker that completed this task for this particular workflow
// execution. UNSPECIFIED means the task was completed by an unversioned worker. This value
Expand All @@ -256,11 +265,17 @@ message WorkflowTaskCompletedEventAttributes {
// The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`
// is set. This value updates workflow execution's `versioning_info.version`.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
string worker_deployment_version = 9;
// Deprecated. Replaced with `deployment_version`.
string worker_deployment_version = 9 [deprecated = true];
// The name of Worker Deployment that completed this task. Must be set if `versioning_behavior`
// is set. This value updates workflow execution's `worker_deployment_name`.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
string worker_deployment_name = 10;
// Deprecated. Use `deployment_version`.
string worker_deployment_name = 10 [deprecated = true];
// The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`
// is set. This value updates workflow execution's `versioning_info.worker_deployment_version`.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 11;
}

message WorkflowTaskTimedOutEventAttributes {
Expand All @@ -287,14 +302,17 @@ message WorkflowTaskFailedEventAttributes {
string new_run_id = 7;
// TODO: ?
int64 fork_event_version = 8;
// DEPRECATED since 1.21 - use `worker_version` instead.
// If a worker explicitly failed this task, its binary id
string binary_checksum = 9;
// Deprecated since 1.21. Use `deployment_version`.
string binary_checksum = 9 [deprecated = true];
// Version info of the worker who processed this workflow task. If present, the `build_id` field
// within is also used as `binary_checksum`, which may be omitted in that case (it may also be
// populated to preserve compatibility).
// Deprecated. Use the info inside the corresponding WorkflowTaskStartedEvent
temporal.api.common.v1.WorkerVersionStamp worker_version = 10;
// Deprecated. Use `deployment_version` instead.
temporal.api.common.v1.WorkerVersionStamp worker_version = 10 [deprecated = true];
// If a worker explicitly failed this task, its Worker Deployment Version.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 11;
}

message ActivityTaskScheduledEventAttributes {
Expand Down Expand Up @@ -357,11 +375,11 @@ message ActivityTaskStartedEventAttributes {
temporal.api.failure.v1.Failure last_failure = 5;
// Version info of the worker to whom this task was dispatched.
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];
// Used by server internally to properly reapply build ID redirects to an execution
// when rebuilding it from events.
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
int64 build_id_redirect_counter = 7;
int64 build_id_redirect_counter = 7 [deprecated = true];
}

message ActivityTaskCompletedEventAttributes {
Expand All @@ -374,8 +392,11 @@ message ActivityTaskCompletedEventAttributes {
// id of the worker that completed this task
string identity = 4;
// Version info of the worker who processed this workflow task.
// Deprecated. Use the info inside the corresponding ActivityTaskStartedEvent
temporal.api.common.v1.WorkerVersionStamp worker_version = 5;
// Deprecated. Use `deployment_version`.
temporal.api.common.v1.WorkerVersionStamp worker_version = 5 [deprecated = true];
// The Worker Deployment Version that completed this task.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 6;
}

message ActivityTaskFailedEventAttributes {
Expand All @@ -389,8 +410,11 @@ message ActivityTaskFailedEventAttributes {
string identity = 4;
temporal.api.enums.v1.RetryState retry_state = 5;
// Version info of the worker who processed this workflow task.
// Deprecated. Use the info inside the corresponding ActivityTaskStartedEvent
temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
// Deprecated. Use `deployment_version`.
temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];
// The Worker Deployment Version that failed this task.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 7;
}

message ActivityTaskTimedOutEventAttributes {
Expand Down Expand Up @@ -424,8 +448,11 @@ message ActivityTaskCanceledEventAttributes {
// id of the worker who canceled this activity
string identity = 5;
// Version info of the worker who processed this workflow task.
// Deprecated. Use the info inside the corresponding ActivityTaskStartedEvent
temporal.api.common.v1.WorkerVersionStamp worker_version = 6;
// Deprecated. Use `deployment_version`.
temporal.api.common.v1.WorkerVersionStamp worker_version = 6 [deprecated = true];
// The Worker Deployment Version that processed this task.
// Experimental. Worker Deployments are experimental and might significantly change in the future.
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 7;
}

message TimerStartedEventAttributes {
Expand Down
33 changes: 17 additions & 16 deletions temporal/api/taskqueue/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,28 @@ message TaskQueueMetadata {

// Experimental. Worker Deployments are experimental and might significantly change in the future.
message TaskQueueVersioningInfo {
// Always present. Specifies which Deployment Version should receive new workflow
// executions and tasks of existing unversioned or AutoUpgrade workflows.
// Can be one of the following:
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when a ramp
// is set (see `ramping_version`.)
string current_version = 1;
// When present, it means the traffic is being shifted from the Current Version to the Ramping
// Version.
// Must always be different from `current_version`. Can be one of the following:
// - A Deployment Version identifier in the form "<deployment_name>.<build_id>".
// - Or, the "__unversioned__" special value, to represent all the unversioned workers (those
// with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Specifies which Deployment Version should receive new workflow executions and tasks of
// existing unversioned or AutoUpgrade workflows.
// Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Note: Current Version is overridden by the Ramping Version for a portion of traffic when ramp percentage
// is non-zero (see `ramping_deployment_version` and `ramping_version_percentage`).
temporal.api.deployment.v1.WorkerDeploymentVersion current_deployment_version = 7;
// Deprecated. Use `current_deployment_version`.
string current_version = 1 [deprecated = true];

// When ramp percentage is non-zero, that portion of traffic is shifted from the Current Version to the Ramping Version.
// Must always be different from `current_deployment_version` unless both are nil.
// Nil value represents all the unversioned workers (those with `UNVERSIONED` (or unspecified) `WorkerVersioningMode`.)
// Note that it is possible to ramp from one Version to another Version, or from unversioned
// workers to a particular Version, or from a particular Version to unversioned workers.
string ramping_version = 2;
temporal.api.deployment.v1.WorkerDeploymentVersion ramping_deployment_version = 9;
// Deprecated. Use `ramping_deployment_version`.
string ramping_version = 2 [deprecated = true];

// Percentage of tasks that are routed to the Ramping Version instead of the Current Version.
// Valid range: [0, 100]. A 100% value means the Ramping Version is receiving full traffic but
// not yet "promoted" to be the Current Version, likely due to pending validations.
// A 0% value means the Ramping Version is receiving no traffic.
float ramping_version_percentage = 3;
// Last time versioning information of this Task Queue changed.
google.protobuf.Timestamp update_time = 4;
Expand Down
Loading
Loading