fix(arg-parsing): handle colon-separated issue identifiers (CLI-PH)#868
Merged
fix(arg-parsing): handle colon-separated issue identifiers (CLI-PH)#868
Conversation
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
Contributor
|
Contributor
Codecov Results 📊✅ 6224 passed | Total: 6224 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 64.81%. Project has 13048 uncovered lines. Files with missing lines (1)
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 |
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.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
PROJECT:SHORTIDandPROJECT:NUMERICID)CHATEX:CHATEX-W9→ project=chatex, suffix=W9MYAH-FRONTEND:115562020→ numeric ID 115562020 (direct lookup)ARES-BACKEND:4P→ project=ares-backend, suffix=4PChanges
src/lib/arg-parsing.ts: AddparseWithColon()helper and early colon detection inparseIssueArg()before slash/dash parsingtest/lib/arg-parsing.test.ts: Add comprehensive tests for colon-separated formats including edge casesHow it works
When a colon is detected in the input,
parseWithColonsplits on the first colon:numerictype (direct API fetch by ID)Edge cases (
:W9,CLI:) with empty parts fall through to existing parsing.Fixes https://sentry.sentry.io/issues/7367442019/