feat(dashboard): worker label filters, webhook 429 on limit exhausted#4456
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| 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 | ||
| ) | ||
| ) |
There was a problem hiding this comment.
this is gonna seq scan but I think it's fine ?
There was a problem hiding this comment.
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
labelsquery 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 toErrResourceExhausted.
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
| FROM ( | ||
| SELECT | ||
| UNNEST(sqlc.narg('labelKeys')::text[]) AS k, | ||
| UNNEST(sqlc.narg('labelValues')::text[]) AS v | ||
| ) AS lf |
Benchmark resultsCompared against |
|
|
c907d4f to
dd39d4e
Compare
|
|
|
|
|
|
|
|
|
|
|
|
| type: array | ||
| items: | ||
| $ref: "../../components/schemas/_index.yaml#/WorkerStatus" | ||
| - description: Filter by worker labels |
There was a problem hiding this comment.
to not get bitten here again... and or or?
| // 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(); |
Description
Couple small features/fixes:
Type of change
Checklist
Changes have been:
🤖 AI Disclosure
Used Claude Design + Claude Code for a bunch of the workflow page work