Commit 0714d27
authored
## Problem
When users specify an explicit org/project (e.g., `sentry issue list
elide/elide-server`) and the project isn't found, the error only says:
```
Project 'elide-server' not found in organization 'elide'.
Try:
sentry issue list elide/<project>
Or:
- Check the project slug at https://sentry.io/organizations/elide/projects/
```
This affects **36 users**
([CLI-C0](https://sentry.sentry.io/issues/7318131352/)). Users don't
know what the correct project slug is.
## Fix
Added a `findSimilarProjects()` helper that, on 404, lists available
projects in the org and finds similar slugs using case-insensitive
prefix/substring matching. Now the error includes suggestions:
```
Project 'elide-server' not found in organization 'elide'.
Try:
sentry issue list elide/<project>
Or:
- Similar projects: 'elide-api-server', 'elide-web'
- Check the project slug at https://sentry.io/organizations/elide/projects/
```
## Design Decisions
- **Best-effort**: `findSimilarProjects` catches all errors and returns
empty array on failure — the error message still works without
suggestions
- **Lightweight matching**: Uses case-insensitive prefix/substring
scoring (no heavy fuzzy matching library needed). Scores: exact
case-insensitive match (3) > prefix match (2) > substring match (1)
- **Limited results**: Returns at most 3 similar slugs to keep the error
message readable
- **Non-blocking**: Only runs on 404 errors, not on every project fetch
1 parent aaabc30 commit 0714d27
1 file changed
+59
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
554 | 600 | | |
555 | 601 | | |
556 | 602 | | |
557 | 603 | | |
558 | 604 | | |
559 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
560 | 609 | | |
561 | 610 | | |
562 | 611 | | |
| |||
568 | 617 | | |
569 | 618 | | |
570 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
571 | 629 | | |
572 | 630 | | |
573 | 631 | | |
574 | 632 | | |
575 | | - | |
576 | | - | |
577 | | - | |
| 633 | + | |
578 | 634 | | |
579 | 635 | | |
580 | 636 | | |
| |||
0 commit comments