Skip to content

fix(arg-parsing): handle colon-separated issue identifiers (CLI-PH)#868

Merged
BYK merged 3 commits intomainfrom
fix/cli-ph-short-id-parsing
Apr 28, 2026
Merged

fix(arg-parsing): handle colon-separated issue identifiers (CLI-PH)#868
BYK merged 3 commits intomainfrom
fix/cli-ph-short-id-parsing

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 28, 2026

Summary

  • Adds support for colon-separated issue identifiers (PROJECT:SHORTID and PROJECT:NUMERICID)
  • Prevents 64 users from hitting "Short ID not found" errors (CLI-PH, 108 events)
  • Common patterns now work correctly:
    • CHATEX:CHATEX-W9 → project=chatex, suffix=W9
    • MYAH-FRONTEND:115562020 → numeric ID 115562020 (direct lookup)
    • ARES-BACKEND:4P → project=ares-backend, suffix=4P

Changes

  • src/lib/arg-parsing.ts: Add parseWithColon() helper and early colon detection in parseIssueArg() before slash/dash parsing
  • test/lib/arg-parsing.test.ts: Add comprehensive tests for colon-separated formats including edge cases

How it works

When a colon is detected in the input, parseWithColon splits on the first colon:

  • If the right side is all digits → numeric type (direct API fetch by ID)
  • If the right side contains a dash → extracts suffix from last dash (same as standard short ID parsing)
  • Otherwise → uses entire right side as suffix

Edge cases (:W9, CLI:) with empty parts fall through to existing parsing.

Fixes https://sentry.sentry.io/issues/7367442019/

Users sometimes type PROJECT:SHORTID or PROJECT:NUMERICID where the
colon separates the project slug from the issue identifier. Before this
fix, the colon was silently treated as part of the project slug, causing
the API to fail with 'Short ID not found' errors (64 users, 108 events).

Now parseIssueArg recognizes colons as project:id separators:
- CHATEX:CHATEX-W9 → project=chatex, suffix=W9
- MYAH-FRONTEND:115562020 → numeric ID 115562020
- ARES-BACKEND:4P → project=ares-backend, suffix=4P
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-868/

Built to branch gh-pages at 2026-04-28 23:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

Codecov Results 📊

6224 passed | Total: 6224 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +9
Passed Tests 📈 +9
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 64.81%. Project has 13048 uncovered lines.
❌ Project coverage is 75.85%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/arg-parsing.ts 64.81% ⚠️ 19 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    75.86%    75.85%    -0.01%
==========================================
  Files          293       293         —
  Lines        53980     54034       +54
  Branches         0         0         —
==========================================
+ Hits         40952     40986       +34
- Misses       13028     13048       +20
- Partials         0         0         —

Generated by Codecov Action

Comment thread src/lib/arg-parsing.ts
When input contains both a slash and colon (e.g., sentry/CLI:W9),
parseWithColon now returns null so the slash parser handles it
correctly. Addresses Cursor Bugbot review comment.
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f0d5549. Configure here.

Comment thread src/lib/arg-parsing.ts
Prevents suffix corruption when input like CLI:foo/bar reaches
parseWithColon. Now returns null so the slash parser handles it.

Addresses Cursor Bugbot low-severity finding.
@BYK BYK merged commit cda9384 into main Apr 28, 2026
26 checks passed
@BYK BYK deleted the fix/cli-ph-short-id-parsing branch April 28, 2026 23:15
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