Repository navigation
Commit 2d2fbff
fix(init): gate unsupported --features and tag dry-run runs (#1535)
Two small `init` hardening fixes surfaced by a wizard-run triage.
## 1. Gate unsupported `--features` (source maps, metrics, attachments)
`sourcemaps`, `metrics`, and `attachments` are non-selector products —
the interactive selector never offers them, but `--features` still
accepted them, leaving a half-configured integration (e.g. source-map
upload needs an auth token this wizard does not provision). Removed from
`FEATURE_ALIASES`, `SUPPORTED_FEATURE_NAMES`, and the flag help, so they
now fail loudly (`Unknown init feature "sourcemaps"`) until their setup
flow is automated.
## 2. Tag `wizard.dry_run` in telemetry
Dry runs (`--dry-run`) apply and install nothing, so the CLI's
post-apply `verify-setup` runtime check runs the app's dev command
against an **unmodified** project and reports **`init verification
failed`** (CLI-2HP) — a false positive. Set `wizard.dry_run` once at
`runWizard` start (global scope, so every CLI event inherits it,
including that capture). `wizard.dry_run:false` then isolates real runs
from dry-run noise.
Companion server change tags the same `wizard.dry_run` for the
server-side `Verification found issues` (CLI-SERVER-22) — see below.
## Verification
- `tsc --noEmit`: no new errors in the changed files.
- `test/commands/init.test.ts`: 50/50 — updated the two normalization
tests + the "Supported features:" message, and added a `test.each`
locking in the rejection of the three gated features.
- `interactive.test.ts` + `clack-utils.test.ts`: 45/45 — the interactive
selector's filtering and the display labels are separate code paths,
unaffected by the flag change.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 02f6e8d commit 2d2fbff
4 files changed
Lines changed: 35 additions & 18 deletions
File tree
- packages/cli
- plugins/sentry-cli/skills/sentry-cli/references
- src
- commands
- lib/init
- test/commands
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
53 | | - | |
54 | 59 | | |
55 | | - | |
56 | | - | |
57 | 60 | | |
58 | | - | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
72 | 73 | | |
73 | | - | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
339 | 338 | | |
340 | 339 | | |
341 | 340 | | |
342 | | - | |
| 341 | + | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
986 | 986 | | |
987 | 987 | | |
988 | 988 | | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
989 | 996 | | |
990 | 997 | | |
991 | 998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 186 | + | |
189 | 187 | | |
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
193 | 191 | | |
194 | | - | |
195 | | - | |
196 | 192 | | |
197 | 193 | | |
198 | 194 | | |
| |||
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
206 | | - | |
| 202 | + | |
207 | 203 | | |
208 | 204 | | |
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
213 | | - | |
214 | | - | |
215 | 209 | | |
216 | 210 | | |
217 | 211 | | |
| |||
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
228 | | - | |
| 222 | + | |
229 | 223 | | |
230 | 224 | | |
231 | 225 | | |
| |||
248 | 242 | | |
249 | 243 | | |
250 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
251 | 262 | | |
252 | 263 | | |
253 | 264 | | |
| |||
0 commit comments