Skip to content

Fix ListWorkers query support for BuildId and Status columns#9568

Merged
rkannan82 merged 1 commit intomainfrom
kannan/fix-worker-query-buildid
Mar 18, 2026
Merged

Fix ListWorkers query support for BuildId and Status columns#9568
rkannan82 merged 1 commit intomainfrom
kannan/fix-worker-query-buildid

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Mar 18, 2026

What changed?

  • Added BuildId as a supported query attribute in worker_query_engine.go (was documented in proto but missing from implementation)
  • Added Status query support by registering the lowercased form (status) that the SQL parser produces for reserved words, using sqlparser.String() + backtick strip consistent with the rest of the codebase
  • Kept WorkerStatus as a backward-compatible alias
  • Fixed stale comment references (LastHeartbeatTimeHeartbeatTime)

Why?

BuildId and Status are documented as supported query attributes in ListWorkersRequest proto but were not working. BuildId was entirely missing from the property map, and Status is a SQL reserved word so the parser lowercases and backtick-quotes it — the old code used WorkerStatus which didn't match the proto docs.

How did you test it?

  • built
  • covered by existing tests
  • added new unit test(s)

@rkannan82 rkannan82 force-pushed the kannan/fix-worker-query-buildid branch 6 times, most recently from b880d73 to 0931526 Compare March 18, 2026 19:00
@rkannan82 rkannan82 requested a review from ShahabT March 18, 2026 19:00
@rkannan82 rkannan82 marked this pull request as ready for review March 18, 2026 19:00
@rkannan82 rkannan82 requested review from a team as code owners March 18, 2026 19:00
BuildId was documented in the API proto but missing from the worker query
engine's property map. Status was documented as "Status" in the proto but
the code used "WorkerStatus", causing queries with Status to fail.

Additionally, "Status" is a SQL reserved word so the parser lowercases it.
Made all column name lookups case-insensitive to handle this and similar
edge cases. Updated comments to fix stale references to LastHeartbeatTime.

Made-with: Cursor
@rkannan82 rkannan82 force-pushed the kannan/fix-worker-query-buildid branch from 396d687 to f71a54c Compare March 18, 2026 19:06
@rkannan82 rkannan82 enabled auto-merge (squash) March 18, 2026 19:16
@rkannan82 rkannan82 merged commit 9f54a61 into main Mar 18, 2026
46 checks passed
@rkannan82 rkannan82 deleted the kannan/fix-worker-query-buildid branch March 18, 2026 20:38
stephanos pushed a commit that referenced this pull request Mar 20, 2026
## What changed?
- Added `BuildId` as a supported query attribute in
`worker_query_engine.go` (was documented in proto but missing from
implementation)
- Added `Status` query support by registering the lowercased form
(`status`) that the SQL parser produces for reserved words, using
`sqlparser.String()` + backtick strip consistent with the rest of the
codebase
- Kept `WorkerStatus` as a backward-compatible alias
- Fixed stale comment references (`LastHeartbeatTime` → `HeartbeatTime`)

## Why?
`BuildId` and `Status` are documented as supported query attributes in
`ListWorkersRequest` proto but were not working. `BuildId` was entirely
missing from the property map, and `Status` is a SQL reserved word so
the parser lowercases and backtick-quotes it — the old code used
`WorkerStatus` which didn't match the proto docs.

## How did you test it?
- [x] built
- [x] covered by existing tests
- [x] added new unit test(s)
birme pushed a commit to eyevinn-osaas/temporal that referenced this pull request Mar 23, 2026
…lio#9568)

## What changed?
- Added `BuildId` as a supported query attribute in
`worker_query_engine.go` (was documented in proto but missing from
implementation)
- Added `Status` query support by registering the lowercased form
(`status`) that the SQL parser produces for reserved words, using
`sqlparser.String()` + backtick strip consistent with the rest of the
codebase
- Kept `WorkerStatus` as a backward-compatible alias
- Fixed stale comment references (`LastHeartbeatTime` → `HeartbeatTime`)

## Why?
`BuildId` and `Status` are documented as supported query attributes in
`ListWorkersRequest` proto but were not working. `BuildId` was entirely
missing from the property map, and `Status` is a SQL reserved word so
the parser lowercases and backtick-quotes it — the old code used
`WorkerStatus` which didn't match the proto docs.

## How did you test it?
- [x] built
- [x] covered by existing tests
- [x] added new unit test(s)
stephanos pushed a commit that referenced this pull request Mar 23, 2026
## What changed?
- Added `BuildId` as a supported query attribute in
`worker_query_engine.go` (was documented in proto but missing from
implementation)
- Added `Status` query support by registering the lowercased form
(`status`) that the SQL parser produces for reserved words, using
`sqlparser.String()` + backtick strip consistent with the rest of the
codebase
- Kept `WorkerStatus` as a backward-compatible alias
- Fixed stale comment references (`LastHeartbeatTime` → `HeartbeatTime`)

## Why?
`BuildId` and `Status` are documented as supported query attributes in
`ListWorkersRequest` proto but were not working. `BuildId` was entirely
missing from the property map, and `Status` is a SQL reserved word so
the parser lowercases and backtick-quotes it — the old code used
`WorkerStatus` which didn't match the proto docs.

## How did you test it?
- [x] built
- [x] covered by existing tests
- [x] added new unit test(s)
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