Skip to content

fix(issue): support short ID aliases in explain and plan commands#74

Merged
BYK merged 11 commits into
mainfrom
fix/issue-explain-plan-alias-support
Jan 27, 2026
Merged

fix(issue): support short ID aliases in explain and plan commands#74
BYK merged 11 commits into
mainfrom
fix/issue-explain-plan-alias-support

Conversation

@BYK

@BYK BYK commented Jan 26, 2026

Copy link
Copy Markdown
Member

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

@github-actions

github-actions Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Issue

  • Add workspace-scoped alias cache by BYK in #52
  • Add short ID aliases for multi-project support by BYK in #31

Other

  • (api) Align with gh api and curl conventions by BYK in #60
  • (auth) Add press 'c' to copy URL during login flow by betegon in #58
  • (commands) Rename get commands to view and add -w browser flag by BYK in #53
  • Add explain and plan commands (Seer AI) by MathurAditya724 in #39
  • Add Sentry SDK for error tracking and usage telemetry by BYK in #63

Bug Fixes 🐛

Issue

  • Support short ID aliases in explain and plan commands by BYK in #74
  • Use correct fallback for unrecognized alias-suffix inputs by BYK in #72
  • Handle cross-org project slug collisions in alias generation by BYK in #62
  • Use org-scoped endpoint for latest event + enhanced display by betegon in #40

Other

  • (api) Use query params for --field with GET requests by BYK in #59

Documentation 📚

  • (issue) Update list command tips to reference view instead of get by BYK in #73
  • (readme) Add installation section by betegon in #65
  • Update command references from 'get' to 'view' and document -w flag by BYK in #54

Internal Changes 🔧

  • (release) Fix changelog-preview permissions by BYK in #41
  • Rename config folder from .sentry-cli-next to .sentry by BYK in #50

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 98.73%. Project has 1724 uncovered lines.
✅ Project coverage is 63.99%. Comparing base (base) to head (head).

Files with missing lines (23)
File Patch % Lines
human.ts 18.35% ⚠️ 672 Missing
resolve-target.ts 18.67% ⚠️ 257 Missing
oauth.ts 21.71% ⚠️ 202 Missing
resolver.ts 3.23% ⚠️ 120 Missing
errors.ts 5.94% ⚠️ 95 Missing
api-client.ts 73.48% ⚠️ 74 Missing
fixture.ts 28.74% ⚠️ 62 Missing
api.ts 89.78% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
errors.ts 73.17% ⚠️ 33 Missing
seer.ts 77.04% ⚠️ 31 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 87.79% ⚠️ 16 Missing
cache.ts 76.27% ⚠️ 14 Missing
telemetry.ts 89.87% ⚠️ 8 Missing
config.ts 97.11% ⚠️ 7 Missing
index.ts 95.06% ⚠️ 4 Missing
colors.ts 91.84% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
alias.ts 98.56% ⚠️ 2 Missing
utils.ts 99.17% ⚠️ 1 Missing
java.ts 97.22% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
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

@BYK BYK force-pushed the fix/issue-explain-plan-alias-support branch 2 times, most recently from 85cdd95 to 3b5d235 Compare January 26, 2026 21:40
@BYK BYK force-pushed the fix/issue-explain-plan-alias-support branch from 3b5d235 to b2a6c40 Compare January 26, 2026 21:45
Comment thread test/commands/issue/utils.test.ts Outdated
The o1: prefix already specifies the org, so --org <org> in the
command hint was misleading.
@BYK BYK marked this pull request as ready for review January 26, 2026 22:49
Comment thread src/commands/issue/utils.ts Outdated
BYK added 3 commits January 26, 2026 23:00
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
Comment thread src/commands/issue/utils.ts Outdated
Comment thread src/commands/issue/utils.ts Outdated
BYK added 4 commits January 26, 2026 23:11
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/commands/issue/utils.ts
Comment thread src/commands/issue/utils.ts
@BYK BYK merged commit e658568 into main Jan 27, 2026
15 checks passed
@BYK BYK deleted the fix/issue-explain-plan-alias-support branch January 27, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(issue): Add explain and plan commands (Seer AI)

1 participant