Skip to content

Commit cd48c16

Browse files
Google APIscopybara-github
authored andcommitted
feat: add a stack_trace field to the Error messages specifying where the error occured
feat: add call_log_level field to Execution messages doc: clarify requirement to escape strings within JSON arguments Update the Execution proto with stack_trace field which is populated on output if an error occurs, and the call_log_level field can be specified on input to request that function calls and/or errors for the given execution be logged to Cloud Logging. PiperOrigin-RevId: 407842136
1 parent f9acb37 commit cd48c16

4 files changed

Lines changed: 75 additions & 12 deletions

File tree

google/cloud/workflows/executions/v1/BUILD.bazel

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -66,12 +66,15 @@ java_grpc_library(
6666
java_gapic_library(
6767
name = "executions_java_gapic",
6868
srcs = [":executions_proto_with_info"],
69+
gapic_yaml = "executions_gapic.yaml",
6970
grpc_service_config = "executions_grpc_service_config.json",
71+
service_yaml = "workflowexecutions_v1.yaml",
7072
test_deps = [
7173
":executions_java_grpc",
7274
],
7375
deps = [
7476
":executions_java_proto",
77+
"//google/api:api_java_proto",
7578
],
7679
)
7780

@@ -120,6 +123,7 @@ go_gapic_library(
120123
srcs = [":executions_proto_with_info"],
121124
grpc_service_config = "executions_grpc_service_config.json",
122125
importpath = "cloud.google.com/go/workflows/executions/apiv1;executions",
126+
metadata = True,
123127
service_yaml = "workflowexecutions_v1.yaml",
124128
deps = [
125129
":executions_go_proto",
@@ -138,6 +142,7 @@ go_gapic_assembly_pkg(
138142
name = "gapi-cloud-workflows-executions-v1-go",
139143
deps = [
140144
":executions_go_gapic",
145+
":executions_go_gapic_srcjar-metadata.srcjar",
141146
":executions_go_gapic_srcjar-test.srcjar",
142147
":executions_go_proto",
143148
],
@@ -192,6 +197,7 @@ php_gapic_library(
192197
name = "executions_php_gapic",
193198
srcs = [":executions_proto_with_info"],
194199
grpc_service_config = "executions_grpc_service_config.json",
200+
service_yaml = "workflowexecutions_v1.yaml",
195201
deps = [
196202
":executions_php_grpc",
197203
":executions_php_proto",
@@ -241,8 +247,8 @@ nodejs_gapic_assembly_pkg(
241247
##############################################################################
242248
load(
243249
"@com_google_googleapis_imports//:imports.bzl",
244-
"ruby_gapic_assembly_pkg",
245250
"ruby_cloud_gapic_library",
251+
"ruby_gapic_assembly_pkg",
246252
"ruby_grpc_library",
247253
"ruby_proto_library",
248254
)
@@ -260,13 +266,13 @@ ruby_grpc_library(
260266

261267
ruby_cloud_gapic_library(
262268
name = "executions_ruby_gapic",
263-
srcs = [":executions_proto_with_info",],
269+
srcs = [":executions_proto_with_info"],
264270
extra_protoc_parameters = [
265-
"ruby-cloud-gem-name=google-cloud-workflows-executions-v1",
266-
"ruby-cloud-env-prefix=WORKFLOWS",
267-
"ruby-cloud-product-url=https://cloud.google.com/workflows/",
268271
"ruby-cloud-api-id=workflowexecutions.googleapis.com",
269272
"ruby-cloud-api-shortname=workflowexecutions",
273+
"ruby-cloud-env-prefix=WORKFLOWS",
274+
"ruby-cloud-gem-name=google-cloud-workflows-executions-v1",
275+
"ruby-cloud-product-url=https://cloud.google.com/workflows/",
270276
"ruby-cloud-wrapper-gem-override=google-cloud-workflows",
271277
],
272278
grpc_service_config = "executions_grpc_service_config.json",

google/cloud/workflows/executions/v1/executions.proto

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -83,16 +83,52 @@ message Execution {
8383
pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}"
8484
};
8585

86+
// A single stack element (frame) where an error occurred.
87+
message StackTraceElement {
88+
// Position contains source position information about the stack trace
89+
// element such as line number, column number and length of the code block
90+
// in bytes.
91+
message Position {
92+
// The source code line number the current instruction was generated from.
93+
int64 line = 1;
94+
95+
// The source code column position (of the line) the current instruction
96+
// was generated from.
97+
int64 column = 2;
98+
99+
// The number of bytes of source code making up this stack trace element.
100+
int64 length = 3;
101+
}
102+
103+
// The step the error occurred at.
104+
string step = 1;
105+
106+
// The routine where the error occurred.
107+
string routine = 2;
108+
109+
// The source position information of the stack trace element.
110+
Position position = 3;
111+
}
112+
113+
// A collection of stack elements (frames) where an error occurred.
114+
message StackTrace {
115+
// An array of stack elements.
116+
repeated StackTraceElement elements = 1;
117+
}
118+
86119
// Error describes why the execution was abnormally terminated.
87120
message Error {
88-
// Error payload returned by the execution, represented as a JSON string.
121+
// Error message and data returned represented as a JSON string.
89122
string payload = 1;
90123

91-
// Human readable error context, helpful for debugging purposes.
124+
// Human-readable stack trace string.
92125
string context = 2;
126+
127+
// Stack trace with detailed information of where error was generated.
128+
StackTrace stack_trace = 3;
93129
}
94130

95-
// Describes the current state of the execution. More states may be added
131+
// Describes the current state of the execution. More states might be added
96132
// in the future.
97133
enum State {
98134
// Invalid state.
@@ -111,6 +147,20 @@ message Execution {
111147
CANCELLED = 4;
112148
}
113149

150+
// Describes the level of platform logging to apply to calls and call
151+
// responses during workflow executions.
152+
enum CallLogLevel {
153+
// No call logging specified.
154+
CALL_LOG_LEVEL_UNSPECIFIED = 0;
155+
156+
// Log all call steps within workflows, all call returns, and all exceptions
157+
// raised.
158+
LOG_ALL_CALLS = 1;
159+
160+
// Log only exceptions that are raised from call steps within workflows.
161+
LOG_ERRORS_ONLY = 2;
162+
}
163+
114164
// Output only. The resource name of the execution.
115165
// Format:
116166
// projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
@@ -127,6 +177,10 @@ message Execution {
127177

128178
// Input parameters of the execution represented as a JSON string.
129179
// The size limit is 32KB.
180+
//
181+
// *Note*: If you are using the REST API directly to run your workflow, you
182+
// must escape any JSON string value of `argument`. Example:
183+
// `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'`
130184
string argument = 5;
131185

132186
// Output only. Output of the execution represented as a JSON string. The
@@ -140,6 +194,9 @@ message Execution {
140194

141195
// Output only. Revision of the workflow this execution is using.
142196
string workflow_revision_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
197+
198+
// The call logging level associated to this execution.
199+
CallLogLevel call_log_level = 9;
143200
}
144201

145202
// Request for the

google/cloud/workflows/executions/v1/executions_grpc_service_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"retryPolicy": {
99
"maxAttempts": 5,
1010
"initialBackoff": "1s",
11-
"maxBackoff": "10s",
11+
"maxBackoff": "60s",
1212
"backoffMultiplier": 1.3,
1313
"retryableStatusCodes": ["UNAVAILABLE"]
1414
}

google/cloud/workflows/executions/v1/workflowexecutions_v1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apis:
77
- name: google.cloud.workflows.executions.v1.Executions
88

99
documentation:
10-
summary: 'Execute workflows created with Workflows API.'
10+
summary: Execute workflows created with Workflows API.
1111
overview: 'Manages user-provided workflows.'
1212

1313
backend:

0 commit comments

Comments
 (0)