Skip to content

fix(linear): accept team keys that start with a digit - #23423

Merged
AmethystLiang merged 1 commit into
stablyai:mainfrom
leilei3167:fix/issue-23422-linear-digit-team-key
Sep 27, 2026
Merged

AmethystLiang merged 1 commit into
stablyai:mainfrom
leilei3167:fix/issue-23422-linear-digit-team-key

Conversation

@leilei3167

Copy link
Copy Markdown
Contributor

ELI5

Some Linear teams use a short key that starts with a number (for example 4K, so issues look like 4K-12). Orca treated those as invalid when linking a worktree, even though letter-first keys like STA-335 worked.

What Changed

  • Before: LINEAR_IDENTIFIER_PATTERN required the team key to start with a letter, so bare 4K-12 and https://linear.app/.../issue/4K-12 were rejected.
  • After: identifiers may start with a digit when the key still contains at least one letter, so 4K-12 parses and links. Purely numeric keys such as 2026-09 stay rejected.

Why

Linear allows digit-first team keys; the old regex was stricter than Linear's own identifiers. The lookahead keeps a letter somewhere in the key so date-like bare text is not mistaken for an issue id.

Linked Issue

Fixes #23422

Visual Proof

N/A — parsing only; no UI change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

pnpm exec vitest run --config config/vitest.config.ts src/shared/linear/links.test.ts

  • With the old pattern on main, the new digit-key cases fail (2 failed / 19 tests).
  • With this change, the same file passes (19/19).
  • pnpm exec oxfmt --check src/shared/linear/links.ts src/shared/linear/links.test.ts — clean.

AI Disclosure

Review

Self-review notes:

  • Cross-platform: shared parser used by CLI and link updates; no platform branches.
  • SSH/remote/local: same identifier validation everywhere.
  • Security: stricter rejection of letter-less keys like 2026-09 retained.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Two files only: src/shared/linear/links.ts and src/shared/linear/links.test.ts.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — this run reviewed the complete PR (single commit, 2 files): the widened Linear identifier pattern and its tests.

  • Digit-first team keys accepted — LINEAR_IDENTIFIER_PATTERN now requires an alphanumeric first character plus at least one letter anywhere in the team key, so 4K-12 parses both bare and from a linear.app/<org>/issue/4K-12 URL.
  • Date-like input still rejected — the positive lookahead cannot cross the - separator (it is outside [A-Za-z0-9_]), so 2026-09, 123-45, and letter-less keys remain rejected; the change only widens the accepted set.
  • Single-surface change — both parseLinearIssueInput and parseLinearIssueUrlIntent share the constant, and every downstream caller (issue-link input, smart-workspace intent, CLI, renderer, main-process issue context) inherits it; no parallel Linear identifier regex exists.
  • Tests — new positive cases for 4k-12, the URL form, and buildLinearIssueLinkUpdates, plus a negative 2026-09 case; the new positive cases fail against the old pattern, so they are meaningful coverage. Verified 19/19 pass locally.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 06a1da8b-ce04-4e9b-8bb9-6d286a682cc1

📥 Commits

Reviewing files that changed from the base of the PR and between 27b823f and 34e6644.

📒 Files selected for processing (2)
  • src/shared/linear/links.test.ts
  • src/shared/linear/links.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.


📝 Walkthrough

Walkthrough

The Linear identifier pattern now accepts team keys that start with a digit if they contain at least one letter. Tests cover bare identifiers, issue URLs, rejection of numeric-only team keys, and link-update behavior.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 34e66

Digit-leading Linear team keys containing letters are now accepted while numeric-only keys and non-HTTP(S) URLs remain rejected. No merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: accepting Linear team keys that start with a digit.
Description check ✅ Passed The description follows the required template and explains the user impact, implementation, rationale, linked issue, testing, compatibility considerations, and scope. It also states that visual proof …
Linked Issues check ✅ Passed Issue #23422 requires Linear identifiers with digit-first team keys and at least one letter, for both bare identifiers and URLs, while rejecting purely numeric keys. src/shared/linear/links.ts updat…
Out of Scope Changes check ✅ Passed The changes are limited to the Linear identifier pattern and focused automated tests. The implementation and tests directly support issue #23422. No unrelated change is shown.
  • Fix all pre-merge checks with AI

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.

@AmethystLiang
AmethystLiang merged commit 838769d into stablyai:main Sep 27, 2026
2 checks passed
nwparker added a commit to kenfdev/orca that referenced this pull request Oct 5, 2026
…ction

Main already provides numeric-leading team-key support via stablyai#23423. Retain its parser and workspace source flow, port the regression corpus to the renamed module, and cover normalized identifiers and strict URL intent in the workspace picker.
nwparker pushed a commit that referenced this pull request Oct 5, 2026
Expand numeric-leading Linear identifier coverage in the current parser and workspace source flow while rejecting numeric-only team keys in bare inputs and URLs. Main already implements the production behavior through #23423.

Repair two stale localization test assumptions found by full CI. All changes are regression tests.

Validation: 369 focused tests across 46 suites, local typechecking/lint/formatting, and full final-head CI passed.

Co-authored-by: Ken Fukuyama <[email protected]>
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]: Linear issues whose team key starts with a digit (4K-12) cannot be linked

2 participants