Commit 131003b
authored
fix(dashboard): resolve dashboard by ID/slug in addition to title (#559)
Fixes CLI-MK
`resolveDashboardId()` only matched non-numeric references against
dashboard
titles. Sentry's built-in dashboard has `id: "default-overview"` but
`title: "General"`, so `sentry dashboard view default-overview` threw a
`ValidationError` despite listing the dashboard as available in the
error.
### Changes
- **ID-first matching**: `resolveDashboardId()` now tries `d.id` before
falling back to `d.title` (both case-insensitive). ID match takes
priority
when a value collides with a different dashboard's title.
- **Clearer error message**: Says "matching" instead of "with title" and
labels the available list columns as `(ID Title)`.
- **Tests**: 5 new cases covering slug match, case-insensitivity, ID vs
title
priority, title fallback, and improved error wording.1 parent ce3cc32 commit 131003b
File tree
2 files changed
+47
-4
lines changed- src/commands/dashboard
- test/commands/dashboard
2 files changed
+47
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
140 | | - | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
96 | 134 | | |
97 | 135 | | |
98 | 136 | | |
| |||
105 | 143 | | |
106 | 144 | | |
107 | 145 | | |
| 146 | + | |
| 147 | + | |
108 | 148 | | |
109 | 149 | | |
110 | 150 | | |
| |||
0 commit comments