Skip to content

Commit 44b650a

Browse files
committed
work on comments- extract status to enum
1 parent 39ab960 commit 44b650a

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

openapi/openapiv2.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15305,7 +15305,7 @@
1530515305
"type": "string"
1530615306
},
1530715307
"status": {
15308-
"type": "string",
15308+
"$ref": "#/definitions/v1WorkerStatus",
1530915309
"description": "Worker status. Possible values - \"running\", \"shutting_down\", \"shutdown\"."
1531015310
},
1531115311
"uptime": {
@@ -15419,6 +15419,16 @@
1541915419
}
1542015420
}
1542115421
},
15422+
"v1WorkerStatus": {
15423+
"type": "string",
15424+
"enum": [
15425+
"WORKER_STATUS_UNSPECIFIED",
15426+
"WORKER_STATUS_STATUS_RUNNING",
15427+
"WORKER_STATUS_SHUTTING_DOWN",
15428+
"WORKER_STATUS_SHUTDOWN"
15429+
],
15430+
"default": "WORKER_STATUS_UNSPECIFIED"
15431+
},
1542215432
"v1WorkerVersionCapabilities": {
1542315433
"type": "object",
1542415434
"properties": {

openapi/openapiv3.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12671,8 +12671,14 @@ components:
1267112671
sdkVersion:
1267212672
type: string
1267312673
status:
12674+
enum:
12675+
- WORKER_STATUS_UNSPECIFIED
12676+
- WORKER_STATUS_STATUS_RUNNING
12677+
- WORKER_STATUS_SHUTTING_DOWN
12678+
- WORKER_STATUS_SHUTDOWN
1267412679
type: string
1267512680
description: Worker status. Possible values - "running", "shutting_down", "shutdown".
12681+
format: enum
1267612682
uptime:
1267712683
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
1267812684
type: string

temporal/api/enums/v1/common.proto

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,13 @@ enum ApplicationErrorCategory {
9696
APPLICATION_ERROR_CATEGORY_UNSPECIFIED = 0;
9797
// Expected application error with little/no severity.
9898
APPLICATION_ERROR_CATEGORY_BENIGN = 1;
99-
}
99+
}
100+
101+
// (-- api-linter: core::0216::synonyms=disabled
102+
// aip.dev/not-precedent: It seems we have both state and status, and status is a better fit for workers. --)
103+
enum WorkerStatus {
104+
WORKER_STATUS_UNSPECIFIED = 0;
105+
WORKER_STATUS_STATUS_RUNNING = 1;
106+
WORKER_STATUS_SHUTTING_DOWN = 2;
107+
WORKER_STATUS_SHUTDOWN = 3;
108+
}

temporal/api/worker/v1/message.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ option csharp_namespace = "Temporalio.Api.Worker.V1";
1313
import "google/protobuf/duration.proto";
1414
import "google/protobuf/timestamp.proto";
1515
import "temporal/api/deployment/v1/message.proto";
16+
import "temporal/api/enums/v1/common.proto";
1617

1718
message WorkerPollerInfo {
1819

@@ -73,7 +74,7 @@ message WorkerInfo {
7374
string sdk_version = 6;
7475

7576
// Worker status. Possible values - "running", "shutting_down", "shutdown".
76-
string status = 7;
77+
temporal.api.enums.v1.WorkerStatus status = 7;
7778

7879
// Uptime of the worker, since it started.
7980
// This is the time since the worker started, not the time since the last heartbeat.

0 commit comments

Comments
 (0)