Skip to content

fix(application deploy): guarantee a terminal result/error NDJSON event (DEVX-544)#114

Merged
jpage-godaddy merged 2 commits into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-544-streaming-terminal
Jul 17, 2026
Merged

fix(application deploy): guarantee a terminal result/error NDJSON event (DEVX-544)#114
jpage-godaddy merged 2 commits into
godaddy:rust-portfrom
smukherjee-godaddy:DEVX-544-streaming-terminal

Conversation

@smukherjee-godaddy

Copy link
Copy Markdown
Contributor

Summary

  • gddy application deploy --follow streams NDJSON progress events, but on failure the error was rendered to a separate human-readable buffer that never reached the stream — a caller consuming the stream line-by-line just saw it stop, with no structured terminal signal. On success, the last line was an ordinary step event, not a distinguishable terminal marker.
  • Every failure point in the deploy handler (auth resolution, config read, application/release lookup, extension deploy, activation) now emits a terminal {"type":"error","ok":false,"error":{code,message},...} event before propagating the error, reusing cli_engine::build_error_envelope so the code/message match what a non-streaming command would render for the same error.
  • A successful run now ends with a terminal {"type":"result","ok":true,"result":{...},"next_actions":[...]} event.
  • Fixes a latent bug on the pre-existing "deploy completed" step event: a duplicate "name" JSON key silently dropped the literal "deploy" step name.

Test plan

  • cargo test — full suite passes (251/251)
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo fmt --check — clean
  • New unit tests cover the terminal event payload shapes (error fallback code, real error-code passthrough, success summary fields)
  • Reviewed for public-repo safety (no secrets/credentials/internal hostnames introduced)

…nt (DEVX-544)

`deploy --follow` streams progress events, but on failure the human-readable
error was rendered to a buffer that never reached the NDJSON stream, leaving
callers with no structured terminal signal. On success the last line was an
ordinary step event, not a distinguishable terminal marker.

Every failure point (auth, config read, application/release lookup, extension
deploy, activation) now emits a terminal {"type":"error",...} event before
propagating, reusing cli_engine::build_error_envelope for consistent
code/message. Success now ends with a {"type":"result",...} event. Also fixes
a latent bug where a duplicate "name" JSON key silently dropped the literal
step name.
@jpage-godaddy
jpage-godaddy requested a review from Copilot July 16, 2026 20:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ensures gddy application deploy --follow produces a clear, structured terminal NDJSON event on both success and failure, so stream consumers always receive a final machine-readable result/error signal.

Changes:

  • Added helpers to emit a terminal type:"error" NDJSON event (using cli_engine::build_error_envelope for consistent code/message) on all deploy failure paths.
  • Added a terminal type:"result" NDJSON event on successful deploy completion with a summary payload and next_actions.
  • Fixed the deploy “completed” step event to avoid duplicate JSON keys by renaming the application field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rust/src/application/commands/mod.rs
Attach the deployed application name to the terminal result action so agent callers can resolve its placeholder.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@jpage-godaddy
jpage-godaddy merged commit 1d0fb2d into godaddy:rust-port Jul 17, 2026
1 check 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.

3 participants