-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add client for http4s library #3118
Conversation
It just came to me, @Philippus if you think that |
I would love to use this client! I think currently sttp use future backend (which is backed scala future & akka iiuc). So this is definitely worth adding imho. Also We probably can have more perform IO backed client if We have this: #2379 |
@lenguyenthanh I was also thinking about that, addressed in #3119 |
this is great, thanks! I was about to do it. |
I think adding a new client is fine, provided someone is using it in production (like you). Maybe we can mark it as experimental, allowing us to make backwards incompatible changes for a certain time. |
@Philippus nice! Then I'm going to add tests for it |
@Philippus I've added some tests following the pattern from sttp. I think it is ready to be merged, WDYT? |
9ec9393
to
24be4dd
Compare
24be4dd
to
d16da4e
Compare
d16da4e
to
1cea7c5
Compare
@igor-vovk now that #3124 is merged, care to get back to this PR and clean it for merging (or create a new one based on the current main branch)? |
@Philippus thanks for merging #3124! Yes, cleaned up custom authentication from the implementation, please check |
@lenguyenthanh Do you have time to take a look at the PR to see if this will work for you as well? |
of course, I'll take a look tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only have few nit comments, otherwise lgtm. And this will be so much better with the other of @igor-vovk's pr: #3119
...c4s-client-http4s/src/main/scala/com/sksamuel/elastic4s/http4s/Elastic4sEntityEncoders.scala
Outdated
Show resolved
Hide resolved
...s-client-http4s/src/main/scala/com/sksamuel/elastic4s/http4s/RequestResponseConverters.scala
Outdated
Show resolved
Hide resolved
...s-client-http4s/src/main/scala/com/sksamuel/elastic4s/http4s/RequestResponseConverters.scala
Outdated
Show resolved
Hide resolved
@lenguyenthanh I've addressed all your comments |
...client-http4s/src/test/scala/com/sksamuel/elastic4s/http4s/Http4sRequestHttpClientTest.scala
Show resolved
Hide resolved
90de776
to
a7f8762
Compare
@Philippus I also noticed test flakiness, tried to add health check before proceeding on the level of GH actions in #3207, but failing to understand why it fails in GH Actions environment (works locally, probably something with bash options...) |
I think it's because of all the tests running on the same instance. If you change the test to "yellow" or "green" I think it will be fine. Even "red" would be a valid answer for the test I think, because it's about proof of connection. |
@Philippus I think what happens is that this status changes from |
Marked #3207 as ready for review. It now waits elastic to start before continuing, should reduce tests flakiness |
If you think it's worth having it as a test I think we can bring it back. We can always remove it again, if it turns out to be flaky again. |
This reverts commit a7f8762.
Reverted the deletion of the test. After #3207 will be merged, the test should stop being flaky |
Hi! I don't know if there is space for another client, but it seemed appropriate for me to add it, since it's kinda mainstream client in
cats-effect
ecosystem (http4s/circe/cats-effect). I was kinda surprised not to find it, ended up implementing it, but got tired copying it between my projects where I use elastic4s.If you think it's a good idea to add it, I will be happy to add tests in this PR as well. Thank you.