Skip to content

fix: Require at least one alphanumeric char in workspace name#9263

Open
okxint wants to merge 1 commit into
makeplane:previewfrom
okxint:fix/workspace-name-alphanumeric-required-2
Open

fix: Require at least one alphanumeric char in workspace name#9263
okxint wants to merge 1 commit into
makeplane:previewfrom
okxint:fix/workspace-name-alphanumeric-required-2

Conversation

@okxint

@okxint okxint commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

COMPANY_NAME_REGEX only blocks disallowed characters — it never checks that the name actually contains a letter or digit. So names like -_________- or --- pass validation cleanly.

Added a second check using \p{L}\p{N} (Unicode-aware) in both validateCompanyName and validateWorkspaceName. International names (Japanese, Arabic, accented chars) still pass fine since \p{L} covers all Unicode letters.

Closes #9255

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced validation for company and workspace names to require at least one letter or number in addition to existing allowlist rules.

`COMPANY_NAME_REGEX` blocks disallowed chars but accepts symbol-only
strings like `-_________-` since `-` and `_` are in the allowed set.
Add `HAS_ALPHANUMERIC_REGEX` and check it in `validateWorkspaceName`
and `validateCompanyName` so inputs with no letter or digit are rejected.

Fixes makeplane#9255

Signed-off-by: okxint <cashmein.eth@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1104d283-3244-4768-820c-014605b144e1

📥 Commits

Reviewing files that changed from the base of the PR and between 53a323d and 6deb3c6.

📒 Files selected for processing (1)
  • packages/utils/src/validation.ts

📝 Walkthrough

Walkthrough

Adds a new exported regex constant HAS_ALPHANUMERIC_REGEX that matches at least one Unicode letter or digit. Both validateCompanyName and validateWorkspaceName are updated to apply this regex as an additional post-allowlist check, returning an error when the input contains no letters or numbers.

Changes

Alphanumeric validation for company and workspace names

Layer / File(s) Summary
HAS_ALPHANUMERIC_REGEX definition and validator updates
packages/utils/src/validation.ts
Defines HAS_ALPHANUMERIC_REGEX (/\p{L}|\p{N}/u) with inline documentation, then applies it in validateCompanyName and validateWorkspaceName after existing injection-risk and allowlist checks, returning a "must contain at least one letter or number" error for symbol-only inputs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A name made of dashes? Not on my watch!
The rabbit demands at least one letter or notch.
No -_________- shall slip through the gate,
A letter or digit must show up — don't be late!
Hop hop, the regex is set, the symbols retreat. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides clear context about the validation gap and the solution using Unicode-aware regex, but lacks the structured template sections for Type of Change, Test Scenarios, and other required template elements. Add missing template sections: specify Type of Change (Bug fix), describe Test Scenarios, and follow the full description template structure for consistency.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly relates to the main change: requiring at least one alphanumeric character in workspace names, which is the primary objective addressed.
Linked Issues check ✅ Passed The changes fully address issue #9255 by adding Unicode-aware alphanumeric validation to both validateCompanyName and validateWorkspaceName functions, preventing symbol-only workspace names.
Out of Scope Changes check ✅ Passed All changes are focused on adding the HAS_ALPHANUMERIC_REGEX validation check to the two validation functions, directly addressing the linked issue objective with no out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

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.

[bug]: [bug]: Workspace name field accepts symbol-only input (e.g. "-_________-") despite active character validation

1 participant