Skip to content

fix(dev): clear outcome for setup.sh on non-interactive input - #511

Merged
islandbitcoin merged 2 commits into
mainfrom
fix/setup-noninteractive-ibex
Sep 23, 2026
Merged

islandbitcoin merged 2 commits into
mainfrom
fix/setup-noninteractive-ibex

Conversation

@islandbitcoin

@islandbitcoin islandbitcoin commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

dev/setup.sh runs under set -euo pipefail. When stdin is closed or not a TTY, read at the Ibex prompt hits EOF, returns non-zero, and the script exits 1 with no message (Tester docs sweep, 2026-09-14).

Change

  • EOF on either Ibex read (client ID or secret) now fails with an actionable message: re-run interactively, create .env.local, or pass --skip-ibex. No partial .env.local gets written.
  • New --skip-ibex flag: skips the prompt with the existing warning, so non-interactive runs have a documented safe path.
  • Interactive behavior unchanged: Enter still skips, entering credentials still writes .env.local and the overrides, and the secret still isn't echoed.
  • DEV.md Quick Start covers non-interactive runs.

Validation (commit 343f19f)

Ran in a temp copy of the repo with stubbed docker/yarn and temp HOME/CONFIG_PATH. No shared Docker or real services were touched.

Case Before (origin/main; only the closed-stdin row was run, other rows read from the code) After
closed stdin (</dev/null) exit 1, no message exit 1, prints the options
piped client ID, EOF before secret exit 1, no message exit 1, prints the options, no .env.local
--skip-ibex with closed stdin n/a exit 0, skip warning
piped Enter exit 0 exit 0, skip warning
piped client ID and secret exit 0 exit 0, .env.local and overrides written
existing .env.local with closed stdin exit 0 exit 0
real TTY (expect), Enter exit 0 exit 0, skip warning
real TTY (expect), client ID and secret exit 0 exit 0, files written, secret not echoed

bash -n dev/setup.sh is clean. There are no TypeScript or GraphQL changes, so tsc, eslint, and sdl checks don't apply.

🤖 Generated with Claude Code

Under set -e, read returning non-zero on closed or non-TTY stdin made
dev/setup.sh exit 1 with no message. Fail with actionable options
instead, and add --skip-ibex for documented non-interactive runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
islandbitcoin pushed a commit that referenced this pull request Sep 15, 2026
…tion

Issue b74079d1. Backend defect 8c8eb0c6 (report c8385a3d): on a stack
set up without Ibex credentials, new-phone registration can fail after
identity/account persistence and leave an account with no wallets;
reproduced at 7bde387 on a warm stack, which rules out the startup
race. A retried login returning a token is not evidence of usable
onboarding.

DEV.md Quick Start now carries that limitation next to the skip option
(Enter at the prompt on main; --skip-ibex from PR #511 when merged),
links the defect, and says the test login is subject to it. No claim
that valid sandbox credentials make registration succeed. Text only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…setup.sh

- read returns non-zero on EOF even when it populated the variable (final
  line with no trailing newline). `printf 'id\nsecret' | ./dev/setup.sh`
  previously failed with the no-input hint despite having the secret. Treat a
  populated variable as success on both prompts.
- Commit the validation harness as test/bats/dev-setup.bats: runs the real
  script with stubbed node/yarn/docker and temp HOME/CONFIG_PATH/cwd. Covers
  closed stdin, --skip-ibex, piped id+secret (with and without trailing
  newline), Enter-to-skip, and pre-existing .env.local. Picked up by the
  existing `make bats` / bats.yml workflow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@islandbitcoin
islandbitcoin merged commit 925294c into main Sep 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants