Skip to content

Add version status to worker deployment describe-version - #1226

Open
cvoege wants to merge 3 commits into
temporalio:mainfrom
cvoege:main
Open

cvoege wants to merge 3 commits into
temporalio:mainfrom
cvoege:main

Conversation

@cvoege

@cvoege cvoege commented Oct 3, 2026 •

Copy link
Copy Markdown

What changed?

I was working on a script to clean up old worker pools for drained versions using the GCP Cloud Run Serverless Worker pool, and I realized there was a failed deploy that left an inactive worker pool which my script was not handling, and the pool and version was just hanging around forever. But there is not a status field that includes the "inactive" state in the CLI, like the one that exists in the temporal cloud WebUI, so I decided to add it here.

temporal worker deployment describe-version now shows the version's lifecycle status (inactive, current, ramping, draining, drained, created). This is just the existing status enum that is already returned by the SDK lowercased. So:

  • Text output has a new Status row.
  • --output json has a new top-level status field.

Checklist

Stability

  • JSON output change reviewed as an intentional additive schema change (new status field only)

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 tests in SharedServerSuite: TestDeployment_Describe_Drainage for both json and human friendly output modes.

Manual tests

Setup

temporal server start-dev --headless
# Start two versioned workers for YourDeployment, build IDs v1 and v2
temporal worker deployment set-current-version \
    --deployment-name YourDeployment \
    --build-id v1 \
    --yes
temporal workflow start \
    --type YourWorkflowType \
    --task-queue YourTaskQueue \
    --workflow-id YourWorkflowId
temporal worker deployment set-current-version \
    --deployment-name YourDeployment \
    --build-id v2 \
    --yes

Happy path

$ temporal worker deployment describe-version \
    --deployment-name YourDeployment \
    --build-id v2
Worker Deployment Version:
  DeploymentName      YourDeployment
  BuildID             v2
  Status              current
  CreateTime          2 seconds ago
  RoutingChangedTime  now
  CurrentSinceTime    now
  RampingSinceTime    a long while ago
  RampPercentage      0

Task Queues:
      Name         Type
  YourTaskQueue  workflow
  YourTaskQueue  activity
$ temporal worker deployment describe-version \
    --deployment-name YourDeployment \
    --build-id v1 \
    --output json
{
  "deploymentName": "YourDeployment",
  "BuildID": "v1",
  "status": "draining",
  "createTime": "2026-10-03T17:55:46.489759Z",
  ...
  "drainageInfo": {
    "drainageStatus": "draining",
    ...
  },
  ...
}

Error case

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

@CLAassistant

CLAassistant commented Oct 3, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cvoege
cvoege marked this pull request as ready for review October 3, 2026 20:16
@cvoege
cvoege requested a review from a team as a code owner October 3, 2026 20:16
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.

2 participants