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

Replace httpclient with net/http in bosh-monitor #2557

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

aramprice
Copy link
Member

@aramprice aramprice commented Aug 31, 2024

Two methods in Plugins::HttpRequestHelper used the httpclient gem to make HTTP(S) requests. This PR replaces that gem with Ruby's built-in net/http gem.

This change required modifying some of the callers of HttpRequestHelper (in bosh-director) since the response object from net/http differs slightly from httpclient's, as well as the more mocked portions of the spec for HttpRequestHelper which relied on httpclient internals.

@aramprice aramprice requested review from selzoc, a team and nader-ziada and removed request for a team August 31, 2024 18:06
@aramprice aramprice force-pushed the replace-httpclient branch 2 times, most recently from ab25ae2 to a1d7ee6 Compare September 3, 2024 22:47
@aramprice aramprice force-pushed the replace-httpclient branch 3 times, most recently from 3f21896 to 4bd9d9d Compare September 17, 2024 04:04
Two methods in `Plugins::HttpRequestHelper` used the [httpclient
gem](https://github.com/nahi/httpclient) to make HTTP(S) requests. This
PR replaces that gem with Ruby's built-in `net/http` gem.

This change required modifying some of the callers of
`HttpRequestHelper` (in bosh-director) since the response object from
`net/http` differs slightly from `httpclient`'s, as well as the more
mocked portions of the spec for `HttpRequestHelper` which relied on
`httpclient` internals.

In addtions the two "sync" methods now return `[body, status]` instead
opf the http client's internal `Response`. This is the same pattern as
the other Async methods.

Signed-off-by: Brian Upton <brian.upton@broadcom.com>
Signed-off-by: Brian Upton <brian.upton@broadcom.com>
... only from an asynchronous context.

Signed-off-by: Brian Upton <brian.upton@broadcom.com>
Copy link
Contributor

@nader-ziada nader-ziada left a comment

Choose a reason for hiding this comment

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

lgtm

@jpalermo jpalermo merged commit 0be9c6b into main Sep 26, 2024
24 checks passed
@jpalermo jpalermo deleted the replace-httpclient branch September 26, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants