120 update openapi python client, fix vulnerabilities, update PTB to version 5#139
120 update openapi python client, fix vulnerabilities, update PTB to version 5#139
Conversation
| env: | ||
| SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }} | ||
| SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }} | ||
| SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }} | ||
| PROJECT_SHORT_TAG: SAPIPY |
| @@ -4,21 +4,24 @@ on: | |||
| workflow_call: | |||
There was a problem hiding this comment.
The workflows are mainly generated by PTB, but updated in a few places, which are commented.
Manual updated were required mainly for
- Add secrets for accessing SaaS instances
- Re- integrate the slow tests, which were marked with
pytest.mark.slowbefore
| env: | ||
| SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }} | ||
| SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }} | ||
| SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }} | ||
| PROJECT_SHORT_TAG: SAPIPY |
| @@ -1,16 +1,13 @@ | |||
| from __future__ import annotations | |||
|
|
|||
There was a problem hiding this comment.
Main changes in this file are for handling results of type ApiError, which are new in version 0.26
of openapi-python-client.
Our updated implementation now raises an exception of type OpenApiError.
| wait_fixed, | ||
| ) | ||
|
|
||
| import exasol.saas.client.openapi.models as openapi_models |
There was a problem hiding this comment.
The linter coming with PTB version 5 does no longer accept
from exasol.saas.client import openapi
openapi.models.CreateDatabaseInitialCluster(...)There was a problem hiding this comment.
I think, we saw something similar in another project; the linter requires explicit exports if you want to import things. The explicit export can be happen by definition or by __all__
|
| try: | ||
| return still_exists() | ||
| except (TryAgain, RetryError) as ex: | ||
| raise DatabaseDeleteTimeout from ex |
There was a problem hiding this comment.
I guess the main reason for this change is that you can chain the original exception
| class ApiRunner: | ||
| def __init__(self, mocker): | ||
| def __init__(self, monkeypatch): | ||
| self.api = OpenApiAccess(Mock(), account_id="A1") | ||
| self._mocker = mocker | ||
| self._monkeypatch = monkeypatch | ||
| self.mock = None | ||
|
|
||
| def mock_delete(self, side_effect): | ||
| from exasol.saas.client.api_access import delete_database as api | ||
|
|
||
| self.mock = Mock(side_effect=side_effect) | ||
| self._mocker.patch( | ||
| "exasol.saas.client.api_access." "delete_database.sync_detailed", self.mock | ||
| ) | ||
| self._monkeypatch.setattr(api, "sync_detailed", self.mock) |
There was a problem hiding this comment.
This thing is a bit weird
There was a problem hiding this comment.
hm, the file name is a bit weird. I know it is possible with pytest, but all other places use test_*
There was a problem hiding this comment.
hm, the file name is a bit weird. I know it is possible with pytest, but all other places use test_*




This PR closes the following issues
openapi-python-clientapi_access.pyto processApiErrorsnoxconfig.pyneeded to be updatedCloses #120
Closes #141
Closes #140