Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlock faraday_middleware version #316

Merged
merged 2 commits into from
Jun 5, 2024
Merged

Conversation

composerinteralia
Copy link
Member

This is a followup to #309

We can't upgrade faraday to 1.x without also upgrading faraday_middleware to 1.x, so the previous PR didn't get us all the way there.

Not much changes in faraday_middleware 1.x except for faraday 1.x support, so I expect elastomer-client to be fully compatible.

(We'll revisit this once more for faraday 2.0, which drops the faraday_middleware gem entirely, but that's a problem for another day.)

This is a followup to #309

We can't upgrade faraday to 1.x without also upgrading
faraday_middleware to 1.x, so the previous PR didn't get us all the way
there.

Not much changes in faraday_middleware 1.x except for faraday 1.x
support, so I expect elastomer-client to be fully compatible.

(We'll revisit this once more for faraday 2.0, which drops the
faraday_middleware gem entirely, but that's a problem for another day.)
@composerinteralia composerinteralia marked this pull request as draft June 5, 2024 14:30
@composerinteralia
Copy link
Member Author

composerinteralia commented Jun 5, 2024

Looks like loosening the constraints caused the tests to run on newer versions of things 👍🏻 and there's a failure 👎🏻 , so I'll need to dig into that first.

@composerinteralia
Copy link
Member Author

composerinteralia commented Jun 5, 2024

Ah, OK, I think this is an "expected" failure. The adapter is now stored separately (it's been that way for some time, but we're newly using the newer mechanism after upgrading.

Before:

#<Faraday::RackBuilder:0x00000001237fabb0 @handlers=[ElastomerClient::Middleware::ParseJson, FaradayMiddleware::Gzip, ElastomerClient::Middleware::EncodeJson, ElastomerClient::Middleware::LimitSize, Faraday::Adapter::Test]>

After:

#<Faraday::RackBuilder:0x00000001226b8e38 @adapter=Faraday::Adapter::Test, @handlers=[ElastomerClient::Middleware::ParseJson, FaradayMiddleware::Gzip, ElastomerClient::Middleware::EncodeJson, ElastomerClient::Middleware::LimitSize]>

So I'll update these tests to check that we're using the right adapter instead of checking that the adapter is in the list of handlers.

The adapter is now stored separately (it's been that way for some time,
but we're newly using the new mechanism after upgrading).

Before:

```
<Faraday::RackBuilder:0x00000001237fabb0 @handlers=[ElastomerClient::Middleware::ParseJson, FaradayMiddleware::Gzip, ElastomerClient::Middleware::EncodeJson, ElastomerClient::Middleware::LimitSize, Faraday::Adapter::Test]>
```

After:

```
<Faraday::RackBuilder:0x00000001226b8e38 @adapter=Faraday::Adapter::Test, @handlers=[ElastomerClient::Middleware::ParseJson, FaradayMiddleware::Gzip, ElastomerClient::Middleware::EncodeJson, ElastomerClient::Middleware::LimitSize]>
```

So this commit updates these tests to check that we're using the right
adapter instead of checking that the adapter is in the list of handlers.
@composerinteralia composerinteralia force-pushed the loosen-faraday_middleware branch from ab7298e to e7470aa Compare June 5, 2024 15:59
@composerinteralia composerinteralia marked this pull request as ready for review June 5, 2024 16:03
Copy link

@tomthorogood tomthorogood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏎️ 🙇

@composerinteralia composerinteralia merged commit 80f5260 into main Jun 5, 2024
3 checks passed
@composerinteralia composerinteralia deleted the loosen-faraday_middleware branch June 5, 2024 16:07
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