Skip to content

feat(deployments): make compute provider picker configurable#3659

Merged
rossnelson merged 3 commits into
mainfrom
com-193
Jul 13, 2026
Merged

feat(deployments): make compute provider picker configurable#3659
rossnelson merged 3 commits into
mainfrom
com-193

Conversation

@rossnelson

@rossnelson rossnelson commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

What

Makes the serverless worker compute provider picker configurable by the consumer via a new computeProviders prop, threaded from the page components (serverless-worker-create, worker-deployment-version-create, worker-deployment-version-edit) down through the forms into compute-provider-picker.svelte.

Each entry controls one provider:

export type ComputeProviderOption = {
  value: ComputeProviderValue;   // 'lambda' | 'cloud-run'
  disabled?: boolean;            // grey out
  disabledReason?: string;       // badge text explaining why
  hidden?: boolean;              // omit entirely
};

This supports both UX options in COM-193, chosen per call by the consumer: grey out incompatible providers with a reason, or hide them.

Why

For COM-193, compute options need to be restricted by the namespace cell's cloud type (Lambda on AWS, Cloud Run on GCP). This repo has no concept of cloud type and shouldn't, so the picker is made configurable and the consumer (cloud) decides what to offer per namespace.

Behavior

  • When computeProviders is omitted, the picker keeps its current behavior: Lambda enabled, Cloud Run gated on the serverScaledProviderCloudRun capability with a "Coming Soon" badge. Self-hosted usage is unchanged.
  • The picker auto-selects the first available provider when the current selection is not offered, so a restricted namespace cannot submit an unavailable provider.
  • Added a Storybook story covering default, grey-out (AWS/GCP), hide-incompatible, and cross-cloud states.

Follow-up (not in this PR)

Cloud needs to compute the computeProviders array from the namespace cell and pass it into these page components. That cloud-type logic lives on the cloud side.

Testing

  • pnpm check clean
  • pnpm lint clean
  • pnpm test all pass

Add a `computeProviders` prop to the serverless worker create/version forms
and pages, threaded down to the compute provider picker. The consumer can now
decide which providers to offer and whether to grey them out (with a reason) or
hide them entirely, instead of the picker hardcoding availability.

When the prop is omitted the picker keeps its current behavior (Lambda enabled,
Cloud Run gated on the serverScaledProviderCloudRun capability), so self-hosted
usage is unchanged. The picker also auto-selects the first available provider
when the current selection is not offered.

This lets cloud restrict compute options by the namespace cell's cloud type
(COM-193) without this repo needing any concept of cloud type.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jul 13, 2026 7:22pm

Request Review

@rossnelson rossnelson marked this pull request as ready for review July 13, 2026 15:57
@rossnelson rossnelson requested a review from a team as a code owner July 13, 2026 15:57
# Conflicts:
#	src/lib/components/workers/serverless-worker-form/create-version-form.svelte
#	src/lib/components/workers/serverless-worker-form/edit-version-form.svelte
#	src/lib/components/workers/serverless-worker-form/serverless-worker-create-form.svelte
#	src/lib/pages/serverless-worker-create.svelte
#	src/lib/pages/worker-deployment-version-create.svelte
#	src/lib/pages/worker-deployment-version-edit.svelte
Comment on lines +80 to +83
const selectable = visibleProviders.filter((option) => !option.disabled);
if (selectable.length && !selectable.some((o) => o.value === provider)) {
provider = selectable[0].value;
}

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.

Suggested change
const selectable = visibleProviders.filter((option) => !option.disabled);
if (selectable.length && !selectable.some((o) => o.value === provider)) {
provider = selectable[0].value;
}
if (visibleProviders.some((option) => option.value === provider)) {
return;
}
const fallback = visibleProviders.find((option) => !option.disabled);
if (fallback) {
provider = fallback.value;
}

do we always to want reset the provider even if it's a valid, but currently disabled option? It seems like a non-obvious behavior to silently change the provider without user interaction if the provider exists 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good call, I updated this so we no longer reactively change the provider after the form mounts. A currently selected provider is preserved if it’s still visible, even when disabled. If it’s hidden or absent, the form selects the first visible enabled provider during initialization instead. I added tests for those cases and pushed the update.

@rossnelson rossnelson merged commit 6e2290f into main Jul 13, 2026
19 checks passed
@rossnelson rossnelson deleted the com-193 branch July 13, 2026 19:41
rossedfort added a commit that referenced this pull request Jul 13, 2026
Auto-generated version bump from 2.52.0 to 2.52.1

Bump type: patch

Changes included:
- [`3be0df00`](3be0df0) fix(schedules): default absent second/minute/hour to 0 when editing (#3653)
- [`508b65b7`](508b65b) fix(schedules): default emptied second/minute/hour to 0 on submit (#3655)
- [`1f0e149c`](1f0e149) fix(workers): reject $LATEST qualifier in Lambda ARN validation (#3657)
- [`b42b0776`](b42b077) a11y(2.4.3): inert-based focus containment + restore; drop trap from native dialogs (#3598)
- [`cc491a29`](cc491a2) a11y(2.4.3): keep toast live region announcing during a focus trap [DT-4252] (#3654)
- [`ddc7f8e2`](ddc7f8e) a11y(2.4.11): add scroll-padding so sticky overlays don't obscure focused elements (#3532)
- [`b7e3a472`](b7e3a47) FilterBar icon update (#3660)
- [`09318ec6`](09318ec) Add danger PR comment for api version bump (#3662)
- [`273cc4be`](273cc4b) a11y(4.1.2): add label prop to Button primitive and enforce accessible names (#3556)
- [`4507115f`](4507115) Use an editable combobox for the Cloud Run region field (DT-4232) (#3636)
- [`694a7471`](694a747) a11y(1.4.13): migrate saved-query nav tooltips to Tooltip primitive (#3607)
- [`8b384a40`](8b384a4) a11y(4.1.2): fix nested interactive elements in Copyable component (#3558)
- [`1bfd2750`](1bfd275) fix describe SANO API requests to include runId parameter (#3661)
- [`ba18b43e`](ba18b43) a11y(4.1.2): require label on CodeBlock primitive; add aria-readonly for read-only mode (#3557)
- [`6e2290f1`](6e2290f) feat(deployments): make compute provider picker configurable (#3659)
- [`4470b76a`](4470b76) fix(workers): persist WDV compute-config edits via update mask; revert $LATEST validation (#3658)
- [`17fd591b`](17fd591) fix(nexus-operations): make start standalone nexus operation timeouts optional (#3656)

Co-authored-by: rossedfort <11775628+rossedfort@users.noreply.github.com>
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