fix(issue): support short ID aliases in explain and plan commands#74
Merged
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Issue
Other
Bug Fixes 🐛Issue
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ Patch coverage is 98.73%. Project has 1724 uncovered lines. Files with missing lines (23)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 62.56% 63.99% +1.43%
==========================================
Files 40 40 —
Lines 4741 4787 +46
Branches 0 0 —
==========================================
+ Hits 2966 3063 +97
- Misses 1775 1724 -51
- Partials 0 0 —Generated by Codecov Action |
85cdd95 to
3b5d235
Compare
3b5d235 to
b2a6c40
Compare
BYK
commented
Jan 26, 2026
The o1: prefix already specifies the org, so --org <org> in the command hint was misleading.
Previously, a short suffix like 'G' would incorrectly fall through to the full short ID handler when no project context was available. This resulted in a confusing 404 error from an invalid API call. Now, short suffixes properly require project context and throw a ContextError with clear instructions when it's missing.
Extract helper functions for each issue ID format to reduce the cognitive complexity from 19 to below the 15 threshold: - resolveShortSuffixId: handles "G", "4Y" format - resolveFullShortId: handles "CRAFT-G" format - resolveNumericId: handles numeric IDs
The .catch(() => null) was swallowing all errors including network errors and API failures. Now only alias-not-found (null return) triggers fallback to full short ID. Real errors propagate properly. This is consistent with the behavior in view.ts.
The replace pattern used --org <org> but actual commands use --org <org-slug>. This meant the helpful --project suggestion was never shown to users. Updated to match actual command format.
The DSN detection scans the cwd directory. Using /tmp caused EACCES errors on CI when scanning system files. Using the isolated testConfigDir avoids these issues.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
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
Fixes #42 - The
explainandplancommands now support all issue ID formats introduced in PR #31:f-gwherefis a cached project alias fromissue list)Gor4Y- requires project context)CRAFT-G)123456789)Changes
resolveOrgAndIssueIdinsrc/commands/issue/utils.tsto handle all four issue ID formats with proper fallback logic