feat: adopt contree-client~=0.4.0 - #20
Merged
Merged
Conversation
contree-client 0.4 renamed ContreeAPIError to APIStatusError, dropped CliClient.retryable_errors/nonretryable_errors (transport failures now normalize to APIConnectionError), changed error_for_response()'s signature, removed SSEStreamError (mid-stream errors now surface as a plain ConnectionError carrying last_event_id), and made parse_whoami() raise plain ValueError/TypeError instead of the status-error hierarchy for bad status / malformed payloads. Adjust the CLI and test double accordingly; auth.py's error messages for whoami failures are reclassified to match what each exception now actually means.
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
contree-clientto~=0.4.0(was>=0.2.1); updateuv.lockaccordingly.ContreeAPIErrorwas renamed toAPIStatusErrorupstream -- renamed every import/catch site across the CLI (auth.py,cd.py,images.py,operation.py,run.py,docker/kw_from.py,shell/repl.py) and tests.CliClient.retryable_errors/nonretryable_errorswere removed upstream (transport failures now normalize uniformly toAPIConnectionError); simplifiedrun.py'sSIGNAL_ERRORSto(ContreeError, OSError)instead of reaching into backend-specific tuples.error_for_response()'s signature changed from(response)to(status, headers, body)-- fixed the two raw-RequestSpeccall sites inls.pyandsession.py.SSEStreamErrorwas removed upstream; a mid-stream SSE error now surfaces as a plainConnectionErrorcarrying a dynamiclast_event_idattribute. Updated the one test that constructed the old exception type to match.parse_whoami()no longer raises the status-error hierarchy for a bad HTTP status or a non-dict payload -- both now raise plainValueError/TypeError. Reclassifiedauth.py's except clauses so a bad token still logs "Token verification failed" and a malformed body logs "Could not parse ... response" (more accurate than before, since a non-dict payload is genuinely a parsing problem, not a credential one -- one test assertion updated to match).follow_operation_events()'s reconnect loop no longer honors a server'sRetry-After; it always backs off with a fixed internal delay. This lives entirely inside the library now, so the CLI test that asserted an exact sleep duration was retargeted to verify only that reconnection still happens.ContreeTestClient.request()(test double inconftest.py) now falls back to the base class'smocked_response()instead of raisingNotMockedError, sincefollow_operation_eventsissues a raw status-probe request internally that needs to route through the existingget_operation_statusmock.