Repository navigation
Conversation
…sue key Orca lowercases the whole generated name for Jira-linked workspaces, so teams whose branch convention requires the canonical key (PROJ-123-...) rename every branch by hand, and renaming later cannot fix the already-created worktree directory. A Jira Key Casing setting (default: lowercase, unchanged) now restores the canonical key at the start of the generated seed, which feeds both the directory and the branch, and the same policy applies to "Copy suggested branch name". The key is re-uppercased after slugify rather than changing slugify itself, so non-Jira providers and user-typed names keep their current behavior. Refs stablyai#18183 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
|
Could this setting offer a third option, |
ELI5
When you start a workspace from a Jira issue, Orca names the folder and branch like
proj-123-android-feature— it lowercases the Jira key too. Teams whose convention is the real key (PROJ-123-android-feature) had to rename every branch by hand. This adds a setting so they don't have to; the default stays exactly as today.What Changed
Lowercase(default, current behavior) orUppercase key.PROJ-123 Android login featureis suggested and created asproj-123-android-login-feature(directory and branch).Uppercase key: the same workspace is suggested and created asPROJ-123-android-login-feature. "Copy suggested branch name" follows the same setting.slugifyForWorkspaceName(which lowercases everything). A newapplyJiraIssueKeyCasingstep then restores the canonical uppercase key only at the start of the generated seed, and only when the item has a valid Jira key ([A-Z][A-Z0-9_]*-\d+, so any project key works — no allowlist). That one seed feeds the directory and the branch, so they cannot drift apart.PROJ-123-…would silently revert to lowercase on create).Why
Renaming a branch after creation doesn't fix the worktree directory, which is already created with the lowercase name, and a repo-level AI prompt can't control deterministic naming — so the choice has to happen when the seed is generated.
Re-uppercasing after slugify (instead of teaching slugify about casing) keeps one shared slug rule for every provider and limits the change to the Jira key itself; the key's characters always survive the slug's strip, so restoring the case is lossless.
Scope note: #18183 also asks for an uppercase Jira-key prefix on GitHub PR / GitLab MR titles (including AI-generated titles). That lives in a different subsystem (review creation), so I kept it out of this PR to keep it small; happy to follow up separately.
Linked Issue
Fixes #18183
Visual Proof
Settings → Git
New workspace composer for a Jira issue
PROJ-123 Android login featureCreated workspace with
Uppercase key(branch and directory are bothPROJ-123-android-login-feature)Testing
Unit:
src/shared/workspace-name.test.ts(both policies,ALT-42/TEAM_ALPHA9-7key shapes, non-leading / prefix-collision keys, non-Jira items untouched),jira-issue-workspace-actions.test.ts(Copy suggested branch name),useComposerState-host-context-boundaries.test.ts(auto-managed name detection),composer-name-ownership.test.ts(submit keeps the uppercase key; verified it fails without the fix).Related suites: 415 files / 2830 tests pass;
pnpm tcpasses;check:code-quality:changedpasses (0 findings, incl. design system); localization catalog/extraction/coverage checks pass.E2E (macOS, headless Electron via Playwright, throwaway spec not committed): with
Uppercase key, creating a workspace from a Jira-linked composer producedgit branch→PROJ-123-android-login-featureand worktree directory…/PROJ-123-android-login-feature; with the default it produced the lowercase name.Platforms: macOS only. Linux / Windows / SSH not run; the change is a pure string transform in shared code plus a renderer setting, and the main-process sanitizer already preserves case.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Implemented with Claude Code (Claude Opus 5.5); I reviewed the diff and the test/E2E results.
Review
Agent skill upstream boundary
Notes
jiraIssueKeyCasingis a new settings field defaulting tolowercase; a missing or unknown value is treated as lowercase, so older clients and stores keep current behavior.proj-123-xworktree already exists, creatingPROJ-123-xafter switching the policy collides only by case. This PR doesn't change collision handling (related: [Bug]: worktree create uses the GitHub login verbatim as a branch prefix, colliding with the lowercase namespace on case-insensitive filesystems #15857).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)🤖 Generated with Claude Code