Skip to content

GH#265: Preserve Guzzle HTTP error responses - #266

Open
superdav42 wants to merge 1 commit into
trunkfrom
bugfix/gh265-work-issue-265-preserve-typed-http-error
Open

GH#265: Preserve Guzzle HTTP error responses#266
superdav42 wants to merge 1 commit into
trunkfrom
bugfix/gh265-work-issue-265-preserve-typed-http-error

Conversation

@superdav42

Copy link
Copy Markdown

Summary

  • preserve PSR-18-style response semantics when request options select the Guzzle-compatible send() path
  • disable Guzzle status-code exceptions while retaining timeout and redirect option translation
  • cover 529 and representative 4xx responses through the SDK's typed response handling

Resolves #265

Testing

  • vendor/bin/phpunit tests/unit/Providers/Http/HttpTransporterTest.php — 12 tests, 56 assertions
  • vendor/bin/phpunit tests/unit/Providers/Http/Util/ResponseUtilTest.php — 9 tests, 18 assertions
  • composer test:unit — 1,166 tests, 4,271 assertions
  • composer lint — PHPCS 207 files; PHPStan 111 files, no errors
  • composer validate --strict
  • composer check-platform-reqs

Runtime Testing

Self-assessed against the repository's Guzzle-shaped test client: the focused tests execute the options path and verify both 529-to-ServerException and 400-to-ClientException translation. The repository does not install guzzlehttp/guzzle; live provider integration tests were not run because they make billable API calls and do not exercise this option bridge.

Decisions

The new option is scoped to buildGuzzleOptions(), so ordinary PSR-18 clients and ClientWithOptionsInterface implementations remain unchanged. No retries or dependency changes are introduced.


aidevops.sh v3.32.191 plugin for OpenCode v1.18.5 with gpt-5.6-sol spent 33m and 118,309 tokens on this with the user in an interactive session. Overall, 4h 36m since this issue was created.

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: superdav42 <superdav42@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@superdav42 superdav42 added origin:interactive Created by interactive user session status:in-review PR open, awaiting review/merge labels Jul 28, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.52%. Comparing base (a31b0ec) to head (bd6189d).

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #266      +/-   ##
============================================
+ Coverage     86.49%   86.52%   +0.02%     
  Complexity     1327     1327              
============================================
  Files            68       68              
  Lines          4295     4297       +2     
============================================
+ Hits           3715     3718       +3     
+ Misses          580      579       -1     
Flag Coverage Δ
unit 86.52% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

origin:interactive Created by interactive user session status:in-review PR open, awaiting review/merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guzzle request options cause HTTP error responses to bypass ResponseUtil

1 participant