Skip to content

Commit a84e6e8

Browse files
authored
Merge pull request #12 from exasol/feature/#8-Add_CI_task_to_check_if_the_generated_API_is_outdated
Feature/#8 add ci task to check if the generated api is outdated
2 parents cb2f783 + a334a17 commit a84e6e8

File tree

91 files changed

+9626
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+9626
-15
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check if OpenAPI is Outdated
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "github-pages/*"
7+
- "gh-pages/*"
8+
pull_request:
9+
# check results of former push could be outdated
10+
types: [opened, reopened]
11+
workflow_dispatch:
12+
schedule:
13+
# “At 4 am on every day.” (https://crontab.guru)
14+
- cron: "0 4 * * *"
15+
16+
17+
jobs:
18+
19+
check-api-outdated:
20+
name: Check if OpenAPI Generated From JSON is Outdated
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
25+
steps:
26+
- name: SCM Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Setup Python & Poetry Environment
30+
uses: exasol/python-toolbox/.github/actions/[email protected]
31+
with:
32+
python-version: "3.10"
33+
34+
- name: Run Nox Task check-api-outdated
35+
run: poetry run nox -s check-api-outdated
36+
37+
- name: Report Failure Status to Slack Channel
38+
if: ${{ failure() }}
39+
uses: ravsamhq/notify-slack-action@v2
40+
with:
41+
status: ${{ job.status }}
42+
token: ${{ github.token }}
43+
notification_title: "Generated OpenAPI seems to be outdated."
44+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
45+
notify_when: "failure,cancelled,warnings,skipped"
46+
env:
47+
SLACK_WEBHOOK_URL: ${{ secrets.INTEGRATION_TEAM_SLACK_NOTIFICATION_WEBHOOK }}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22

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

5+
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).
6+
7+
A GitHub action will check each morning if the generated model layer is outdated.
8+
9+
See
10+
* [User Guide](doc/user_guide/user-guide.md)
11+
* [Developer Guide](doc/developer_guide/developer_guide.md)

doc/changes/changes_0.1.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ n/a
1515
## Feature
1616

1717
* #6: Added Nox task for generating the API
18+
* #8: Add CI task to check if the generated API is outdated

doc/developer_guide/developer_guide.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

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

7-
The following command installs the pre-commit hooks, see also [framework pre-commmit](https://pre-commit.com/) and Git
8-
documentation on [Customizing Git Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks):
7+
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):
98

109
```shell
1110
poetry run pre-commit install
@@ -15,24 +14,19 @@ When the hooks are installed, then git will run each of the hooks on the resp. s
1514

1615
## Generate the API Model
1716

18-
The model layer of this API has been generated from the OpenAPI specification
19-
in JSON format of the SaaS API https://cloud.exasol.com/openapi.json using
20-
[openapi-python-client](https://github.com/openapi-generators/openapi-python-client).
17+
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).
2118

22-
See also
23-
[API Documentation](https://docs.exasol.com/saas/administration/rest_api/rest_api.htm)
24-
and [Swagger UI](https://cloud.exasol.com/openapi/index.html).
19+
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).
2520

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

2823
```shell
2924
poetry run nox generate-api
3025
```
3126

32-
### Change the Source URL of API Model JSON Definition
27+
### Change the Source URL of the API Model JSON Definition
3328

34-
If you want to retrieve the JSON definition for the API model from a different
35-
source then just edit file `noxfile.py`.
29+
If you want to retrieve the JSON definition for the API model from a different source then just edit file `noxfile.py`.
3630

3731
### Read JSON definition From a Local File
3832

exasol/saas/client/openapi/__init__.py

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exasol/saas/client/openapi/api/__init__.py

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exasol/saas/client/openapi/api/clusters/__init__.py

Whitespace-only changes.

exasol/saas/client/openapi/api/clusters/create_cluster.py

Lines changed: 221 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)