Skip to content

884: Ruby Upgrade#9

Merged
ehimen-io merged 7 commits intomainfrom
owens/884/ruby-upgrade
Feb 20, 2026
Merged

884: Ruby Upgrade#9
ehimen-io merged 7 commits intomainfrom
owens/884/ruby-upgrade

Conversation

@ehimen-io
Copy link
Contributor

No description provided.

@ehimen-io ehimen-io requested a review from lavaturtle February 20, 2026 14:54
Copy link
Contributor

@lavaturtle lavaturtle left a comment

Choose a reason for hiding this comment

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

👍 beautiful!

@@ -1,5 +1,11 @@
# Changelog

## [1.1.0] - 2026-02-11
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Arguably we could do a major version bump since there are breaking changes in here, but i don't feel strongly about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a bad idea

Copy link
Contributor Author

@ehimen-io ehimen-io Feb 20, 2026

Choose a reason for hiding this comment

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

Major version bump sounds good in any other scenario. However, I do like being able to eye-ball a semver across all our ruby repos and see if includes the ruby + faraday upgrade or not. Currently, all gems we maintain with Ruby 4.0 and/or Faraday 2.14 have a semver 1.x

For that selfish reason, I'll keep the semver as is.

req.params = params
req.headers['ens-auth-token'] = ens_auth_key
req.body = ::JSON.generate(body) unless body.empty?
req.body = body unless body.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand this correctly, we no longer need the JSON.generate and to explicitly set the Content-Type of the request, because the connection setup already specifies :json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Faraday handles setting the content-type and wiring up the JSON middleware.

shared_examples_for 'list pages' do
it 'should get pages' do
stub_request(:get, pages_url)
.with(headers: standard_headers, query: { 'type' => page_type, 'status' => page_status })
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we not sending the Content-Type on these requests anymore? Why not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Faraday :json request middleware only sets Content-Type when it encodes a body, so GET requests lose the header. Is there a reason we want to set the Content-Type on every request?

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, that makes sense! This is fine, I just wanted to understand why the behavior was changing.

@ehimen-io ehimen-io merged commit 3975e37 into main Feb 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants