feat(issue): add short ID aliases for multi-project support#31
Merged
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
🤖 This preview updates automatically when you update the PR. |
8387c43 to
6824e4d
Compare
- Add project alias caching for quick issue lookup in monorepos - Support alias-suffix format (e.g., 'e-4y' → 'SPOTLIGHT-ELECTRON-4Y') - Strip common word prefix for cleaner aliases (spotlight-* → e, w, s) - Add short suffix expansion with project context (e.g., '4y' → 'PROJECT-4Y') - Include tests for alias generation and short ID parsing
6824e4d to
f232713
Compare
…c IDs Pure numeric strings like '12345' should be treated as issue IDs, not short suffixes. Update isShortSuffix pattern to require at least one letter, fixing the E2E test that passes '12345' expecting an auth error.
Contributor
Codecov Results 📊✅ Patch coverage is 89.57%. Project has 1179 uncovered lines. Files with missing lines (18)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 64.18% 58.15% -6.03%
==========================================
Files 28 32 +4
Lines 2211 2817 +606
Branches 0 0 —
==========================================
+ Hits 1419 1638 +219
- Misses 792 1179 +387
- Partials 0 0 —Generated by Codecov Action |
…suffix Short suffixes like '12' are valid (e.g., CRAFT-12), so we can't require letters in the pattern. Instead, when no project context is available to expand a short suffix, fall back to treating it as a numeric issue ID. This fixes the E2E test where '12345' without project context should attempt to fetch as a numeric ID (triggering auth error) rather than throwing ContextError about missing org/project.
betegon
requested changes
Jan 22, 2026
Move issue suffix parsing functions to a shared location for reuse by future commands (issue fix, issue why): - isShortId: check if ID contains letters (vs numeric) - isShortSuffix: check if input is alphanumeric without hyphens - parseAliasSuffix: parse alias-suffix format (e.g., 'e-4y') - expandToFullShortId: expand suffix to full short ID Also includes: - Fix strippedPrefix handling for projects without common prefix - Use boldUnderline for alias/suffix highlighting - Move tests to test/lib/issue-id.test.ts
- Add tests for project alias config functions (setProjectAliases, getProjectAliases, getProjectByAlias, clearProjectAliases) - Extract findCommonWordPrefix and findShortestUniquePrefixes to src/lib/alias.ts for reuse and proper test coverage - Update tests to import from lib instead of re-implementing - Add ANSI formatting tests for formatShortId
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 was referenced Jan 23, 2026
Member
|
this closed #44 |
BYK
added a commit
that referenced
this pull request
Jan 27, 2026
## Summary Fixes #42 - The `explain` and `plan` commands now support all issue ID formats introduced in PR #31: - **Alias-suffix format** (e.g., `f-g` where `f` is a cached project alias from `issue list`) - **Short suffix format** (e.g., `G` or `4Y` - requires project context) - **Full short ID format** (e.g., `CRAFT-G`) - **Numeric ID format** (e.g., `123456789`) ## Changes - Updated `resolveOrgAndIssueId` in `src/commands/issue/utils.ts` to handle all four issue ID formats with proper fallback logic - Added tests for alias-suffix and short suffix format resolution
3 tasks
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
Adds short ID aliases for easier issue lookup in monorepos with multiple Sentry projects.
Features
e-4yinstead ofSPOTLIGHT-ELECTRON-4Yspotlight-are stripped, giving aliases likee,w,sinstead ofspotlight-e,spotlight-w4yto getPROJECT-4Yissue listfor fast lookup inissue getExample
Changes
src/commands/issue/list.ts- Add alias generation with common prefix strippingsrc/commands/issue/get.ts- Add alias-suffix parsing and expansionsrc/lib/config.ts- Add project alias caching functionssrc/lib/formatters/human.ts- Add short ID formatting with alias displaysrc/types/config.ts- Add ProjectAliasEntry schematest/commands/issue-*.ts- Add tests for alias generation and parsing