Skip to content
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

Feature/#8 add ci task to check if the generated api is outdated #12

Merged
28 changes: 28 additions & 0 deletions .github/workflows/check-api-outdated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check if OpenAPI is Outdated

on:
workflow_dispatch:
schedule:
# “At 4 am on every day.” (https://crontab.guru)
- cron: "0 4 * * *"


jobs:

check-api-outdated:
name: Check if OpenAPI Generated From JSON is Outdated
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: SCM Checkout
uses: actions/checkout@v3

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"

- name: Run Nox Task check-api-outdated
run: poetry run nox -s check-api-outdated
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@

API enabling Python applications connecting to Exasol database SaaS instances and using their SaaS services.

The model layer of this API is generated from the OpenAPI specification in JSON format of the SaaS API https://cloud.exasol.com/openapi.json using [openapi-python-client](https://github.com/openapi-generators/openapi-python-client).

A GitHub action will check each morning if the generated model layer is outdated.

See
* [User Guide](doc/user_guide/user-guide.md)
* [Developer Guide](doc/developer_guide/developer_guide.md)
1 change: 1 addition & 0 deletions doc/changes/changes_0.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ n/a
## Feature

* #6: Added Nox task for generating the API
* #8: Add CI task to check if the generated API is outdated
14 changes: 4 additions & 10 deletions doc/developer_guide/developer_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

saas-api-python includes a file `.pre-commit-config.yaml`.

The following command installs the pre-commit hooks, see also [framework pre-commmit](https://pre-commit.com/) and Git
documentation on [Customizing Git Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks):
The following command installs the pre-commit hooks, see also [framework pre-commmit](https://pre-commit.com/) and Git documentation on [Customizing Git Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks):

```shell
poetry run pre-commit install
Expand All @@ -15,13 +14,9 @@ When the hooks are installed, then git will run each of the hooks on the resp. s

## Generate the API Model

The model layer of this API has been generated from the OpenAPI specification
in JSON format of the SaaS API https://cloud.exasol.com/openapi.json using
[openapi-python-client](https://github.com/openapi-generators/openapi-python-client).
The model layer of this API has been generated from the OpenAPI specification in JSON format of the SaaS API https://cloud.exasol.com/openapi.json using [openapi-python-client](https://github.com/openapi-generators/openapi-python-client).

See also
[API Documentation](https://docs.exasol.com/saas/administration/rest_api/rest_api.htm)
and [Swagger UI](https://cloud.exasol.com/openapi/index.html).
See also [API Documentation](https://docs.exasol.com/saas/administration/rest_api/rest_api.htm) and [Swagger UI](https://cloud.exasol.com/openapi/index.html).

In order to regenerate the model layer please use the following command line:

Expand All @@ -31,8 +26,7 @@ poetry run nox generate-api

### Change the Source URL of API Model JSON Definition
ckunki marked this conversation as resolved.
Show resolved Hide resolved

If you want to retrieve the JSON definition for the API model from a different
source then just edit file `noxfile.py`.
If you want to retrieve the JSON definition for the API model from a different source then just edit file `noxfile.py`.

### Read JSON definition From a Local File

Expand Down
15 changes: 11 additions & 4 deletions exasol/saas/client/openapi/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions exasol/saas/client/openapi/api/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
221 changes: 221 additions & 0 deletions exasol/saas/client/openapi/api/clusters/create_cluster.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading