fix(init): classify expected workflow bails - #1406
Draft
betegon wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
betegon
added a commit
that referenced
this pull request
Aug 21, 2026
## Summary Make `sentry init` accept a terminal workflow result as successful only when it explicitly reports `status: "success"` and `result.exitCode: 0`. Previously, a successful response with no `result` or no `exitCode` passed the truthiness check and could print the success handoff with process exit 0. The CLI now treats that as malformed, surfaces a specific `WizardError`, and exits nonzero. Existing nonzero workflow-to-CLI exit mappings are unchanged. This makes the process exit status a reliable black-box signal for the init smoke harness. ## Compatibility This intentionally stops accepting terminal success payloads that omit `exitCode`. The current wizard success output already returns `exitCode: 0`. The draft [#1406](#1406) also touches `handleFinalResult`; merge order will require rebasing whichever PR lands second. ## Test plan - focused wizard runner tests: 74 passed - CLI typecheck - Biome on the three changed files - `git diff --check` - native `darwin-arm64` binary build - real Express init against the local candidate API: exit 0 - invalid OpenRouter credential: CLI exit 61 and smoke harness exit 1 ## Rollout The paired API-owned smoke is [getsentry/cli-init-api#249](getsentry/cli-init-api#249). Once this lands, bump its pinned CLI SHA so malformed successful workflow responses cannot produce a false-green smoke result.
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
Use explicit workflow bail metadata to distinguish deliberate, expected exits from command failures in CLI telemetry.
A result with bailCategory expected now records wizard.outcome as bailed and adds category, reason, step, and workflow exit-code tags. Unexpected and unclassified exits remain errored, so older init servers and ordinary workflow failures keep their existing behavior.
The command still returns the same semantic non-zero exit code and renders the same user-facing explanation. This only corrects observability classification.
Depends on getsentry/cli-init-api#210 for the server-provided metadata; the change is backward compatible while that PR rolls out.
Test plan
Notes
Biome emits the existing internal type-analysis warning for src/lib/formatters/output.ts but completes the touched-file check successfully.