Allow special characters and non-Latin scripts in job names#4594
Allow special characters and non-Latin scripts in job names#4594m4cd4r4 wants to merge 1 commit intoOpenFn:mainfrom
Conversation
The name validation regex blocked non-ASCII characters, preventing users who speak non-English languages from using native scripts (Arabic, French accents, etc.) in their workflow step names. Step names are treated as labels in the YAML export, not as identifiers, so the restriction was unnecessary. Removes the character-set validation from the Elixir changeset, the PlaceholderJob React component, and the collaborative editor Zod schema. The 100-character length limit is kept. Fixes OpenFn#4577
|
The |
|
This needs thinking through. Why did we have character restrictions in the first place? Are there any characters which we truly can't support? Are there database limitations? I know we generate an id slug from the name the user enters, is that robust to non-latin characters? Is it adequately tested? We need real assurance that this is stable before we can merge it. |
|
Agreed, @josephjclark the original purpose of that validation was to ensure they are url-safe. While we only address them by uuid currently, the project yaml files reference by keys derived (or directly) from the name. So the surface area and tradeoffs aren't so quite so cut and dry to drop the name. Although we do allow spaces currently which means they technically aren't url-safe (would need |
Summary
Closes #4577
Workflow step names are stored as labels in YAML exports, not as
identifiers. The existing regex (
/^[a-zA-Z0-9_\- ]*$/) was unnecessarilyblocking non-English users from entering names in their native scripts
(Arabic, French, Chinese, etc.) or using characters like
@or'.Removes the character-set restriction from three locations:
lib/lightning/workflows/job.ex- Elixir changeset validationassets/js/workflow-diagram/nodes/PlaceholderJob.tsx- PlaceholderJob inline validationassets/js/collaborative-editor/types/job.ts- Zod schema for collaborative editorThe 100-character length limit and blank-name check are preserved.
Validation steps
mix formatmix test test/lightning/workflows/job_test.exs --seed 0Checklist