-
Notifications
You must be signed in to change notification settings - Fork 7
feat: initial oas generators support; algod http clients with tests covering transaction endpoints; refinements in python ffi package #63
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
Conversation
97af59d to
49cf4e5
Compare
|
Haven't reviewed in-depth yet, but would it be possible make the Python changes in a separate PR? We have merge conflicts anyways after #61 and having that work in a separate PR will make it a bit easier to review and iterate. |
8e6f806 to
6b060a0
Compare
|
Could we add extension to the moustache template files to make them a bit easier to digest? For example, instead of |
|
@joe-p adding extensions to mustache templates, while possible with mustache templating in general, wouldn't fit well to our use case. The base template was generated via oas generator command that stores the base files to the filesystem so developers can then extend them. The problem is that extension mapping for template files included in the base template are all postfixed with .mustache, if we are to preserve the extensions from original base templates we would have to manually update the files and then original generator would threat them as supporting external files instead of recognizing as files from base templates. Whenever potential updates in base templates arrive it would be hard for us to manually keep track of changes and remapping against latest templates we maintain with the file extensions. Once we have CD for clients, we can add the generated clients back to version control for tracking output stability, at that point it would be fairly easy to traceback from generated file back to mustache template by the filename. In most cases those would be custom template files for tests and those also contain explicit filename specification in the spec files per template folder. https://github.com/algorandfoundation/algokit-core/blob/spike/oas_clients/api/oas_templates/python/openapi-config.yaml |
47ad6e9 to
2e60651
Compare
9ff4673 to
1861099
Compare
chore: adding more structure to api folder; automating generation of py|ts clients chore: refining stock template to leverage pytest over unittest and auto generate valid baseline tests chore: removing auto generated tests as they are too cumbersome to modify - Instead setting up a structure for custom mustache files implementing manually written tests given that each end point (total around 55) often requires complex state setup - For the time being the only test established is the test for sending raw transactions chore: refining base python tests; fixing typescript template chore: add basic txn params tests chore: refine python transaction tests chore: typescript client tweaks and initial tests docs: initial doc on api folder and oas generators chore: adding default pr and issue templates chore: refning docs chore: moving python ffi improvements to separate pr; adding basic ci for oas clients chore: expose raw response context (#67) chore: addressing pr comments chore: merge conflict fixes chore: addressing pr comments
1861099 to
ef830d0
Compare
|
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Proposed changes
This PR introduces the infrastructure for generating Algorand API clients using the OpenAPI Generator tool. This approach automates the creation of clients in various languages (initially focusing on Python and TypeScript for
algokit-utils) from a single OpenAPI specification, ensuring consistency and reducing maintenance overhead.Motivation:
As outlined in
docs/research/openapi-generators.md, manually maintaining API clients across multiple languages is time-consuming and error-prone. Using OpenAPI generators allows us to:Changes:
/apito support the generation process:api/specs/: Contains the OpenAPI specifications (v2 and v3).api/api_clients/: Will hold the generated client code.api/oas_templates/: Stores custom Mustache templates for tailoring generated code.api/scripts/: Includes utility scripts (generate-api-clients.ts) for managing the generation process.openapitools.json,package.json,tsconfig.json,openapi-config.yaml) to configure the generator and manage dependencies (likebunfor running the generation script).AvmValueschema for Python).scripts/generate-api-clients.ts(run viabun run) to orchestrate the client generation, including handling.openapi-generator-ignorefiles to protect custom code.get pending txns,get tx params,post raw txn) needed foralgokit-utilsintegration.docs/research/openapi-generators.mddetailing the approach, structure, rationale, and future work.poetry.lockandpyproject.tomlinpackages/python/algokit_transactreflecting changes potentially related to CFFI or other dependencies needed for the generated clients or testing infrastructure. (Specific updates includecffi,maturin,packaging,pluggy,pytest,tomli, and adjustments to dev dependencies).This PR lays the baseline for a more scalable and maintainable approach to managing Algorand API clients across different languages within the monorepo project.