Skip to content

feat(dashboard): worker label filters, webhook 429 on limit exhausted#4456

Merged
mrkaye97 merged 10 commits into
mainfrom
mk/api-improvements
Jul 22, 2026
Merged

feat(dashboard): worker label filters, webhook 429 on limit exhausted#4456
mrkaye97 merged 10 commits into
mainfrom
mk/api-improvements

Conversation

@mrkaye97

@mrkaye97 mrkaye97 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Couple small features/fixes:

  1. Wires up a worker label filter on the workers page on the dash
  2. Returns 429 instead of 500 on resource exhausted on webhook receive
  3. Re-adds overflow (scroll) on the runs table bar with the filters and statuses and stuff
  4. Fixes a bug in the workflow dropdown on the trigger form so it scrolls properly
Screenshot 2026-07-17 at 4 43 23 PM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

Changes have been:

  • Tested (unit, integration, or manually with steps specified)
  • Linted and formatted
  • Documented (where applicable)
  • Added to CHANGELOG (where applicable) -- see Keep a Changelog

🤖 AI Disclosure

Used Claude Design + Claude Code for a bunch of the workflow page work

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Jul 22, 2026 4:03pm

Request Review

@github-actions github-actions Bot added engine Related to the core Hatchet engine dashboard Related to the Hatchet dashboard labels Jul 17, 2026
Comment on lines +153 to +175
AND (
sqlc.narg('labelKeys')::text[] IS NULL
OR sqlc.narg('labelValues')::text[] IS NULL
OR (
SELECT BOOL_AND(
EXISTS (
SELECT 1
FROM "WorkerLabel" wl
WHERE wl."workerId" = workers."id"
AND wl."key" = lf.k
AND (
wl."strValue" = lf.v
OR wl."intValue"::text = lf.v
)
)
)
FROM (
SELECT
UNNEST(sqlc.narg('labelKeys')::text[]) AS k,
UNNEST(sqlc.narg('labelValues')::text[]) AS v
) AS lf
)
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is gonna seq scan but I think it's fine ?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds worker label filtering support end-to-end (dashboard → API → repository SQL) and adjusts the webhook receive endpoint to return HTTP 429 when tenant resource limits are exhausted, updating OpenAPI and generated clients accordingly.

Changes:

  • Add a labels query parameter for listing workers, with frontend UI wiring and backend parsing into SQL label filters.
  • Extend worker list/count SQL queries to filter workers by required label key/value pairs.
  • Return 429 (and document it in OpenAPI + generated clients) when webhook ingestion fails due to ErrResourceExhausted.

Reviewed changes

Copilot reviewed 8 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/repository/worker.go Passes label key/value filter arrays into sqlc query params for worker listing/counting.
pkg/repository/sqlcv1/workers.sql Adds label filter predicates to ListWorkers and CountWorkers SQL.
pkg/repository/sqlcv1/workers.sql.go Regenerated sqlc output reflecting new SQL parameters and predicates.
api/v1/server/handlers/workers/list.go Parses labels=key:value query params into repository label filters.
api-contracts/openapi/paths/worker/worker.yaml Documents the new labels query parameter on the worker list endpoint.
frontend/app/src/pages/main/v1/workers/index.tsx Adds a Key/Value toolbar filter for labels and sends labels to the API.
frontend/app/src/pages/main/v1/workers/components/worker-columns.tsx Exports labelsKey for use by the workers table filter wiring.
frontend/app/src/lib/api/generated/Api.ts Updates frontend generated API types to include labels?: string[] for worker list.
api/v1/server/oas/gen/openapi.gen.go Regenerates server OpenAPI bindings for labels and webhook 429 response type.
pkg/client/rest/gen.go Regenerates REST client to support labels in worker list + parse webhook 429 JSON.
api/v1/server/handlers/v1/webhooks/receive.go Returns a JSON 429 response when ingestion fails with ErrResourceExhausted.
api-contracts/openapi/paths/v1/webhooks/webhook.yaml Documents webhook receive 429 response for tenant resource exhaustion.
Files not reviewed (3)
  • api/v1/server/oas/gen/openapi.gen.go: Generated file
  • pkg/client/rest/gen.go: Generated file
  • pkg/repository/sqlcv1/workers.sql.go: Generated file

Comment thread pkg/repository/worker.go Outdated
Comment on lines +169 to +173
FROM (
SELECT
UNNEST(sqlc.narg('labelKeys')::text[]) AS k,
UNNEST(sqlc.narg('labelValues')::text[]) AS v
) AS lf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Comment thread pkg/repository/sqlcv1/workers.sql
Comment thread api/v1/server/handlers/v1/webhooks/receive.go
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

goos: linux
goarch: amd64
pkg: github.com/hatchet-dev/hatchet/internal/msgqueue/rabbitmq
cpu: AMD Ryzen 9 7950X3D 16-Core Processor          
                              │ /tmp/old.txt │            /tmp/new.txt            │
                              │    sec/op    │    sec/op     vs base              │
CompressPayloads_1x10KiB-8       78.84µ ± 3%   80.24µ ± 12%  +1.78% (p=0.026 n=6)
CompressPayloads_10x10KiB-8      899.8µ ± 2%   905.9µ ±  1%       ~ (p=0.589 n=6)
CompressPayloads_10x100KiB-8     11.11m ± 2%   11.00m ± 14%       ~ (p=0.394 n=6)
CompressPayloads_Concurrent-8    65.50µ ± 9%   63.06µ ± 26%       ~ (p=0.589 n=6)
geomean                          476.7µ        473.9µ        -0.59%

                              │ /tmp/old.txt │            /tmp/new.txt            │
                              │     B/op     │     B/op      vs base              │
CompressPayloads_1x10KiB-8      10.95Ki ± 1%   10.96Ki ± 1%       ~ (p=0.777 n=6)
CompressPayloads_10x10KiB-8     108.3Ki ± 1%   108.3Ki ± 1%  +0.04% (p=0.026 n=6)
CompressPayloads_10x100KiB-8    2.920Mi ± 0%   2.920Mi ± 0%       ~ (p=0.485 n=6)
CompressPayloads_Concurrent-8   54.40Ki ± 0%   54.32Ki ± 0%       ~ (p=0.818 n=6)
geomean                         117.9Ki        117.8Ki       -0.02%

                              │ /tmp/old.txt │            /tmp/new.txt            │
                              │  allocs/op   │ allocs/op   vs base                │
CompressPayloads_1x10KiB-8        5.000 ± 0%   5.000 ± 0%       ~ (p=1.000 n=6) ¹
CompressPayloads_10x10KiB-8       32.00 ± 0%   32.00 ± 0%       ~ (p=1.000 n=6) ¹
CompressPayloads_10x100KiB-8      63.00 ± 2%   63.00 ± 0%       ~ (p=1.000 n=6)
CompressPayloads_Concurrent-8     17.00 ± 0%   17.00 ± 0%       ~ (p=1.000 n=6) ¹
geomean                           20.35        20.35       +0.00%
¹ all samples are equal

pkg: github.com/hatchet-dev/hatchet/pkg/scheduling/v1
                                         │ /tmp/old.txt │           /tmp/new.txt            │
                                         │    sec/op    │   sec/op     vs base              │
RateLimiter-8                               50.77µ ± 3%   50.26µ ± 9%       ~ (p=1.000 n=6)
Scheduler_Replenish_DenseSharedActions-8    13.96m ± 3%   14.11m ± 1%       ~ (p=0.240 n=6)
geomean                                     842.0µ        842.1µ       +0.01%

                                         │ /tmp/old.txt │            /tmp/new.txt            │
                                         │     B/op     │     B/op      vs base              │
RateLimiter-8                              137.7Ki ± 0%   137.7Ki ± 0%       ~ (p=1.000 n=6)
Scheduler_Replenish_DenseSharedActions-8   11.69Mi ± 0%   11.69Mi ± 0%       ~ (p=0.310 n=6)
geomean                                    1.254Mi        1.254Mi       +0.00%

                                         │ /tmp/old.txt │            /tmp/new.txt             │
                                         │  allocs/op   │  allocs/op   vs base                │
RateLimiter-8                               1.022k ± 0%   1.022k ± 0%       ~ (p=1.000 n=6) ¹
Scheduler_Replenish_DenseSharedActions-8    17.53k ± 0%   17.53k ± 0%       ~ (p=0.729 n=6)
geomean                                     4.232k        4.232k       +0.00%
¹ all samples are equal

Compared against main (9555bfd)

@mrkaye97 mrkaye97 changed the title feat(dashboard): worker label filters, webhook 429 on limit exhausted feat(dashboard): worker label filters, webhook 429 on limit exhausted, workflow page rework Jul 21, 2026
@github-actions github-actions Bot added sdk-ts Related to the Typescript SDK sdk-py Related to the Python sdk sdk-ruby Related to the Ruby SDK and removed sdk-ts Related to the Typescript SDK sdk-py Related to the Python sdk sdk-ruby Related to the Ruby SDK labels Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@mrkaye97
mrkaye97 force-pushed the mk/api-improvements branch from c907d4f to dd39d4e Compare July 22, 2026 15:16
@github-actions github-actions Bot removed sdk-ts Related to the Typescript SDK sdk-py Related to the Python sdk sdk-ruby Related to the Ruby SDK labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@mrkaye97 mrkaye97 changed the title feat(dashboard): worker label filters, webhook 429 on limit exhausted, workflow page rework feat(dashboard): worker label filters, webhook 429 on limit exhausted Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions github-actions Bot added sdk-ts Related to the Typescript SDK sdk-py Related to the Python sdk sdk-ruby Related to the Ruby SDK labels Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-deadlock job failed on this PR (optimistic-scheduling=true). This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-deadlock job failed on this PR (optimistic-scheduling=true). This check is non-mandatory and does not block merging, but may be worth investigating. View logs

type: array
items:
$ref: "../../components/schemas/_index.yaml#/WorkerStatus"
- description: Filter by worker labels

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to not get bitten here again... and or or?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and

// blocks trackpad/wheel scrolling here (scrollbar drag still works since that
// doesn't dispatch wheel events). Stop the event from bubbling to that listener.
onWheel={(e) => {
e.stopPropagation();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird...

@mrkaye97
mrkaye97 merged commit c6695a0 into main Jul 22, 2026
73 of 75 checks passed
@mrkaye97
mrkaye97 deleted the mk/api-improvements branch July 22, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Related to the Hatchet dashboard engine Related to the core Hatchet engine sdk-py Related to the Python sdk sdk-ruby Related to the Ruby SDK sdk-ts Related to the Typescript SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants