feat(workflows): generate short machine-nature names - #6906
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Sidebar create (root and in-folder) now passes Reviewed by Cursor Bugbot for commit 492c4a3. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryReplaces the space-themed workflow-name generator with short lowercase machine-nature pairs.
Confidence Score: 4/5The workflow-name collision behavior should be addressed before merging because an automatically generated duplicate currently prevents workflow creation. The new generator selects once from a substantially smaller, non-uniform namespace, while creation callers neither retry nor request deduplication, so a collision is returned to the user as a conflict. Files Needing Attention: apps/sim/stores/workflows/registry/utils.ts
|
| Filename | Overview |
|---|---|
| apps/sim/stores/workflows/registry/utils.ts | Introduces the weighted machine-nature generator, but its reduced namespace materially increases creation failures from same-folder name collisions. |
| apps/sim/stores/workflows/registry/utils.test.ts | Thoroughly verifies candidate formatting, length buckets, weighting, and all 7,050 combinations. |
Reviews (1): Last reviewed commit: "feat(workflows): generate short machine-..." | Re-trigger Greptile
| const length = randomItem(PREFERRED_NAME_LENGTHS) | ||
| return randomItem(WORKFLOW_NAMES_BY_LENGTH[length]) |
There was a problem hiding this comment.
Generated-name collisions block creation
When a folder already contains the selected machine-nature name, the generator returns that duplicate without retrying or suffixing it, causing workflow creation to return HTTP 409. The new length-weighted namespace contains only 7,050 names, materially increasing this failure rate over the previous larger Cartesian product.
717846f to
bea1ccc
Compare
Summary
.mutatefunction so folder workflow creation callbacks are not recreated when mutation state changesType of Change
Testing
bun run test -- stores/workflows/registry/utils.test.ts lib/workflows/utils.test.ts lib/workflows/orchestration/workflow-lifecycle.test.ts app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workflow-operations.test.tsxbun run lintbun run check:auditsbun run apps/sim/scripts/check-block-registry.ts origin/stagingChecklist