fix(dashboard): add URL auto-recovery and 404 suggestions (CLI-1K0)#895
Merged
fix(dashboard): add URL auto-recovery and 404 suggestions (CLI-1K0)#895
Conversation
…rd view (CLI-1K0) When a numeric dashboard ID returns 404, fetch up to 5 available dashboards from the org and show them as suggestions in the error message. This helps both AI agents and humans discover what's available instead of hitting a dead end. Also adds Sentry dashboard URL parsing — users can paste a full URL like https://sentry-sdks.sentry.io/dashboard/4326879/ and the CLI extracts org + dashboard ID automatically, with host-scoping trust checks for non-SaaS URLs via applySentryUrlContext.
Contributor
|
Contributor
Codecov Results 📊✅ 6473 passed | Total: 6473 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 78.92%. Project has 13225 uncovered lines. Files with missing lines (8)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 75.98% 76.04% +0.06%
==========================================
Files 295 295 —
Lines 55045 55185 +140
Branches 0 0 —
==========================================
+ Hits 41819 41960 +141
- Misses 13226 13225 -1
- Partials 0 0 —Generated by Codecov Action |
…ve return Address review feedback: consistently use async callbacks in .catch() for enrichDashboardError, add defensive return await on the 404 path, and fix suggestion formatting (remove stray empty bullet).
…li-1k0 # Conflicts: # AGENTS.md # src/commands/dashboard/resolve.ts
…essage - parseDashboardListArgs now detects pasted Sentry URLs: suggests 'sentry dashboard view' for dashboard-specific URLs, extracts org context for org-only URLs - tryExtractDashboardUrl error message uses '<command>' instead of hardcoded 'view' since it's called from view/widget add/edit/delete
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
https://sentry-sdks.sentry.io/dashboard/4326879/and the CLI extracts org + dashboard ID automaticallyapplySentryUrlContext(security)enrichDashboardErrorasync with consistentasync.catch()callbacks across all dashboard commandsFixes CLI-1K0
Before
After
And pasting a URL like
sentry dashboard view https://sentry-sdks.sentry.io/dashboard/4326879/now auto-extracts the org and dashboard ID instead of failing with a parse error.