Skip to content

fix(cli): surface physical deploy diagnostics#1068

Merged
zackees merged 1 commit into
mainfrom
fix/rp2040-deploy-failure-output
Jul 15, 2026
Merged

fix(cli): surface physical deploy diagnostics#1068
zackees merged 1 commit into
mainfrom
fix/rp2040-deploy-failure-output

Conversation

@zackees

@zackees zackees commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • replay daemon stdout/stderr for physical deploys, not only emulator routes
  • send final deploy diagnostics directly to stderr so default filtering and --quiet cannot hide actionable failures
  • flush stdio before non-zero process exit
  • add a real CLI/mock-daemon regression test for piped stdout and stderr

Hardware context

A zero-button RP2040 deploy against the attached RPI-RP2 device exited 1 after the Windows UF2 transport failed, but the CLI hid the daemon's actionable error. This change makes the next attached-board run diagnostic without changing deployment strategy or embedding USB IDs.

Validation

  • soldr cargo test -p fbuild-cli --test test_emu_exit_code
  • soldr cargo test -p fbuild-cli
  • soldr cargo fmt --all -- --check
  • soldr cargo clippy -p fbuild-cli --all-targets -- -D warnings
  • independent Rust review: one stdout flush finding, resolved and regression-tested

Supports #1049 and #1040.

Summary by CodeRabbit

  • Bug Fixes
    • Deploy operations now consistently display their output and diagnostics across all deployment routes.
    • Final success and failure messages remain visible during piped, automated, quiet, and non-zero exit scenarios.
    • Improved error visibility helps preserve actionable transfer details when deployments fail.

@zackees
zackees merged commit 5e047a9 into main Jul 15, 2026
21 of 28 checks passed
@zackees
zackees deleted the fix/rp2040-deploy-failure-output branch July 15, 2026 06:16
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9274997c-5fa6-4751-a909-5ab517d114e8

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea127e and 4730715.

📒 Files selected for processing (3)
  • crates/fbuild-cli/src/cli/deploy.rs
  • crates/fbuild-cli/src/output.rs
  • crates/fbuild-cli/tests/test_emu_exit_code.rs

📝 Walkthrough

Walkthrough

The deploy CLI now prints operation streams for all routes, routes final daemon stderr through a direct diagnostic sink, flushes both streams before non-zero exit, and adds an integration test for failed deploy output preservation.

Changes

Deploy output preservation

Layer / File(s) Summary
Diagnostic output routing
crates/fbuild-cli/src/output.rs, crates/fbuild-cli/src/cli/deploy.rs
Adds the direct diagnostic stderr helper and uses it for final daemon operation errors.
Deploy failure output handling
crates/fbuild-cli/src/cli/deploy.rs, crates/fbuild-cli/tests/test_emu_exit_code.rs
Prints streams for every deploy route, flushes output before failure exit, and verifies stdout, stderr, and non-zero status with a mock deploy failure.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant fbuild
  participant MockDaemon
  participant stdout
  participant stderr
  fbuild->>MockDaemon: POST /api/deploy
  MockDaemon-->>fbuild: Failed response with stdout and stderr
  fbuild->>stdout: Print operation stdout
  fbuild->>stderr: Print diagnostic stderr
  fbuild->>stdout: Flush stdout
  fbuild->>stderr: Flush stderr
  fbuild-->>MockDaemon: Exit non-zero
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rp2040-deploy-failure-output

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant