Skip to content
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

Fix RespondWorkflowTask capabilities #467

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ breaking:
- WIRE_JSON
ignore:
- google
# TODO(klassenq): remove me
- temporal/api/workflowservice/v1/request_response.proto
lint:
use:
- DEFAULT
Expand Down
24 changes: 10 additions & 14 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
},
Expand Down
24 changes: 12 additions & 12 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down
Loading