Fix: Suppress spinner output when using --json flag in wp-env#75743
Fix: Suppress spinner output when using --json flag in wp-env#75743youknowriad merged 1 commit intotrunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 6.84 MB ℹ️ View Unchanged
|
b25c191 to
08ab298
Compare
|
Flaky tests detected in 08ab298. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22216484801
|
The spinner animation and success message were leaking into JSON output from the status command and any future commands using the --json flag. This made the output unparseable by tools like jq. Updated the withSpinner wrapper to conditionally start/stop the spinner and skip the success message when --json is set, ensuring clean JSON output. Fixes #75020 (comment) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
08ab298 to
3851115
Compare
What?
Follow up to #75020 to fix JSON output pollution.
Why?
The
status --jsoncommand and any future commands with--jsonsupport were outputting spinner animation and success messages to stdout, making the JSON output unparseable by tools likejq.How?
Modified the
withSpinnerwrapper incli.jsto:--jsonis not set--jsonis setThis ensures clean, parseable JSON output when the flag is used.
Testing Instructions
npx wp-env status --json | jq .— should parse cleanly without errorsnpx wp-env status(without flag) — should still show spinner and timing message as beforenpx wp-env status --json --debug— should output clean JSON (no debug logs mixed in)