Skip to content

feat(studio): deploy a worker from the dashboard - #49242

Closed
jordienr wants to merge 8 commits into
jordi/workers-detailfrom
jordi/workers-create
Closed

jordienr wants to merge 8 commits into
jordi/workers-detailfrom
jordi/workers-create

Conversation

@jordienr

@jordienr jordienr commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

What

Deploy a worker from the dashboard, no CLI. Base: #49195.

New worker — in the list header and the empty state, both permission-gated — opens a form (name, size, access, instances) and runs the three-step flow the API team documented:

  1. POST /workers/{name}/uploads → presigned URL + upload id
  2. PUT a gzipped tar of the starter source to that URL, no auth header (the URL signature authorizes it, so this one call bypasses the API client on purpose)
  3. POST /workers/{name}/deploy with context_upload_id, then poll until build_state leaves building

data/workers/createTarGz.ts writes a minimal ustar archive and gzips it with CompressionStream — no tar dependency exists in the repo. 9 unit tests cover the header layout, octal size field, checksum, padding, and end-of-archive blocks.

The starter is Deno only: one entrypoint contract is verified, and runtimes that build and then fail are worse than no option. Adding one later is an entry in workers.templates.ts. Both New worker buttons are gated on PermissionAction.FUNCTIONS_WRITE.

How to test

Only on the Mockamaster project in staging — it is the one project in the alpha allow-list, and this is why this PR exists: standing a worker up any other way is involved right now.

  1. Staging dashboard → Mockamaster → Workers → New worker
  2. Name it something new, leave the defaults, deploy
  3. The row appears as Building and flips to Active within a minute or so, no refresh needed
  4. Open it → Overview shows 1 declared / 1 live / 1 ready
  5. Calling the worker over HTTP still returns 401 — that needs the separate api-gateway allow-list (WORKERS_ALLOWED_PROJECTS), not this PR

Verified end to end on Mockamaster with the tarball this PR produces: build_state: active, 1/1/1/0 instances, image_version: 1.0, at 2gb-1vcpu / deno / public / 1 instance.

Form constraints need a second opinion

V2DeployWorkerRequest documents no enums and no bounds — size, instances, exposure, and runtime are free-form with one @example each. So the form's limits are inherited from the original POC spec, not from the API:

Constraint Status
2gb-1vcpu confirmed by the deploy above
4gb-2vcpu unconfirmed — offered in the picker on POC authority alone
instances 1–10 unconfirmed as a platform cap; enforced client-side only
name ≤ 48 chars unconfirmed; the slug regex is a safe bet since the name is a URL segment

An invalid size fails loudly (the deploy POST errors and toasts), so this is not silent — but if infra confirms only one size exists at alpha, the picker should go.

Staff-only test deploy

WorkerTestDeployButton — a one-click "Deploy test worker" that deploys the starter under a generated test-worker-<id> name, so the deploy path (and the log pipeline behind it) can be exercised without the dialog. Gated on IS_STAGING_OR_LOCAL, so it renders on staging/local and never on production, matching the existing OTEL-toggle precedent.

Notes

  • No ticket covers dashboard create — FE-4191 scoped creation to the CLI. Deliberate change of direction.
  • Delete (FE-4190) is still out. If create lands, delete should probably follow.

@jordienr
jordienr requested a review from a team as a code owner August 19, 2026 08:33
@vercel

vercel Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview Aug 26, 2026 10:23am
studio-staging Ready Ready Preview Aug 26, 2026 10:23am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 26, 2026 10:23am
design-system Skipped Skipped Aug 26, 2026 10:23am
docs Skipped Skipped Aug 26, 2026 10:23am
ui-library Skipped Skipped Aug 26, 2026 10:23am
zone-www-dot-com Skipped Skipped Aug 26, 2026 10:23am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b533e90d-072e-47d1-bd6b-ec0103d8d45e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  240 passed
flaky  3 flaky
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  7 minutes, 60 seconds
commit  0dcf3b3

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › can join and leave a channel
Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › start/stop listening button works
Features › realtime-inspector.spec.ts › Realtime Inspector › Broadcast Messages › broadcast messages appear in the UI when listening

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@jordienr
jordienr requested review from a team as code owners August 20, 2026 16:21
@jordienr
jordienr force-pushed the jordi/workers-create branch from 498af6e to 2fca0d0 Compare August 20, 2026 16:23
@jordienr
jordienr force-pushed the jordi/workers-create branch from 2fca0d0 to 483cfb8 Compare August 20, 2026 16:26
@jordienr
jordienr force-pushed the jordi/workers-create branch 7 times, most recently from 24a3df4 to 521a6cc Compare August 25, 2026 10:03
@jordienr
jordienr force-pushed the jordi/workers-create branch from 521a6cc to 79a32c5 Compare August 25, 2026 13:39
@jordienr
jordienr force-pushed the jordi/workers-create branch from a160647 to 0dcf3b3 Compare August 26, 2026 10:18
@jordienr

Copy link
Copy Markdown
Member Author

Closing — deploying a worker from the dashboard is out of scope for v1.

It also has a hard infra blocker: the browser PUT to the presigned s3.us-west-2 upload URL is rejected by CORS (the bucket has no CORS policy, and any PUT is preflighted). Curl works because it doesn't enforce CORS, so this only surfaced in the browser. Reviving dashboard deploy would need a CORS policy on the upload bucket allowing PUT from the dashboard origins.

The branch stays if we want to pick it back up. The worker detail + Logs tab (validated end to end on staging) is on #49195; the Secrets section is on #49589, now rebased directly onto #49195.

@jordienr jordienr closed this Aug 26, 2026
jordienr added a commit that referenced this pull request Aug 28, 2026
## What

A Secrets section for Workers (FE-4280), so secrets are viewable without
detouring to Edge Functions. Base: #49242.

- **Nav** — a "Secrets" item under the Workers product menu, next to the
worker list
- **Page** at `/project/[ref]/workers/secrets`, header copy "Environment
variables loaded into every worker at start-up"
- **Route** + `routeTree.gen.ts` regenerated, plus the
`TANSTACK_MIGRATION.md` entry

Gated by `WorkersLayout` (flag + permission), same as the rest of the
product.

## Duplicated page, shared data

Per the ticket, this is the duplicated-page approach — a second entry
point, not a second store. Secrets are project-level
(`/v1/projects/{ref}/secrets`), so the page reuses the existing
`EdgeFunctionSecrets` / `DefaultEdgeFunctionSecrets` components rather
than forking ~400 lines of secret CRUD. Workers and Edge Functions read
and write the same list. The longer-term direction (a shared
Compute-level Secrets section) is out of scope here.

## How to test

Needs the `workers` flag on.

1. Project with the flag → **Workers** in the sidebar → **Secrets**
appears under it
2. Open it → default secrets table + custom secrets, identical to Edge
Functions → Secrets
3. Add/edit/delete a secret here; confirm it shows on the Edge Functions
Secrets page too (same project secrets)

## Note

Two strings inside the reused `EdgeFunctionSecrets` component still say
"edge function secrets" (the no-permission messages). Left as-is to
avoid refactoring shared Edge Functions code in a private-alpha
duplicated page; they'd be resolved by the eventual shared Compute-level
section. Flagging in case reviewers want them parameterized now.

No new tests: the page composes already-tested components and the nav is
a data literal, matching how the Edge Functions Secrets page itself is
covered.

Closes FE-4280
An error occurred while trying to automatically change base from jordi/workers-detail to master August 28, 2026 09:30
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.

1 participant