Skip to content

fix(frontend): enforce dns-safe cluster names in byoc create form - #5718

Merged
abcxff merged 2 commits into
mainfrom
stack/fix-frontend-enforce-dns-safe-cluster-names-in-byoc-create-form-kzpvtoyp
Sep 14, 2026
Merged

abcxff merged 2 commits into
mainfrom
stack/fix-frontend-enforce-dns-safe-cluster-names-in-byoc-create-form-kzpvtoyp

Conversation

@abcxff

@abcxff abcxff commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@abcxff

abcxff commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@the-company-company the-company-company Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found

Reviewed commit a7fa909.

@claude

claude Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review

Small, focused fix. Verified how it's wired end-to-end:

  • byocDetailsSchema is only applied via schema: (values) => values.plan === "byoc" ? byocDetailsSchema : detailsSchema. I confirmed stepper-form.tsx (resolveSchema / Content's zodResolver wiring, and StepPanel's isStepValid check) already supports a function-typed Step.schema and re-resolves it against live form values on every render, so this correctly gates both the "Continue" button state and the actual RHF validation for the byoc path. Not dead code.
  • Confirmed values.name is sent directly as the cluster name to client.byoc.createCluster(data.name, ...) (cloud-data-provider.tsx), so client-side DNS-safety validation here is legitimate, not speculative hardening.
  • The regex (^[a-z0-9]([a-z0-9-]*[a-z0-9])?$, 1-63 chars) is a standard RFC 1123 DNS-label pattern, matching this repo's own convention ("name... must be valid DNS subdomain, kebab case") documented in the root CLAUDE.md.

Notes (non-blocking)

  1. Backend parity unverified. The actual BYOC cluster-create handler lives in rivet-dev/engine-ee (this repo only has the generated @rivet-gg/cloud SDK client), so I couldn't confirm the API enforces the same regex/length. If the backend's constraint differs (e.g. a different max length or additional reserved-name checks), the frontend could either reject valid names or accept names the API then rejects with a raw API error. Worth a quick check against the engine-ee handler.
  2. .min(1) is redundant — the regex already requires at least one character (the optional group only extends beyond the first char), so .min(1) never fires independently. Harmless, but could be dropped for conciseness.
  3. No test coverage added, though this matches the existing file (no test/story file exists for create-project-form.tsx today), so this isn't a regression in practice.
  4. Minor/pre-existing (not introduced by this PR): the shared Name field's placeholder still reads "Enter a project name..." even on the byoc "Create cluster" step. Not something this diff needs to fix, just noting it's adjacent.

Overall: correct, minimal, and consistent with the codebase's naming conventions. No security or performance concerns for a client-side regex validator.

…deletes

Port of the workflows-repo fix. Add batchDelete to the EngineDriver
interface and all implementations, and route loop-history pruning through
runDeletes(), which coalesces keys into transaction-sized (MAX_KV_BATCH_ENTRIES)
batchDelete chunks run in bounded rounds (MAX_CONCURRENT_DELETES=64).

Previously deleteEntriesWithPrefix / flush fanned out one unbounded
Promise.all of single-statement deletes per key; cutting a loop history
of >128 entries exceeded the actor SQLite transaction coordinator's
128-permit admission cap (non-blocking try_acquire -> transaction_queue_full).
@abcxff
abcxff force-pushed the stack/fix-frontend-enforce-dns-safe-cluster-names-in-byoc-create-form-kzpvtoyp branch from a7fa909 to 6535fde Compare September 14, 2026 20:45
@abcxff
abcxff force-pushed the stack/fix-workflow-engine-clear-pruned-loop-history-via-batched-bounded-deletes-nrzuuryv branch from d2604f9 to 7a3397b Compare September 14, 2026 20:45
@railway-app
railway-app Bot temporarily deployed to rivet-frontend / actors-pr-5718 September 14, 2026 20:45 Destroyed
@abcxff
abcxff changed the base branch from stack/fix-workflow-engine-clear-pruned-loop-history-via-batched-bounded-deletes-nrzuuryv to main September 14, 2026 20:45
@abcxff
abcxff merged commit 6535fde into main Sep 14, 2026
9 of 29 checks passed
@abcxff
abcxff deleted the stack/fix-frontend-enforce-dns-safe-cluster-names-in-byoc-create-form-kzpvtoyp branch September 14, 2026 20:46
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