fix: detect issue short IDs passed to issue list (CLI-C3)#488
Merged
Conversation
When users pass an issue short ID like 'CONVERSATION-SVC-F' or 'CLI-BM' to `sentry issue list`, the CLI interprets it as a project slug and fails with 'Project not found'. Short IDs are all-uppercase with a dash-separated suffix — a pattern that never occurs in project slugs (which are always lowercase). This adds a pre-flight check using the existing looksLikeIssueShortId() helper to detect this pattern and throw a helpful ResolutionError that suggests using `sentry issue view` instead. Fixes CLI-C3 (24 users affected).
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1037 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.77% 95.77% —%
==========================================
Files 180 180 —
Lines 24534 24536 +2
Branches 0 0 —
==========================================
+ Hits 23497 23499 +2
- Misses 1037 1037 —
- Partials 0 0 —Generated by Codecov Action |
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.
Address Cursor Bugbot review: the first suggestion duplicated the primary hint command. Kept only the genuinely different alternative.
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.

Problem
When users run
sentry issue list CONVERSATION-SVC-For similar commands with an issue short ID, the CLI interprets it as a project slug to search for. Since project slugs are always lowercase and short IDs are uppercase, no project is found and the user sees:This affects 24 users (CLI-C3).
Fix
Added a pre-flight check in the
project-searchhandler ofissue listthat uses the existinglooksLikeIssueShortId()utility to detect when the input looks like an issue short ID (all-uppercase, dash-separated with alphanumeric suffix). When detected, throws a helpfulResolutionErrorthat suggests usingsentry issue viewinstead:Key Design Decisions
looksLikeIssueShortId()pattern which requires all-uppercase with dash separators — this avoids false positives on legitimate lowercase project slugsfindProjectsBySlug, saving a round tripResolutionError(notContextError) because the user provided a value that couldn't be matched