-
Notifications
You must be signed in to change notification settings - Fork 17
fix: exit non-zero when a command fails - #277
Hidden character warning
Conversation
Review Council started (round 1).
Baseline:
- Scope: 2 files changed (+77/−1)
- CI/checks: pending (0 contexts) at
5fb8b42
The council is reviewing this pull request; the verdict will follow as a separate comment when the round closes.
|
LGTM ✅ — A one-line fix that makes What This PR Does
How It Works
Findings
Finding Details🟢 F1: Windows config isolation via HOME is a no-op on Windowsrev-claude noted that the test isolates config with What's Good (🟢)
Baseline Check
Review Metadata
×ばつ0 ×ばつ0 ×ばつ1 · 💬 Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Council approve — 🔴0 🟡0 🟢1. Reviewed at 5fb8b42. Full report: #277 (comment)
cmd/main.go logged the error returned by rootCmd.Execute() and then fell off the end of main, so every failure — unknown command, bad flag, 401 from the API, missing workspace — exited 0. Shells (`set -e`, `&&`), CI and the agent sandbox's bash tool all read the exit status, so a failed `zeabur` call was indistinguishable from a successful one. Exit 1 after logging. Output is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5fb8b42 to
c9e038b
Compare
Review Council started (round 2).
Baseline:
- Scope: 1 files changed (+2/−1)
- CI/checks: pending (0 contexts) at
c9e038b
The council is reviewing this pull request; the verdict will follow as a separate comment when the round closes.
|
LGTM ✅ — The exit-code fix is correct and CI-green; the only change from round 1 is that the regression test was dropped, which both reviewers flag as non-blocking. Delta since 5fb8b42 (round 1)
Findings
Finding Details🟢 F2: Regression test for the exit-code behavior was droppedRound 1 shipped What's Good (🟢)
Baseline Check
Review Metadata
×ばつ0 ×ばつ0 ×ばつ2 · 💬 Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Council approve — 🔴0 🟡0 🟢2. Reviewed at c9e038b. Full report: #277 (comment)
Uh oh!
There was an error while loading. Please reload this page.
Summary
cmd/main.gologged the error fromrootCmd.Execute()and then returned normally, so every failure exited 0: unknown command, unknown flag, API 401, missing workspace. Shells (set -e,&&), CI and the agent sandbox's bash tool all key off the exit status, so failedzeaburcalls looked like successes. fix(npm): mirror the binary's exit status instead of throwing a Node stack trace #276 made the npm wrapper mirror the binary's status, which exposed this.os.Exit(1)after logging. Output format is unchanged (sameERRORline on stderr,--jsonunaffected). Commands that already set their own status (service exec,server execforward the remote exit code) are untouched.Test plan
make test,make buildpassZEABUR_TOKEN=zat_bogus, clean HOME:bogus-command→ 1,version --no-such-flag→ 1,profile info(401) → 1,project list --workspace does-not-exist→ 1,project list(401) → 1,version→ 0npx zeabur@latest bogus-command; echo $?prints 1Noticed, not fixed here
-i=false,zeabur profile infoblocks waiting for the browser login callback instead of failing fast. Non-interactive mode should error out; separate issue.Generated with Claude Code