From 07dcfaa8c92936aa5c80cef11baa8f27640da8d5 Mon Sep 17 00:00:00 2001 From: Shivam Saraf Date: Wed, 30 Apr 2025 22:36:39 -0400 Subject: [PATCH] required timestamps to be emitted from deploymentStateInfo --- openapi/openapiv2.json | 22 ++++++++++++++++++++- openapi/openapiv3.yaml | 25 ++++++++++++++++++++++++ temporal/api/deployment/v1/message.proto | 14 +++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 93e23d898..838bad556 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6968,7 +6968,27 @@ "format": "date-time" }, "drainageStatus": { - "$ref": "#/definitions/v1VersionDrainageStatus" + "$ref": "#/definitions/v1VersionDrainageStatus", + "description": "Deprecated. Use `drainage_info` instead." + }, + "drainageInfo": { + "$ref": "#/definitions/v1VersionDrainageInfo", + "title": "Information about workflow drainage to help the user determine when it is safe\nto decommission a Version. Not present while version is current or ramping" + }, + "currentSinceTime": { + "type": "string", + "format": "date-time", + "description": "Nil if not current." + }, + "rampingSinceTime": { + "type": "string", + "format": "date-time", + "description": "Nil if not ramping. Updated when the version first starts ramping, not on each ramp change." + }, + "routingUpdateTime": { + "type": "string", + "format": "date-time", + "description": "Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index dd5d4016a..a5d0365db 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -11947,7 +11947,32 @@ components: - VERSION_DRAINAGE_STATUS_DRAINING - VERSION_DRAINAGE_STATUS_DRAINED type: string + description: Deprecated. Use `drainage_info` instead. format: enum + drainageInfo: + allOf: + - $ref: '#/components/schemas/VersionDrainageInfo' + description: |- + Information about workflow drainage to help the user determine when it is safe + to decommission a Version. Not present while version is current or ramping + currentSinceTime: + type: string + description: |- + Nil if not current. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --) + format: date-time + rampingSinceTime: + type: string + description: |- + Nil if not ramping. Updated when the version first starts ramping, not on each ramp change. + (-- api-linter: core::0140::prepositions=disabled + aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --) + format: date-time + routingUpdateTime: + type: string + description: Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed. + format: date-time WorkerDeploymentOptions: type: object properties: diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index e31c45bb6..d13bd9cc0 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -210,7 +210,21 @@ message WorkerDeploymentInfo { // The fully-qualified string representation of the version, in the form ".". string version = 1; google.protobuf.Timestamp create_time = 2; + // Deprecated. Use `drainage_info` instead. enums.v1.VersionDrainageStatus drainage_status = 3; + // Information about workflow drainage to help the user determine when it is safe + // to decommission a Version. Not present while version is current or ramping + VersionDrainageInfo drainage_info = 4; + // Nil if not current. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --) + google.protobuf.Timestamp current_since_time = 5; + // Nil if not ramping. Updated when the version first starts ramping, not on each ramp change. + // (-- api-linter: core::0140::prepositions=disabled + // aip.dev/not-precedent: 'Since' captures the field semantics despite being a preposition. --) + google.protobuf.Timestamp ramping_since_time = 6; + // Last time `current_since_time`, `ramping_since_time, or `ramp_percentage` of this version changed. + google.protobuf.Timestamp routing_update_time = 7; } }