fix: lowercase project slug in issue arg parsing (CLI-C8)#496
Conversation
When users type issue short IDs in uppercase (e.g., 'EASI-API-3Y4'), the parser extracts the project slug as 'EASI-API' (uppercase). Since Sentry slugs are always lowercase, the API lookup fails with 'Project not found'. This affects 12 users (CLI-C8). Lowercase the project slug in both parseWithDash (bare short IDs) and parseAfterSlash (org-prefixed short IDs) since Sentry project slugs are always lowercase.
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. |
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 1058 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.74% 95.71% -0.03%
==========================================
Files 180 180 —
Lines 24669 24679 +10
Branches 0 0 —
==========================================
+ Hits 23617 23621 +4
- Misses 1052 1058 +6
- Partials 0 0 —Generated by Codecov Action |
Address Bugbot review: parseMultiSlashIssueArg was missing the same lowercase normalization applied to the other two parsing functions.
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.
| ); | ||
| } | ||
|
|
||
| // Lowercase project slug — Sentry slugs are always lowercase. |
There was a problem hiding this comment.
Missing project lowercase in URL parsing path
High Severity
The issueArgFromUrl function at line 403 returns project without calling .toLowerCase(), while the same normalization was added to parseWithDash, parseAfterSlash, and parseMultiSlashIssueArg. This means parsing https://sentry.io/organizations/my-org/issues/CLI-G/ still produces project: "CLI" (uppercase), causing the same API lookup failure this PR intends to fix. The existing tests at lines 354 and 367 confirm the uppercase behavior persists for URLs.
…low-up) Address unresolved Bugbot review from PR #496: issueArgFromUrl returned the project slug without .toLowerCase() when parsing Sentry issue URLs like https://sentry.io/organizations/org/issues/CLI-G/. This meant the URL parsing path still produced uppercase project slugs ('CLI') that would fail API lookups, while the other three parsing paths (parseWithDash, parseAfterSlash, parseMultiSlashIssueArg) were already fixed.
…low-up) (#506) ## Follow-up to PR #496 Addresses unresolved [Bugbot review comment](#496 (comment)) (High severity) that was missed before merging #496. ## Problem `issueArgFromUrl` returned the project slug without `.toLowerCase()` when parsing Sentry issue URLs like: ``` https://sentry.io/organizations/my-org/issues/CLI-G/ ``` This produced `project: "CLI"` (uppercase) which fails API lookups since Sentry slugs are always lowercase. The other three parsing paths (`parseWithDash`, `parseAfterSlash`, `parseMultiSlashIssueArg`) were already fixed in PR #496. ## Fix Added `.toLowerCase()` to the project slug in `issueArgFromUrl` and updated two test expectations to match.


Problem
When users type issue short IDs in uppercase (e.g.,
sentry issue view EASI-API-3Y4), the parser extractsEASI-APIas the project slug. Since Sentry slugs are always lowercase, the API lookup fails withProject 'EASI-API' not found. Affects 12 users (CLI-C8).Fix
Lowercase the project slug extracted from issue short IDs in two locations:
parseWithDash— bare short IDs likeEASI-API-3Y4→ project=easi-api, suffix=3Y4parseAfterSlash— org-prefixed short IDs likeorg/CLI-G→ project=cli, suffix=GThe suffix remains uppercase (correct for short ID lookup), only the project slug is lowercased.
Test Changes
Updated one test expectation:
o1081365/CLI-Gnow correctly producesproject: "cli"instead ofproject: "CLI".