Yicong-Huang opened a new pull request, #6027:
URL: https://github.com/apache/texera/pull/6027
### What changes were proposed in this PR?
Two small, agent/script-friendly additions to `bin/local-dev.sh` — no change
to the human TTY experience.
**1. `--json` machine-readable status.** `status --json` prints one JSON
object on stdout (no colours, no table) and exits `0` iff every service is
running, else `1`:
```json
{"branch":"...","sha":"...","running":14,"total":14,"services":[
{"service":"texera-web","port":8080,"type":"jvm","pid":25823,"state":"running"},
...]}
```
`up` and `down` also accept `--json`: human progress is routed to **stderr**
(unbuffered) and the final status JSON goes to **stdout** (via a saved fd), so
a caller can `up --json >state.json 2>progress.log` and parse stdout directly.
**2. Non-TTY build heartbeat.** In non-TTY mode the spinner can't render in
place, so a long silent step (`sbt dist`, output redirected to a log) used to
print one line then go quiet for 25s+ — indistinguishable from "stuck" to a
non-interactive caller. `tui_spinner` now emits `… still running (Ns)` every
`TUI_HEARTBEAT_SECS` (default 15), polling at 1s so it still returns within ~1s
of the job finishing (no trailing latency).
### Any related issues, documentation, discussions?
Closes #6026. Usage banner (`--help`) updated to document `--json` on
`status`/`up`/`down`.
### How was this PR tested?
- `bash bin/local-dev/tests/test_local_dev_sh.sh` → **19 passed, 0 failed**
(added 6: JSON shape/consistency, health-based exit code, unknown-flag negative
case, `--help` coverage, heartbeat regression guard, up/down `--json` wiring).
- `python -m pytest bin/local-dev/tests/` → **38 passed** (no regression).
- Dogfooded end to end: `down --json` → stdout pure JSON (`running:0`, 14
`stopped`), exit 0; `up --json` → single-line JSON `running:14/14` on stdout,
and stderr showed the new heartbeat across a ~60s build (`… still running
(15s/30s/45s/60s)`), 14/14 healthy.
- Verified stdout/stderr separation: `up --json >state.json 2>progress.log`
yields parseable JSON in `state.json`.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]