From 9c891cdc556a006e4c32434b31753ab503653b15 Mon Sep 17 00:00:00 2001 From: Antonio Lain Date: Sun, 10 Dec 2023 21:30:52 -0800 Subject: [PATCH] Update upstream protos --- .../protos/api_upstream/.gitignore | 1 + .../temporal/api/batch/v1/message.proto | 13 ++-- .../temporal/api/common/v1/message.proto | 31 +++++++++ .../temporal/api/enums/v1/reset.proto | 6 +- .../temporal/api/export/v1/message.proto | 2 +- .../api/sdk/v1/workflow_metadata.proto | 66 +++++++++++++++++++ .../temporal/api/workflow/v1/message.proto | 8 ++- 7 files changed, 117 insertions(+), 10 deletions(-) create mode 100644 sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto diff --git a/sdk-core-protos/protos/api_upstream/.gitignore b/sdk-core-protos/protos/api_upstream/.gitignore index af5159473..8655883e5 100644 --- a/sdk-core-protos/protos/api_upstream/.gitignore +++ b/sdk-core-protos/protos/api_upstream/.gitignore @@ -2,3 +2,4 @@ /.gen /.vscode /.stamp +*~ \ No newline at end of file diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto index f11f1c432..4717a080f 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/batch/v1/message.proto @@ -90,10 +90,15 @@ message BatchOperationDeletion { // BatchOperationReset sends reset requests to batch workflows. // Keep the parameter in sync with temporal.api.workflowservice.v1.ResetWorkflowExecutionRequest. message BatchOperationReset { - // Reset type. - temporal.api.enums.v1.ResetType reset_type = 1; - // History event reapply options. - temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2; // The identity of the worker/client. string identity = 3; + + // Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored. + temporal.api.common.v1.ResetOptions options = 4; + + // Reset type (deprecated, use `options`). + temporal.api.enums.v1.ResetType reset_type = 1; + // History event reapply options (deprecated, use `options`). + temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 2; + } diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto index 60395287d..454882eb7 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/common/v1/message.proto @@ -32,8 +32,10 @@ option ruby_package = "Temporalio::Api::Common::V1"; option csharp_namespace = "Temporalio.Api.Common.V1"; import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; import "temporal/api/enums/v1/common.proto"; +import "temporal/api/enums/v1/reset.proto"; message DataBlob { temporal.api.enums.v1.EncodingType encoding_type = 1; @@ -147,3 +149,32 @@ message WorkerVersionCapabilities { // Later, may include info like "I can process WASM and/or JS bundles" } + +// Describes where and how to reset a workflow, used for batch reset currently +// and may be used for single-workflow reset later. +message ResetOptions { + // Which workflow task to reset to. + oneof target { + // Resets to the first workflow task completed or started event. + google.protobuf.Empty first_workflow_task = 1; + // Resets to the last workflow task completed or started event. + google.protobuf.Empty last_workflow_task = 2; + // The id of a specific `WORKFLOW_TASK_COMPLETED`,`WORKFLOW_TASK_TIMED_OUT`, `WORKFLOW_TASK_FAILED`, or + // `WORKFLOW_TASK_STARTED` event to reset to. + // Note that this option doesn't make sense when used as part of a batch request. + int64 workflow_task_id = 3; + // Resets to the first workflow task processed by this build id. + // If the workflow was not processed by the build id, or the workflow task can't be + // determined, no reset will be performed. + // Note that by default, this reset is allowed to be to a prior run in a chain of + // continue-as-new. + string build_id = 4; + } + + // History event reapply options. + temporal.api.enums.v1.ResetReapplyType reset_reapply_type = 10; + + // If true, limit the reset to only within the current run. (Applies to build_id targets and + // possibly others in the future.) + bool current_run_only = 11; +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto index 3cb9b3058..48daaa1df 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/enums/v1/reset.proto @@ -40,11 +40,11 @@ enum ResetReapplyType { RESET_REAPPLY_TYPE_NONE = 2; } -// Reset type options -enum ResetType { +// Reset type options. Deprecated, see temporal.api.common.v1.ResetOptions. +enum ResetType { RESET_TYPE_UNSPECIFIED = 0; // Resets to event of the first workflow task completed, or if it does not exist, the event after task scheduled. RESET_TYPE_FIRST_WORKFLOW_TASK = 1; // Resets to event of the last workflow task completed, or if it does not exist, the event after task scheduled. RESET_TYPE_LAST_WORKFLOW_TASK = 2; -} \ No newline at end of file +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto index 7ffd23305..43516a267 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/export/v1/message.proto @@ -24,7 +24,7 @@ syntax = "proto3"; package temporal.api.export.v1; -option go_package = "go.temporal.io/api/export/v1;workflow"; +option go_package = "go.temporal.io/api/export/v1;export"; option java_package = "io.temporal.api.export.v1"; option java_multiple_files = true; option java_outer_classname = "MessageProto"; diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto b/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto new file mode 100644 index 000000000..35a78fb16 --- /dev/null +++ b/sdk-core-protos/protos/api_upstream/temporal/api/sdk/v1/workflow_metadata.proto @@ -0,0 +1,66 @@ +// The MIT License +// +// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +syntax = "proto3"; + +package temporal.api.sdk.v1; + +option go_package = "go.temporal.io/api/sdk/v1;sdk"; +option java_package = "io.temporal.api.sdk.v1"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowMetadataProto"; +option ruby_package = "Temporalio::Api::Sdk::V1"; +option csharp_namespace = "Temporalio.Api.Sdk.V1"; + +// The name of the query to retrieve this information is `__temporal_getWorkflowMetadata`. +message WorkflowMetadata { + // Metadata provided at declaration or creation time. + WorkflowDefinition definition = 1; +} + +// (-- api-linter: core::0203::optional=disabled --) +message WorkflowDefinition { + // A name scoped by the task queue that maps to this workflow definition. + // If missing, this workflow is a dynamic workflow. + string type = 1; + // An optional workflow description provided by the application. + // By convention, external tools may interpret its first part, + // i.e., ending with a line break, as a summary of the description. + string description = 2; + repeated WorkflowInteractionDefinition query_definitions = 3; + repeated WorkflowInteractionDefinition signal_definitions = 4; + repeated WorkflowInteractionDefinition update_definitions = 5; +} + +// (-- api-linter: core::0123::resource-annotation=disabled +// aip.dev/not-precedent: The `name` field is optional. --) +// (-- api-linter: core::0203::optional=disabled --) +message WorkflowInteractionDefinition { + // An optional name for the handler. If missing, it represents + // a dynamic handler that processes any interactions not handled by others. + // There is at most one dynamic handler per workflow and interaction kind. + string name = 1; + // An optional interaction description provided by the application. + // By convention, external tools may interpret its first part, + // i.e., ending with a line break, as a summary of the description. + string description = 2; +} diff --git a/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto b/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto index 82a45dff2..a886717db 100644 --- a/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto +++ b/sdk-core-protos/protos/api_upstream/temporal/api/workflow/v1/message.proto @@ -106,9 +106,13 @@ message ResetPoints { repeated ResetPointInfo points = 1; } +// ResetPointInfo records the workflow event id that is the first one processed by a given +// build id or binary checksum. A new reset point will be created if either build id or binary +// checksum changes (although in general only one or the other will be used at a time). message ResetPointInfo { - // A worker binary version identifier, will be deprecated and superseded by a newer concept of - // build_id. + // Worker build id. + string build_id = 7; + // A worker binary version identifier (deprecated). string binary_checksum = 1; // The first run ID in the execution chain that was touched by this worker build. string run_id = 2;