Skip to content

馃挜 Show all important fields and omit unset times in worker deployment describe-version - #1223

Draft
moody-temporal wants to merge 2 commits into
temporalio:mainfrom
moody-temporal:describe-version-output-fixes
Draft

moody-temporal wants to merge 2 commits into
temporalio:mainfrom
moody-temporal:describe-version-output-fixes

Conversation

@moody-temporal

@moody-temporal moody-temporal commented Oct 1, 2026 •

Copy link
Copy Markdown

What changed?

Two fixes to temporal worker deployment describe-version, one per commit:

  1. Leave out unset times instead of showing "a long while ago". A version that was never ramped (or never current) has no RampingSinceTime (or CurrentSinceTime). The empty timestamp went through AsTime(), which returns the Unix epoch. The text output then showed RampingSinceTime a long while ago and the JSON showed "rampingSinceTime": "1970-01-01T00:00:00Z". An empty or epoch timestamp is now treated as unset and left out of both text and JSON. This covers routingChangedTime, currentSinceTime and rampingSinceTime.
  2. Print all important fields. Adds Status, FirstActivationTime, LastCurrentTime, LastDeactivationTime and LastModifierIdentity to text and JSON output. Unset times are left out. drainageInfo is left out of JSON when the server doesn't report it, instead of printing an empty status and 0001-01-01 times.

馃挜 JSON output changes:

  • routingChangedTime, currentSinceTime, rampingSinceTime and drainageInfo (and its lastChangedTime and lastCheckedTime) are now left out when unset, instead of holding epoch or zero-value times.
  • New fields: status, firstActivationTime, lastCurrentTime, lastDeactivationTime, lastModifierIdentity.

Checklist

Stability

  • Breaking changes are marked with 馃挜 in the PR title and release notes
  • Changes to JSON output (-o json / -o jsonl) are treated as breaking changes

Design

  • This feature does not depend on Cloud-only APIs or behavior (it works against an OSS server)

Behavior

  • Results go to stdout; errors and warnings go to stderr

Tests

  • Added functional test(s) (SharedServerSuite): TestDeployment_Describe_Version_Omits_Unset_Times
  • Added unit test(s) (func TestXxx) where applicable: TestPrintWorkerDeploymentVersionInfoProto_AllFields, TestVersionStatusProtoToStr

Note: the current dev server doesn't send firstActivationTime, lastCurrentTime, lastDeactivationTime or lastModifierIdentity in DescribeWorkerDeploymentVersion (confirmed with a raw gRPC call). The unit test covers them by passing a fully populated proto through the printer.

Manual tests

Setup

temporal server start-dev --headless
temporal worker deployment set-current-version \
    --deployment-name YourDeploymentName \
    --build-id v1 \
    --allow-no-pollers \
    --yes

Happy path

A version that has only been current no longer shows RampingSinceTime a long while ago, and now shows its Status:

$ temporal worker deployment describe-version \
    --deployment-name YourDeploymentName \
    --build-id v1
Worker Deployment Version:
  DeploymentName      YourDeploymentName
  BuildID             v1
  Status              current
  CreateTime          5 seconds ago
  RoutingChangedTime  5 seconds ago
  CurrentSinceTime    5 seconds ago
  RampPercentage      0

After promoting v2, v1 is draining:

$ temporal worker deployment set-current-version \
    --deployment-name YourDeploymentName \
    --build-id v2 \
    --allow-no-pollers \
    --yes
Successfully set the current worker deployment version
$ temporal worker deployment describe-version \
    --deployment-name YourDeploymentName \
    --build-id v1
Worker Deployment Version:
  DeploymentName           YourDeploymentName
  BuildID                  v1
  Status                   draining
  CreateTime               5 seconds ago
  RoutingChangedTime       now
  RampPercentage           0
  DrainageStatus           draining
  DrainageLastChangedTime  now
  DrainageLastCheckedTime  now
$ temporal worker deployment describe-version \
    --deployment-name YourDeploymentName \
    --build-id v1 \
    --output json
{
  "deploymentName": "YourDeploymentName",
  "BuildID": "v1",
  "status": "draining",
  "createTime": "2026-10-01T00:46:56.503458Z",
  "routingChangedTime": "2026-10-01T00:47:02.156405Z",
  "rampPercentage": 0,
  "drainageInfo": {
    "drainageStatus": "draining",
    "lastChangedTime": "2026-10-01T00:47:02.171784Z",
    "lastCheckedTime": "2026-10-01T00:47:02.171784Z"
  },
  "taskQueuesInfos": null,
  "metadata": null
}

Error case

$ temporal worker deployment describe-version \
    --deployment-name YourDeploymentName \
    --build-id does-not-exist
Error: error describing worker deployment version: Worker Deployment Version not found
$ echo $?
1

Composition

$ temporal worker deployment describe-version \
    --deployment-name YourDeploymentName \
    --build-id v1 \
    --output json | jq -r .status
draining

moody-temporal and others added 2 commits September 30, 2026 19:38
A version that was never ramped (or never current) has no
RampingSinceTime/CurrentSinceTime. These nil timestamps were converted
via AsTime() to the Unix epoch, which the text output rendered as
"a long while ago" and JSON output as "1970-01-01T00:00:00Z".

Treat nil/epoch timestamps as unset: omit them from text output and
from JSON output.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add the version's Status, FirstActivationTime, LastCurrentTime,
LastDeactivationTime and LastModifierIdentity to both text and JSON
output. Unset times are omitted, and drainageInfo is omitted from JSON
when the server does not report it instead of printing zero times.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant