Skip to content

fix(init): gate unsupported --features and tag dry-run runs - #1535

Merged
betegon merged 2 commits into
mainfrom
fix/init-gate-features-tag-dryrun
Sep 4, 2026
Merged

fix(init): gate unsupported --features and tag dry-run runs#1535
betegon merged 2 commits into
mainfrom
fix/init-gate-features-tag-dryrun

Conversation

@betegon

@betegon betegon commented Sep 4, 2026

Copy link
Copy Markdown
Member

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

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 4, 2026 4:57pm UTC

Request Review

@betegon

betegon commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Companion server PR (the server-side half of the wizard.dry_run tag, covering CLI-SERVER-22): getsentry/cli-init-api#267

@betegon

betegon commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

The red Lint & Typecheck here is a pre-existing, repo-wide Biome bug — output.ts exceeds Biome's 200k type-inference limit via valibot's GenericSchema, not this PR's code. It fails #1499 and #1501 identically, and a re-run reproduced it deterministically. Fixed in #1536 (force-ignores output.ts, mirroring the existing custom-ca.ts exclusion). Once #1536 lands I'll rebase this branch onto main and CI will go green.

betegon added a commit that referenced this pull request Sep 4, 2026
…t) (#1536)

## Problem

`Lint & Typecheck` fails on an internal Biome error, with no real lint
violation in the changed code:

```
src/lib/formatters/output.ts  project  INTERNAL
  ! Biome encountered an unusually large amount of types which exceeded the limit of 200,000.
```

`output.ts` imports valibot's `GenericSchema`, whose recursive generic
graph pushes Biome's project-mode type inference over its 200,000-type
ceiling — the **same internal Biome bug already handled for
`custom-ca.ts`** in this config (see the existing
`"!!src/lib/custom-ca.ts"` force-ignore).

It surfaces **non-deterministically**: `main` passes by a hair, but the
exact type count tips over on PR runners, so unrelated PRs fail this job
identically — e.g. #1499, #1501, and #1535. Re-running does not clear it
(deterministic per branch state).

## Fix

Force-ignore `src/lib/formatters/output.ts` the same way as
`custom-ca.ts`, until Biome raises/fixes the limit.

```jsonc
"!!src/lib/custom-ca.ts",
"!!src/lib/formatters/output.ts"
```

## Verification

`pnpm run lint` (the CI invocation) now passes:

```
Checked 1025 files in 3s. No fixes applied.   (exit 0)
```

Unblocks #1535 (and the other PRs above) once merged. Trade-off is the
same one already accepted for `custom-ca.ts`: `output.ts` (a leaf
formatter) is skipped by Biome; it stays covered by `tsc`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
betegon and others added 2 commits September 4, 2026 18:56
…ents)

These non-selector products are never offered by the interactive selector, 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) until their setup is automated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Dry runs apply and install nothing, so the CLI verify-setup runtime check runs the app 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, inherited by every CLI event including that capture). wizard.dry_run:false isolates real runs. Companion server change tags the same value server-side (CLI-SERVER-22).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@betegon
betegon force-pushed the fix/init-gate-features-tag-dryrun branch from facfcf5 to 0b57230 Compare September 4, 2026 16:56
@betegon
betegon merged commit 2d2fbff into main Sep 4, 2026
34 checks passed
@betegon
betegon deleted the fix/init-gate-features-tag-dryrun branch September 4, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant