Skip to content

feat(deps): upgrade resty v2 → v3 (resty.dev/v3 v3.0.0-rc.2)#28

Open
hugoh wants to merge 7 commits into
mainfrom
resty-v3
Open

feat(deps): upgrade resty v2 → v3 (resty.dev/v3 v3.0.0-rc.2)#28
hugoh wants to merge 7 commits into
mainfrom
resty-v3

Conversation

@hugoh

@hugoh hugoh commented Jun 21, 2026

Copy link
Copy Markdown
Owner
  • Update import path to resty.dev/v3
  • Rename resp.IsError() → IsStatusFailure(), IsSuccess() → IsStatusSuccess()
  • Replace removed resp.Body() with resp.Bytes()
  • Add Close() error to Gateway interface and GatewayCommon
  • Add SetRetryAllowNonIdempotent(true) to preserve POST retry behaviour
  • Move Nokia SID cookie from client-level to per-request injection,
    since v3 has no ClearCookies() API; update tests accordingly
  • Update BaseURL field access to BaseURL() method call

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

@codecov-commenter

codecov-commenter commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.08%. Comparing base (3ad8306) to head (8a8956a).

Files with missing lines Patch % Lines
gateway.go 91.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #28      +/-   ##
==========================================
+ Coverage   95.25%   97.08%   +1.82%     
==========================================
  Files           6        6              
  Lines         274      274              
==========================================
+ Hits          261      266       +5     
+ Misses          8        4       -4     
+ Partials        5        4       -1     

☔ 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.

@deepsource-io

deepsource-io Bot commented Jun 21, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 3ad8306...8a8956a on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Go Jul 1, 2026 11:40a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

hugoh and others added 6 commits June 30, 2026 22:50
- Update import path to resty.dev/v3
- Rename resp.IsError() → IsStatusFailure(), IsSuccess() → IsStatusSuccess()
- Replace removed resp.Body() with resp.Bytes()
- Add Close() error to Gateway interface and GatewayCommon
- Add SetRetryAllowNonIdempotent(true) to preserve POST retry behaviour
- Move Nokia SID cookie from client-level to per-request injection,
  since v3 has no ClearCookies() API; update tests accordingly
- Update BaseURL field access to BaseURL() method call

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reboot() called Login() before checking config.DryRun, so dry-run mode
still performed a real authentication round-trip against the gateway
in both ArcadyanGateway and NokiaGateway.
Status() wrapped a failed registration-status GET in ErrSignalFailed,
copy-pasted from Signal(). A caller checking errors.Is(err,
ErrSignalFailed) to detect a real Signal() failure got a false
positive from Status().
NewGatewayCommon dereferenced cfg.Host with no nil check, so
NewArcadyanGateway(nil)/NewNokiaGateway(nil) crashed with an opaque
nil-pointer dereference instead of a clear, attributable error.
ArcadyanGateway.Reboot() and NokiaGateway.Reboot() duplicated the
entire login/dry-run/POST/401-403-logout/success-logout control flow
verbatim, letting bugs (like the DryRun-after-Login issue) drift
between the two copies. Extract a shared performReboot() on
GatewayCommon, driven by a small authSession interface that both
vendors' existing logout() methods already satisfy, and have each
vendor supply only its login call and reboot request.

Unifies the previously divergent "reboot request failed" vs. "error
sending reboot request" error text between vendors.
….go builders

nokiaConfig(), nokiaTestGw(), and nokiaTestGwClosed() reimplemented
testConfig()/testCommon() and the closed-server GatewayCommon builder
already used by Arcadyan's tests. Extract newClosedServerCommon() in
gateway_test.go and have both arcadyan_test.go and nokia_test.go call
it, and have nokiaTestGw() reuse testCommon() instead of manually
constructing a resty client.
Add cases for GatewayCommon.Close(), Arcadyan Status()'s network-error
branch, and Request()'s invalid-JSON branch (all previously
uncovered). Rename Test_LoginSuccess/Test_LoginFailure to
TestNokiaLoginResp_HasCredentials as a table-driven test, since they
exercised nokiaLoginResp.hasCredentials(), not a login flow.
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

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.

2 participants