From ad41fcf584c720f3d30ef799e5dc9199c1bcc109 Mon Sep 17 00:00:00 2001 From: Shahab Tajik Date: Wed, 20 Nov 2024 06:29:30 +0100 Subject: [PATCH] Deprecate WorkerVersionStamp and replace it with Deployment (#484) * Add Deployment APIs * Move UpdateDeploymentMemo to deployment dir * Address feedback & rename deployment_name * Addressed comments * Addressed feedback * WIP git rid of stamp * Deprecate WorkerVersionStamp * Rename RedirectInfo to DeploymentTransition * undo enum comment change * regen files * Deprecate WorkerVersionStamp and replace it with Deployment * Deprecate WorkerVersionStamp and replace it with Deployment --- openapi/openapiv2.json | 22 ++++++++++++--- openapi/openapiv3.yaml | 27 +++++++++++++++++++ temporal/api/common/v1/message.proto | 5 ++++ .../workflowservice/v1/request_response.proto | 26 +++++++++++++++--- 4 files changed, 74 insertions(+), 6 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 494054c4..1121025b 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -5823,7 +5823,11 @@ }, "workerVersion": { "$ref": "#/definitions/v1WorkerVersionStamp", - "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more." + "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more.\nDeprecated. Use `deployment` instead." + }, + "deployment": { + "$ref": "#/definitions/v1Deployment", + "description": "Deployment info of the worker that completed this task. Must be present if user has set\n`WorkerDeploymentOptions` regardless of versioning being enabled or not." } } }, @@ -5870,7 +5874,11 @@ }, "workerVersion": { "$ref": "#/definitions/v1WorkerVersionStamp", - "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more." + "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more.\nDeprecated. Use `deployment` instead." + }, + "deployment": { + "$ref": "#/definitions/v1Deployment", + "description": "Deployment info of the worker that completed this task. Must be present if user has set\n`WorkerDeploymentOptions` regardless of versioning being enabled or not." } } }, @@ -5921,7 +5929,11 @@ }, "workerVersion": { "$ref": "#/definitions/v1WorkerVersionStamp", - "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more." + "description": "Version info of the worker who processed this task. This message's `build_id` field should\nalways be set by SDKs. Workers opting into versioning will also set the `use_versioning`\nfield to true. See message docstrings for more.\nDeprecated. Use `deployment` instead." + }, + "deployment": { + "$ref": "#/definitions/v1Deployment", + "description": "Deployment info of the worker that completed this task. Must be present if user has set\n`WorkerDeploymentOptions` regardless of versioning being enabled or not." } } }, @@ -12367,6 +12379,10 @@ "useVersioning": { "type": "boolean", "description": "If set, the worker is opting in to worker versioning. Otherwise, this is used only as a\nmarker for workflow reset points and the BuildIDs search attribute." + }, + "deploymentSeriesName": { + "type": "string", + "description": "Must be sent if user has set a deployment series name (versioning-3).\nDeprecated. SDK should return `Deployment` in the requests to server instead of populating\nthis field." } }, "description": "Identifies the version of a worker that received or processed a task\nDeprecated. This message is replaced with `Deployment` and `VersioningBehavior`." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index a859e68f..b86db0da 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7921,6 +7921,13 @@ components: Version info of the worker who processed this task. This message's `build_id` field should always be set by SDKs. Workers opting into versioning will also set the `use_versioning` field to true. See message docstrings for more. + Deprecated. Use `deployment` instead. + deployment: + allOf: + - $ref: '#/components/schemas/Deployment' + description: |- + Deployment info of the worker that completed this task. Must be present if user has set + `WorkerDeploymentOptions` regardless of versioning being enabled or not. RespondActivityTaskCanceledResponse: type: object properties: {} @@ -7972,6 +7979,13 @@ components: Version info of the worker who processed this task. This message's `build_id` field should always be set by SDKs. Workers opting into versioning will also set the `use_versioning` field to true. See message docstrings for more. + Deprecated. Use `deployment` instead. + deployment: + allOf: + - $ref: '#/components/schemas/Deployment' + description: |- + Deployment info of the worker that completed this task. Must be present if user has set + `WorkerDeploymentOptions` regardless of versioning being enabled or not. RespondActivityTaskCompletedResponse: type: object properties: {} @@ -8038,6 +8052,13 @@ components: Version info of the worker who processed this task. This message's `build_id` field should always be set by SDKs. Workers opting into versioning will also set the `use_versioning` field to true. See message docstrings for more. + Deprecated. Use `deployment` instead. + deployment: + allOf: + - $ref: '#/components/schemas/Deployment' + description: |- + Deployment info of the worker that completed this task. Must be present if user has set + `WorkerDeploymentOptions` regardless of versioning being enabled or not. RespondActivityTaskFailedResponse: type: object properties: @@ -9749,6 +9770,12 @@ components: description: |- If set, the worker is opting in to worker versioning. Otherwise, this is used only as a marker for workflow reset points and the BuildIDs search attribute. + deploymentSeriesName: + type: string + description: |- + Must be sent if user has set a deployment series name (versioning-3). + Deprecated. SDK should return `Deployment` in the requests to server instead of populating + this field. description: |- Identifies the version of a worker that received or processed a task Deprecated. This message is replaced with `Deployment` and `VersioningBehavior`. diff --git a/temporal/api/common/v1/message.proto b/temporal/api/common/v1/message.proto index abcc1d9e..eb483d44 100644 --- a/temporal/api/common/v1/message.proto +++ b/temporal/api/common/v1/message.proto @@ -134,6 +134,11 @@ message WorkerVersionStamp { // marker for workflow reset points and the BuildIDs search attribute. bool use_versioning = 3; + // Must be sent if user has set a deployment series name (versioning-3). + // Deprecated. SDK should return `Deployment` in the requests to server instead of populating + // this field. + string deployment_series_name = 4; + // Later, may include bundle id that could be used for WASM and/or JS dynamically loadable bundles. } diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 63b85853..ee0397fa 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -351,6 +351,7 @@ message RespondWorkflowTaskCompletedRequest { // Version info of the worker who processed this task. This message's `build_id` field should // always be set by SDKs. Workers opting into versioning will also set the `use_versioning` // field to true. See message docstrings for more. + // Deprecated. Use `deployment` and `versioning_behavior` instead. temporal.api.common.v1.WorkerVersionStamp worker_version_stamp = 10; // Default versioning behavior that is set at worker server level. // Protocol messages piggybacking on a WFT as a transport @@ -362,9 +363,12 @@ message RespondWorkflowTaskCompletedRequest { temporal.api.common.v1.MeteringMetadata metering_metadata = 13; reserved 14; reserved "capabilities"; - // Must be set when versioning-3 is used (i.e. `worker_version_stamp.use_versioning` is `true` - // and `worker_version_stamp.deployment_series_name` is provided). - temporal.api.enums.v1.VersioningBehavior versioning_behavior = 15; + // Deployment info of the worker that completed this task. Must be present if user has set + // `WorkerDeploymentOptions` regardless of versioning being enabled or not. + temporal.api.deployment.v1.Deployment deployment = 15; + // Versioning behavior of this workflow execution as set on the worker that completed this task. + // UNSPECIFIED means versioning is not enabled in the worker. + temporal.api.enums.v1.VersioningBehavior versioning_behavior = 16; } message RespondWorkflowTaskCompletedResponse { @@ -397,7 +401,11 @@ message RespondWorkflowTaskFailedRequest { // Version info of the worker who processed this task. This message's `build_id` field should // always be set by SDKs. Workers opting into versioning will also set the `use_versioning` // field to true. See message docstrings for more. + // Deprecated. Use `deployment` instead. temporal.api.common.v1.WorkerVersionStamp worker_version = 8; + // Deployment info of the worker that completed this task. Must be present if user has set + // `WorkerDeploymentOptions` regardless of versioning being enabled or not. + temporal.api.deployment.v1.Deployment deployment = 9; } message RespondWorkflowTaskFailedResponse { @@ -510,7 +518,11 @@ message RespondActivityTaskCompletedRequest { // Version info of the worker who processed this task. This message's `build_id` field should // always be set by SDKs. Workers opting into versioning will also set the `use_versioning` // field to true. See message docstrings for more. + // Deprecated. Use `deployment` instead. temporal.api.common.v1.WorkerVersionStamp worker_version = 5; + // Deployment info of the worker that completed this task. Must be present if user has set + // `WorkerDeploymentOptions` regardless of versioning being enabled or not. + temporal.api.deployment.v1.Deployment deployment = 6; } message RespondActivityTaskCompletedResponse { @@ -547,7 +559,11 @@ message RespondActivityTaskFailedRequest { // Version info of the worker who processed this task. This message's `build_id` field should // always be set by SDKs. Workers opting into versioning will also set the `use_versioning` // field to true. See message docstrings for more. + // Deprecated. Use `deployment` instead. temporal.api.common.v1.WorkerVersionStamp worker_version = 6; + // Deployment info of the worker that completed this task. Must be present if user has set + // `WorkerDeploymentOptions` regardless of versioning being enabled or not. + temporal.api.deployment.v1.Deployment deployment = 7; } message RespondActivityTaskFailedResponse { @@ -590,7 +606,11 @@ message RespondActivityTaskCanceledRequest { // Version info of the worker who processed this task. This message's `build_id` field should // always be set by SDKs. Workers opting into versioning will also set the `use_versioning` // field to true. See message docstrings for more. + // Deprecated. Use `deployment` instead. temporal.api.common.v1.WorkerVersionStamp worker_version = 5; + // Deployment info of the worker that completed this task. Must be present if user has set + // `WorkerDeploymentOptions` regardless of versioning being enabled or not. + temporal.api.deployment.v1.Deployment deployment = 6; } message RespondActivityTaskCanceledResponse {