-
Notifications
You must be signed in to change notification settings - Fork 186
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
[PROPOSAL]Merge Generated APIs into Existing Client Module #477
Comments
This is quite thoughtful. If you didn't have to minimize breaking changes, what would this process look like? I would work backwards from there, with the hope that once the API generator is producing the entire API we can delete all patches and make one major version bump breaking backwards compatibility. |
6 tasks
This was referenced Sep 22, 2023
This was referenced Oct 2, 2023
This was referenced Oct 9, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are you proposing?
Merge the generated APIs into the existing client module to progress towards complete client generation, ensuring alignment with the server.
How does the opensearch-py API Generator function?
What problems are you trying to solve?
Consider 'indices' namespace, post-generation, existing APIs are replaced by generated ones. Some generated API may be different from the existing APIs. We need to explore solutions for handling divergent APIs, termed as 'Patch APIs.' Our goal is to structure the merging process to prevent breaking changes. We categorize APIs as 'generatable' or 'Patch'
Solutions:
Three approaches are discussed below to separate and structure generatable and patch APIs.
Current client structure:
Approach 1
Consider "indices" namespace, all the patch APIs are placed in a separate file "indices/patch.py". In this way while running generator, patch APIs wont be altered. And we generate all other APIs into "indices.py". Easy implementation and contributor-friendly.
Approach 2
Change client structure to one file per action/API within the namespace. Significant effort initially, both in changing the client structure and adapting the generator. The following PR shows more about this approach. https://github.com/opensearch-project/opensearch-py/pull/475/files
Approach 3
Modify specs of patch APIs within the generator to match existing APIs. Utilize overrides in ninja templates to overwrite generated APIs. Time-consuming but avoids major structural changes.
What is the developer experience going to be?
Developers must understand generator functionality before contributing. Decisions on contributions (API spec, generator, or patch) are essential.
Are there breaking changes to the User Experience?
Aims for no breaking changes; user experience remains consistent.
Why should it be built?
Facilitates easier addition of client support for new server-side APIs.
Please let me know your thoughts and suggestions.
The text was updated successfully, but these errors were encountered: