Skip to content

Use task queue kind instead of name prefix for nexus metrics#10141

Merged
rkannan82 merged 6 commits intomainfrom
kannan/nexus-metrics-use-tq-kind
May 1, 2026
Merged

Use task queue kind instead of name prefix for nexus metrics#10141
rkannan82 merged 6 commits intomainfrom
kannan/nexus-metrics-use-tq-kind

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented May 1, 2026

What

Use TASK_QUEUE_KIND_WORKER_COMMANDS enum check instead of string prefix matching on the task queue to determine if its internal queue.

Why

PR #9899 introduced TASK_QUEUE_KIND_WORKER_COMMANDS. The original code (PR #9760) predated this and relied on the /temporal-sys/ name prefix as a workaround.

How did you test it?

Existing tests

🤖 Generated with Claude Code

rkannan82 and others added 4 commits April 30, 2026 17:13
…nal tag

Replace string prefix check on task queue name with
TASK_QUEUE_KIND_WORKER_COMMANDS enum check, now that the kind exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Centralize the internal task queue kind check in common/primitives
alongside the existing internal task queue helpers. Update the
handler test to use TASK_QUEUE_KIND_WORKER_COMMANDS instead of
relying on the name prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ncy in test

Enumerate all TaskQueueKind values explicitly so adding a new kind
forces a decision about whether it's internal. Use a plain task queue
name in the test to prove is_internal depends only on the kind.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without the default case, the exhaustive linter will flag this switch
when a new TaskQueueKind is added, forcing the developer to decide
whether the new kind is internal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 requested a review from ShahabT May 1, 2026 03:07
@rkannan82 rkannan82 marked this pull request as ready for review May 1, 2026 03:07
@rkannan82 rkannan82 requested review from a team as code owners May 1, 2026 03:07
rkannan82 and others added 2 commits May 1, 2026 12:41
@rkannan82 rkannan82 merged commit 76d568a into main May 1, 2026
47 checks passed
@rkannan82 rkannan82 deleted the kannan/nexus-metrics-use-tq-kind branch May 1, 2026 20:44
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