Repository navigation
Conversation
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryConverts Requests body-read failures in
Reviews (1) · Last reviewed commit: "fix(cloud): handle interrupted download ..." · Reviewed by Greptile |
This branch has not been deployed
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.
Fixes #1620.
Cloud downloads stream their responses. If a server returns an HTTP error and its JSON or text body is truncated, reading that body currently lets
requests.exceptions.ChunkedEncodingErrorescape from the CLI. For example,scans report --output report.pdf --jsonproduces a traceback instead of a JSON error on an interrupted 503 response.Convert Requests body-read failures in
http.checkto the existingCloudTransportError. The runner can then return exit 1 through its normal output handling: JSON for file downloads and stderr for redirected binary output. The response still closes and existing files remain untouched.Regression tests run through the real CLI and Requests/urllib3 body readers with an incomplete response, mocking only the HTTP request. All four cases fail on unchanged
mainand pass with this fix: JSON/text error bodies, each sent to a file or raw stdout.Validation on Python 3.12.14 with frozen dependencies and an isolated HOME:
make check-all: Ruff formatting/lint and full Mypy pass; Pyright stops the target with 941 pre-existing errors. The unchanged base and this branch have identical diagnostic sets (zero additions/removals);http.pyhas no diagnostics.git diff --check: passed.No live managed service, LLM, payment, or scan was used. Network behavior is covered by local synthetic responses; remote CI remains to be run.