Skip to content

fix(utils): allow apostrophes in person names - #10271

Open
JunaidAhamed-7777 wants to merge 1 commit into
makeplane:previewfrom
JunaidAhamed-7777:fix/allow-apostrophes-in-person-names
Open

JunaidAhamed-7777 wants to merge 1 commit into
makeplane:previewfrom
JunaidAhamed-7777:fix/allow-apostrophes-in-person-names

Conversation

@JunaidAhamed-7777

@JunaidAhamed-7777 JunaidAhamed-7777 commented Nov 12, 2026 •

Copy link
Copy Markdown

Description

Allow ASCII apostrophes in first and last names, as the existing person-name pattern and documentation intend. The earlier shared character guard rejects names such as O'Brien and D'Arcy before that pattern is evaluated.

Exclude apostrophes only from the person-name validator's temporary guard input, then validate the unchanged original name against the existing pattern. The shared helper and display-name, company, workspace and slug validators keep their existing behavior. The error message no longer lists apostrophes as forbidden.

This affects the shared validation used by admin instance setup, onboarding and profile settings. It does not add period support, alter the existing whitespace/letter-presence rules, or transform submitted names.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Not applicable to this shared-validator change. No live browser flow was exercised.

Test Scenarios

  • Native Vitest 4.1.12: 42 tests passed, including a final repeat after aggregate validation.
  • Same tests with the original validator: 27 passed, 15 failed. Three failures demonstrate the apostrophe acceptance problem (O'Brien, D'Arcy, and the 50-character boundary); twelve are corrected error-message comparisons, not twelve additional acceptance defects.
  • Covers apostrophes combined with every remaining forbidden character, Unicode names, current whitespace/hyphen-only behavior, unsupported characters/URLs/control characters, 50/51-character limits, optional blanks, and unchanged other validators.
  • Frozen-lockfile installation passed. Vitest reuses the existing catalog and lock snapshot; no package versions were upgraded.
  • All 45 format/lint/type checks and 11 prerequisite package builds from the current Turbo check graph passed through native task execution. The unmodified pnpm check wrapper stopped when i18n's tsx CLI could not create an IPC listener (EPERM). For the separate complete graph run, the two i18n generator commands used supported node --import tsx scripts/generate-types.ts instead, without starting that listener or changing repository scripts.
  • git diff --check passed. Full application production builds, browser flows, database persistence and hosted CI were not run. Backend source inspection confirms no apostrophe-specific name rejection; this is not a persistence-test claim.

References

The same inconsistency was addressed in the earlier, closed-unmerged #9667. This current-preview change keeps the shared helper's API unchanged and adds focused regression coverage.

Related but separate: #10165, #10170 and #10174 handle periods/pre-filled validation. Their current diffs do not change the earlier apostrophe-rejecting guard. Test setup should be reconciled if another utils testing change lands first.

Summary by CodeRabbit

  • New Features
    • Person names can now include apostrophes. Existing character and length validation remains in place, and required versus optional handling of blank names is unchanged.
  • Bug Fixes
    • Apostrophes continue to be rejected in display names, company names, workspace names, and slugs.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

validatePersonName now allows apostrophes through its injection-risk check. The change adds validation tests and a Vitest test script and development dependency to @plane/utils.

Changes: Person-name validation

Layer / File(s) Summary
Validator behavior and test coverage
packages/utils/src/validation.ts, packages/utils/src/validation.test.ts, packages/utils/package.json
validatePersonName removes apostrophes before applying the shared injection-risk check. Tests cover person-name validation and confirm that other validators still reject apostrophes. The package adds a Vitest test script and development dependency.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • makeplane/plane#10147: Adds validateOptionalPersonName, which delegates non-empty names to the validator changed here.
  • makeplane/plane#10165: Changes the same validator and test setup, with a separate change to accepted name characters.
  • makeplane/plane#10125: Adds validateOptionalPersonName, which delegates non-empty names to the validator changed here.

Suggested reviewers: sriramveeraghanta

Merge Risk: Minimal · up to b939e

Person names with apostrophes will now be accepted in the shared validator, while other characters remain rejected. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the person-name validator now accepts apostrophes. It uses the conventional fix(utils) prefix and is concise and specific. It matches the raw summary and the PR object…
Description check Passed The description covers the change, the reason for it, the affected validators, and the scope limits. It fills the Type of Change section with Bug fix checked. It includes test scenarios with detailed …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the person-name validator now accepts apostrophes. It uses the conventional fix(utils) prefix and is concise and specific. It matches the raw summary and the PR objectives.

Full details: Description check

Explanation

The description covers the change, the reason for it, the affected validators, and the scope limits. It fills the Type of Change section with Bug fix checked. It includes test scenarios with detailed results and references to related PRs. The Screenshots section explains why no screenshots apply. The template's Description, Type of Change, Screenshots, Test Scenarios, and References sections are all present. The test-scenario text is long and dense, but the required information is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 55526239-9a22-41c5-bd69-e678d34335c4
Commits

Reviewing files that changed from the base of the PR and between 6190932 and b939e9e.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 3

  • packages/utils/package.json
  • packages/utils/src/validation.test.ts
  • packages/utils/src/validation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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