Skip to content

Update to use Faraday ~> 1.0#10

Open
sshao wants to merge 6 commits into
yourkarma:masterfrom
sshao:faraday_1_0_upgrade
Open

Update to use Faraday ~> 1.0#10
sshao wants to merge 6 commits into
yourkarma:masterfrom
sshao:faraday_1_0_upgrade

Conversation

@sshao

@sshao sshao commented May 14, 2020

Copy link
Copy Markdown

Faraday 1.0 Upgrading docs

Major changes are to the SelectiveErrors and Repeater middlewares.

Update SelectiveErrors Middleware for Faraday 1.0

Faraday 1.0 removed subclasses under Faraday::Error. It also introduces new Error classes for a selection of HTTP status codes.

SelectiveErrors has been updated to match the upstream raise_error middleware.

Update Repeater Middleware for Faraday 1.0

Repeater has been updated to catch all Faraday::Errors in lieu of the deprecated Faraday::Error::ClientError.

Faraday::Error was chosen over Faraday::ClientError/Faraday::ServerError as Repeater appears to be intended to retry on all Faraday errors in general, if Faraday is configured to do so (via middlewares raise_error or selective_errors).

Note: the Retry middleware that ships with Faraday seems to accomplish the same goals as Repeater, with approximately the same options for customization. README updated to note this.

@sshao
sshao force-pushed the faraday_1_0_upgrade branch from 26ad394 to d68e633 Compare May 14, 2020 19:37
sshao and others added 4 commits May 21, 2020 13:24
Reached out to Iain, who's transferred ownership of this gem to us and
has granted the appropriate permissions required on rubygems to manage
the gem releases there.
Faraday ships with
https://github.com/lostisland/faraday/blob/master/docs/middleware/request/retry.md
which appears to accomplish the same goals as Repeater, with equivalent
options for customization.
Was already deprecated, deleting the related code.
@sshao
sshao force-pushed the faraday_1_0_upgrade branch from d68e633 to f99134b Compare May 21, 2020 20:55
Delete Mimetype, Repeater middlewares
@sshao
sshao force-pushed the faraday_1_0_upgrade branch from f99134b to bf07f70 Compare May 22, 2020 17:01
https://github.com/lostisland/faraday/blob/019e1a841707718adad2fd05c602eb1a869b42bc/UPGRADING.md#faraday-10

Major changes are to the SelectiveErrors and Repeater middlewares.

---

Update SelectiveErrors Middleware for Faraday 1.0

Faraday 1.0 removed subclasses under `Faraday::Error`. It also
introduces new Error classes for a selection of HTTP status codes.

SelectiveErrors has been updating to match the upstream raise_error
middleware.
https://github.com/lostisland/faraday/blob/019e1a841707718adad2fd05c602eb1a869b42bc/lib/faraday/response/raise_error.rb

---

Also deletes the appraisals for faraday 0.8 and 0.9. Given the major
Faraday 1.0 changes, faraday-conductivity by design will not work with
both faraday 1.0 and faraday <1.0.
@sshao
sshao force-pushed the faraday_1_0_upgrade branch from bf07f70 to 500ac34 Compare May 22, 2020 17:33
@bvicenzo

Copy link
Copy Markdown

@iain @sshao Hello guys, any intention to go ahead with this upgrade?

@iain

iain commented Jul 28, 2020

Copy link
Copy Markdown
Contributor

@bvicenzo it has already gone out, but under a different repo: https://github.com/enova/faraday-conductivity

I no longer have access to this github organization

@bvicenzo

Copy link
Copy Markdown

Very thanks, @iain!

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.

4 participants