Repository navigation
fix: route all HTTP clients through --debug transport logger - #81
Merged
Merged
Conversation
domains-client, ApplicationClient, HostingClient, the `api call` explorer command, and `webhook events` all built and sent reqwest requests directly, bypassing cli-engine's transport debug logger. Split each send into an explicit build()/execute() so debug_log_reqwest_request/response can bridge into the --debug transport output, matching the behavior every other CLI command already gets for free. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes --debug transport consistently log HTTP traffic across the CLI by routing previously “raw” reqwest::Client call sites through cli-engine’s reqwest request/response logging hooks, including the progenitor-generated domains-client via ClientHooks.
Changes:
- Refactors multiple request send paths to
build()→debug_log_reqwest_request()→execute()→ read body/status/headers →debug_log_reqwest_response(). - Updates JSON/error parsing to operate on captured response bytes/text while preserving existing control flow.
- Adds a
domains-clientClientHooksimplementation plus a test asserting the bridge fires, and adds thecli-enginedependency todomains-client.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust/src/webhook/mod.rs | Logs webhook event-type HTTP request/response via reqwest build/execute path. |
| rust/src/hosting/nodejs/client.rs | Logs HostingClient requests/responses and preserves existing JSON/error handling. |
| rust/src/application/client.rs | Logs ApplicationClient GraphQL + artifact upload requests/responses via captured bytes. |
| rust/src/api_explorer/mod.rs | Logs api call explorer requests/responses and parses body from captured bytes. |
| rust/domains-client/src/lib.rs | Implements progenitor ClientHooks bridge to cli-engine transport logger and adds a test. |
| rust/domains-client/Cargo.toml | Adds cli-engine dependency for the transport logging bridge. |
| rust/Cargo.lock | Locks cli-engine as a dependency of domains-client. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback: the debug-transport bridge test set the process-wide default transport logger and only reset it after the assertions, so a panicking assertion would leak the test's RecordingLogger into later tests. Add an RAII guard that restores the noop logger on drop, plus a test-only mutex to serialize any future tests that touch the same global, mirroring cli-engine's own internal (crate-private) pattern. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Address Copilot review feedback on the debug-transport changes: - HostingClient::send_json/upload_source were logging text.as_bytes() — the re-encoded UTF-8 string after reqwest's charset decoding — instead of the actual bytes received over the wire. Capture resp.bytes() first and log/parse from those, matching the pattern already used elsewhere (ApplicationClient, domains-client, webhook, api_explorer). - On JSON-decode failure, ApplicationClient::query and HostingClient's helpers discarded the actual response body, leaving only the serde error message. Include the raw body text in the error so a malformed response (HTML error page, proxy interstitial, etc.) is debuggable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Address Copilot review feedback: resp.bytes().await.unwrap_or_default() silently treated a body-read I/O failure (e.g. connection reset, decompression error) as an empty body, hiding real transport failures. Propagate the error like build()/execute() already do in this function. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
jbrooks2-godaddy
approved these changes
Jul 7, 2026
axburgess-godaddy
approved these changes
Jul 7, 2026
This was referenced Aug 12, 2026
This was referenced Aug 19, 2026
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--debug transportonly worked for commands going through cli-engine's ownHttpClient. Every rawreqwest::Clientcall site in this crate (ApplicationClient,HostingClient, theapi callexplorer command,webhook events) and indomains-clientbuilt and sent requests directly, so nothing was logged for them.build()→debug_log_reqwest_request()→execute()→ capture status/headers before consuming the body →debug_log_reqwest_response(), then continue with the existing error/parsing logic unchanged.domains-clientis fixed via aClientHooksimpl (progenitor's sanctioned extension point) rather than touching generated code.Test plan
cargo check— cleancargo clippy -- -D warnings— cleancargo fmt --check— cleancargo test --workspace— 235 passed, 0 failed (including a newdomains-clienttest asserting the hooks fire on a mocked call)gddy domain purchase ... --debug transportnow emits HTTP request/response logs🤖 Generated with Claude Code