-
Notifications
You must be signed in to change notification settings - Fork 58
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
Psr interfaces #233
base: main
Are you sure you want to change the base?
Psr interfaces #233
Conversation
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 love this change, thank you! Let's iterate till we get this to green. I think it's a lot simpler than #228, what do you think @shyim?
- Sign DCO,
git commit -s --amend
for existing commits, force push. - Add to CHANGELOG.
- Let's add an UPGRADING.md like https://github.com/opensearch-project/opensearch-py/blob/main/UPGRADING.md with details on migrating to this version.
- Should we keep a
OpenSearch\ClientBuilder
even with different parameters for easier migration?
82721bd
to
2f4661d
Compare
I noticed you tried to fix DCO?
Something is not adding up between your settings and the commit signature. |
16b664e
to
f14e9a2
Compare
I think I fixed that now? Let me know if it's still not rigt. I've updated the ClientBuilder and refactored the endpoints callable into it's own factory class. I think this makes it easier to understand, and also allows clients to swap out an implementation or use a dependency injection container if they want. I updated the client and namespace templates also. I regenerated afterwards and it looks like there are a lot of new API methods added. Should I use something other than https://github.com/opensearch-project/opensearch-api-specification/releases/download/main-latest/opensearch-openapi.yaml ? |
I think setHandler are not working anymore right? So aws sig v4 needs to be adjusted? |
Yes, I think we'd need to rewrite the guzzle middleware/handler without the ring dependency to make it easier for people who use AWS OpenSearch service to use signed requests. |
Yep looks good.
👍
Let's work on merging #223 separately from this not to mix in the PSR changes. It needs some attention to tests. If nobody picks it up here I can do it soon. |
cc2980f
to
7a45305
Compare
Signed-off-by: Kim Pepper <kim@pepper.id.au>
be04c45
to
df01728
Compare
Thinking about this more, returning HTTP Response might not be the best DX. We should introduce a The Promise would also return this too. Thoughts? |
@kimpepper In other clients we return a strongly typed object that derives from a base class that also gives access to the underlying raw HTTP response from the network library "as is" along with some helper methods like status code or raw body. Note that OpenSearch returns more than JSON, too. |
I fixed what was broken in #223 and merged, rebase. |
Fixes #199
Description
This PR removes the dependency on a specific HTTP client implementation and introduces PSR-7, PSR-17 and PSR-18 interfaces.
Issues Resolved
It greatly simplifies the volume and complexity of the library codebase and removes the need to manage:
Users of this library can choose from a number of synchronous and asynchronous HTTP clients including:
It greatly simplifies the volume and complexity of the library codebase. Specifically, it:
ezimuel/ringphp
which is not longer getting updatesBreaking changes
\Psr\Http\Message\StreamInterface
to decode the response in a memory efficient wayTasks:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.