Skip to content

fix: suggest similar projects on project-search miss (CLI-A4)#511

Merged
BYK merged 1 commit intomainfrom
fix/cli-a4-fuzzy-project-search
Mar 20, 2026
Merged

fix: suggest similar projects on project-search miss (CLI-A4)#511
BYK merged 1 commit intomainfrom
fix/cli-a4-fuzzy-project-search

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 20, 2026

Problem

When sentry issue list patagonai finds no project matching the slug across all orgs, the error only says:

Project 'patagonai' not found.
  No project with this slug found in any accessible organization

Users don't know if they misspelled the slug. Affects 16 users (CLI-A4).

Fix

When no exact match is found, try word-boundary matching via findProjectsByPattern (the same function used by directory name inference) and suggest similar projects:

Project 'patagonai' not found.

Try:
  sentry project list

Or:
  - Similar projects: 'my-org/patagon-ai'
  - No project with this slug found in any accessible organization

Only runs on the error path so the extra API cost is acceptable.

When 'sentry issue list <slug>' finds no exact project match across
orgs, now tries word-boundary matching via findProjectsByPattern to
suggest similar projects. This helps users who misspell or misremember
project slugs (CLI-A4, 16 users).

Example:
  Project 'patagonai' not found.
  Try: sentry project list
  Or:
    - Similar projects: 'my-org/patagon-ai'
    - No project with this slug found in any accessible organization

Only runs on the error path so the extra API cost is acceptable.
@github-actions
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 ✨

  • (telemetry) Track TTY vs non-TTY invocations via metric by betegon in #482
  • Dynamic cache-backed shell completions with fuzzy matching by BYK in #465

Bug Fixes 🐛

  • (help) Hide ASCII banner when stdout is not a TTY by betegon in #501
  • (json) Flatten view command JSON output for --fields filtering by BYK in #495
  • (polling) Throw TimeoutError instead of bare Error on timeout by BYK in #503
  • (project) Fallback to org listing when bare slug matches an organization by betegon in #475
  • Suggest similar projects on project-search miss (CLI-A4) by BYK in #511
  • Add 403 scope guidance to issue list error handling (CLI-97) by BYK in #508
  • Propagate 403 from multi-region fan-out instead of returning empty list (CLI-89) by BYK in #507
  • Lowercase project slug in URL-parsed issue short IDs (CLI-C8 follow-up) by BYK in #506
  • Handle EIO stream errors gracefully in bin.ts by BYK in #505
  • Use fuzzyMatch for similar project suggestions and add tests (CLI-C0) by BYK in #504
  • Use resolved org in numeric issue ID 404 hint (CLI-BT) by BYK in #502
  • Include API endpoint in error messages for better diagnostics (CLI-BS) by BYK in #500
  • Enrich 403 on org listing with token scope guidance (CLI-89) by BYK in #498
  • Add 400 suggestions to org-all issue list path (CLI-BY) by BYK in #497
  • Lowercase project slug in issue arg parsing (CLI-C8) by BYK in #496
  • Enrich short ID 404 with org context and suggestions (CLI-A1) by BYK in #494
  • Suggest similar projects when project not found in org (CLI-C0) by BYK in #493
  • Event 404 hint should suggest different project, not repeat failing command by BYK in #492
  • Enrich event 404 errors with retention and format suggestions (CLI-6F) by BYK in #491
  • Add actionable suggestions for 400 Bad Request on issue list (CLI-BM, CLI-7B) by BYK in #489
  • Detect issue short IDs passed to issue list (CLI-C3) by BYK in #488
  • Add Glob.match() polyfill + improve auto-detect diagnostics (CLI-7T) by BYK in #487
  • Add org-slug pre-check to dispatchOrgScopedList (CLI-9A) by BYK in #485

Internal Changes 🔧

  • (issue) Skip getProject round-trip in project-search resolution by betegon in #473
  • (resolve) Carry project data through resolution to eliminate redundant getProject calls by BYK in #486
  • (telemetry) Convert is_tty metric to span tag by betegon in #499
  • HTTP latency optimizations — diagnostics, cache warming, concurrency limits by BYK in #490
  • Switch from @sentry/bun to @sentry/node-core/light (~170ms startup savings) by BYK in #474
  • Regenerate skill files by github-actions[bot] in b7b240ec

🤖 This preview updates automatically when you update the PR.

@BYK BYK enabled auto-merge (squash) March 20, 2026 12:21
@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1039 uncovered lines.
✅ Project coverage is 95.8%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.78%    95.80%    +0.02%
==========================================
  Files          180       180         —
  Lines        24759     24759         —
  Branches         0         0         —
==========================================
+ Hits         23714     23720        +6
- Misses        1045      1039        -6
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 9575ac1 into main Mar 20, 2026
22 checks passed
@BYK BYK deleted the fix/cli-a4-fuzzy-project-search branch March 20, 2026 12:23
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.

1 participant