From c725c1073e34a80dda6754a1427c99974a550eef Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Tue, 22 Oct 2024 21:56:22 -0700 Subject: [PATCH] Fix RespondWorkflowTask capabilities --- buf.yaml | 2 ++ openapi/openapiv2.json | 24 ++++++++----------- .../workflowservice/v1/request_response.proto | 24 +++++++++---------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/buf.yaml b/buf.yaml index a09458dc..0ee96f87 100644 --- a/buf.yaml +++ b/buf.yaml @@ -12,6 +12,8 @@ breaking: - WIRE_JSON ignore: - google + # TODO(klassenq): remove me + - temporal/api/workflowservice/v1/request_response.proto lint: use: - DEFAULT diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 6e9dab43..4ad36d32 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -9772,6 +9772,16 @@ "v1RespondQueryTaskCompletedResponse": { "type": "object" }, + "v1RespondWorkflowTaskCompletedRequestCapabilities": { + "type": "object", + "properties": { + "discardSpeculativeWorkflowTaskWithEvents": { + "type": "boolean", + "title": "True if the SDK can handle speculative workflow task with command events.\nIf true, the server may chosse, at its discretion, to discard a speculative workflow task\neven if that speculative task included command events the SDK had not previouly processed" + } + }, + "description": "SDK capability details." + }, "v1RespondWorkflowTaskCompletedResponse": { "type": "object", "properties": { @@ -9791,23 +9801,9 @@ "type": "string", "format": "int64", "description": "If non zero, indicates the server has discarded the workflow task that was being responded to.\nWill be the event ID of the last workflow task started event in the history before the new workflow task.\nServer is only expected to discard a workflow task if it could not have modified the workflow state." - }, - "capabilities": { - "$ref": "#/definitions/v1RespondWorkflowTaskCompletedResponseCapabilities", - "description": "All capabilities the SDK supports." } } }, - "v1RespondWorkflowTaskCompletedResponseCapabilities": { - "type": "object", - "properties": { - "discardSpeculativeWorkflowTaskWithEvents": { - "type": "boolean", - "title": "True if the SDK can handle speculative workflow task with command events.\nIf true, the server may chosse, at its discretion, to discard a speculative workflow task\neven if that speculative task included command events the SDK had not previouly processed" - } - }, - "description": "SDK capability details." - }, "v1RespondWorkflowTaskFailedResponse": { "type": "object" }, diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index fc79354d..557b3768 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -354,19 +354,8 @@ message RespondWorkflowTaskCompletedRequest { temporal.api.sdk.v1.WorkflowTaskCompletedMetadata sdk_metadata = 12; // Local usage data collected for metering temporal.api.common.v1.MeteringMetadata metering_metadata = 13; -} - -message RespondWorkflowTaskCompletedResponse { - // See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task` - PollWorkflowTaskQueueResponse workflow_task = 1; - // See `ScheduleActivityTaskCommandAttributes::request_eager_execution` - repeated PollActivityTaskQueueResponse activity_tasks = 2; - // If non zero, indicates the server has discarded the workflow task that was being responded to. - // Will be the event ID of the last workflow task started event in the history before the new workflow task. - // Server is only expected to discard a workflow task if it could not have modified the workflow state. - int64 reset_history_event_id = 3; // All capabilities the SDK supports. - Capabilities capabilities = 4; + Capabilities capabilities = 14; // SDK capability details. message Capabilities { // True if the SDK can handle speculative workflow task with command events. @@ -379,6 +368,17 @@ message RespondWorkflowTaskCompletedResponse { } } +message RespondWorkflowTaskCompletedResponse { + // See `RespondWorkflowTaskCompletedResponse::return_new_workflow_task` + PollWorkflowTaskQueueResponse workflow_task = 1; + // See `ScheduleActivityTaskCommandAttributes::request_eager_execution` + repeated PollActivityTaskQueueResponse activity_tasks = 2; + // If non zero, indicates the server has discarded the workflow task that was being responded to. + // Will be the event ID of the last workflow task started event in the history before the new workflow task. + // Server is only expected to discard a workflow task if it could not have modified the workflow state. + int64 reset_history_event_id = 3; +} + message RespondWorkflowTaskFailedRequest { // The task token as received in `PollWorkflowTaskQueueResponse` bytes task_token = 1;