Skip to content

Conversation

@rsanheim
Copy link
Contributor

@rsanheim rsanheim commented Oct 20, 2021

This is to upgrade to a version that works with M1 ARM macs.

The latest version of the http gem drops http-parser for llhttp, which has broader compatibility and works fine out of the box on ARM. The 5.0.4 version of http also includes many other fixes that we should update for.

See https://github.com/httprb/http/blob/main/CHANGES.md for details on the update. This requires one small change in our Exotel API calls to properly handle JSON responses -- otherwise the rest of the changes are spec changes.

(this is probably the better alternative to #2997, because we should be on the latest version of the http gem anyways)

/cc @abnios

re: #1969
re: httprb/http#630

To get to a fixed version for arm m1 macs

The latest version of the http gem drops http-parser for llhttp, which
has broader compatibility, as well as including a whole host of other
fixes in http itself.

see https://github.com/httprb/http/blob/main/CHANGES.md for details

re: #1969
re: httprb/http#630
@harimohanraj89 harimohanraj89 temporarily deployed to simple-review-pr-2998 October 20, 2021 16:26 Inactive
HTTP has a built in parse method we can use, we just have to provide the
content type that we are expecting

see httprb/http#540
@rsanheim rsanheim temporarily deployed to simple-review-pr-2998 October 20, 2021 17:43 Inactive
http-cookie (1.0.4)
domain_name (~> 0.5)
http-form_data (2.3.0)
http-parser (1.2.1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No more http-parser!

return unless response.status.ok?

JSON.parse(response, symbolize_names: true)
response.parse(:json).deep_symbolize_keys
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 http gem has a parse method built in, which works fine, we just need to tell it to parse as json.

around do |example|
WebMock.disallow_net_connect!
example.run
WebMock.allow_net_connect!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This made tracking down spec failures easier, because our suite defaults to this being allowed for feature specs to work.

@rsanheim rsanheim temporarily deployed to simple-review-pr-2998 October 20, 2021 17:51 Inactive
@rsanheim rsanheim temporarily deployed to simple-review-pr-2998 October 20, 2021 22:47 Inactive
@rsanheim rsanheim merged commit 12b9d8f into master Oct 20, 2021
@rsanheim rsanheim deleted the update-http-gem branch October 20, 2021 23:23
@rsanheim rsanheim mentioned this pull request Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants