Skip to content

fix(dashboard): add URL auto-recovery and 404 suggestions (CLI-1K0)#895

Merged
BYK merged 5 commits intomainfrom
byk/fix-dashboard-404-cli-1k0
Apr 30, 2026
Merged

fix(dashboard): add URL auto-recovery and 404 suggestions (CLI-1K0)#895
BYK merged 5 commits intomainfrom
byk/fix-dashboard-404-cli-1k0

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 30, 2026

Summary

  • When a numeric dashboard ID returns 404, fetches up to 5 available dashboards from the org and shows them as suggestions in the error message
  • 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
  • Enforces host-scoping trust checks on extracted URLs via applySentryUrlContext (security)
  • Makes enrichDashboardError async with consistent async .catch() callbacks across all dashboard commands

Fixes CLI-1K0

Before

ResolutionError: Dashboard 4326879 in 'sentry-sdks' not found.

Try:
  sentry dashboard list sentry-sdks/

Or:
  - The dashboard may have been deleted
  - Check the dashboard ID or title with: sentry dashboard list

After

ResolutionError: Dashboard 4326879 in 'sentry-sdks' not found.

Try:
  sentry dashboard list sentry-sdks/

Or:
  - The dashboard may have been deleted
  - Check the dashboard ID or title with: sentry dashboard list
  - Available dashboards:
      100  Error Overview
      200  Performance Metrics
      300  My Custom Dashboard

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.

…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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-895/

Built to branch gh-pages at 2026-04-30 23:26 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Codecov Results 📊

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

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +63
Passed Tests 📈 +63
Failed Tests
Skipped Tests

All tests are passing successfully.

❌ Patch coverage is 78.92%. Project has 13225 uncovered lines.
✅ Project coverage is 76.04%. Comparing base (base) to head (head).

Files with missing lines (8)
File Patch % Lines
src/commands/dashboard/resolve.ts 84.75% ⚠️ 18 Missing
src/lib/sentry-url-parser.ts 79.49% ⚠️ 8 Missing
src/commands/dashboard/widget/add.ts 0.00% ⚠️ 2 Missing
src/commands/dashboard/widget/delete.ts 0.00% ⚠️ 2 Missing
src/commands/dashboard/widget/edit.ts 0.00% ⚠️ 2 Missing
src/commands/dashboard/create.ts 0.00% ⚠️ 1 Missing
src/commands/dashboard/list.ts 0.00% ⚠️ 1 Missing
src/commands/dashboard/view.ts 0.00% ⚠️ 1 Missing
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

Comment thread src/commands/dashboard/resolve.ts
BYK added 4 commits April 30, 2026 20:49
…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
@BYK BYK merged commit bd837c1 into main Apr 30, 2026
26 checks passed
@BYK BYK deleted the byk/fix-dashboard-404-cli-1k0 branch April 30, 2026 23:35
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