-
Notifications
You must be signed in to change notification settings - Fork 61
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
RFC: CI framework #33
Comments
Would this still be needed if we generated the API implementation in OpenSearch from spec? That’s one option in opensearch-project/OpenSearch#3090 |
@dblock This will be needed initially to create the definitions of all the APIs to ensure that the definitions match the actual implementation as they are not coupled. |
Why not skip this step and do opensearch-project/OpenSearch#3090? |
I think having a CI framework to validate the smithy models being created for the API specification would be very useful to find out missing parameters / request-response structures. We have already found few issues in the models while testing out using dredd framework. |
Implemented #35 |
Is your feature request related to a problem? Please describe.
We don't have an automated testing mechanism for our Smithy models to guarantee that they are accurate representations of OpenSearch service APIs. To validate these smithy models, we have to manually match the PR raised by the contributor with the OpenSearch documentation. This is a time-consuming and error-prone process.
As a result, implementing a continuous integration workflow will be extremely helpful in ensuring that the smithy models accurately reflects the API implementation.
Describe the solution you'd like.
We propose to use Dredd framework for validating our smithy models API description document against backend implementation of the API. We will make Dredd part of our continuous integration workflow using GitHub actions. CI workflow will ensure that the application code we are developing doesn’t violate the contract between the API implementation and the API documentation.
Additional context
Working of Continuous Integration workflow:
When a contributor raises a PR (pull request) for the Smithy specification, GitHub will listen for it and take an automated action using GitHub actions, which will trigger a CI workflow.
Further in the CI workflow:
Requirements:
Example: While implementing Create Index API here, we have passed “books” as an example index URL parameter.
Smithy models can easily be configured to translate into OpenAPI format by specifying
Below is the snippet for set up process before implementing “DELETE” API.
Driver-Script file: This file will be responsible for running a python-script when invoked by CI workflow, to iteratively call all the OpenAPI documentation present for API implementation and will store the details of total tests passed/failed.
Config file: This file will be used to define our GitHub Actions workflow. This will be written in YAML and live inside our GitHub repository in the .github/workflows directory.
Test Directory structure:
Let’s say we are creating IDLs for Ping, Create index and Delete APIs. this is how our test directory will look like.
Benefits:
Limitations:
The text was updated successfully, but these errors were encountered: