Skip to content

120 update openapi python client, fix vulnerabilities, update PTB to version 5#139

Open
ckunki wants to merge 30 commits intomainfrom
refactoring/120-Update_openapi-python-client
Open

120 update openapi python client, fix vulnerabilities, update PTB to version 5#139
ckunki wants to merge 30 commits intomainfrom
refactoring/120-Update_openapi-python-client

Conversation

@ckunki
Copy link
Collaborator

@ckunki ckunki commented Feb 16, 2026

This PR closes the following issues

Closes #120
Closes #141
Closes #140

@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 07:30 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 07:32 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 07:55 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 07:59 — with GitHub Actions Inactive
Comment on lines +38 to +42
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually added

@ckunki ckunki changed the title 120 update openapi python client 120 update openapi python client, fix vulnerabilities, update PTB to version 5 Feb 16, 2026
@@ -4,21 +4,24 @@ on:
workflow_call:
Copy link
Collaborator Author

@ckunki ckunki Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.slow before

Comment on lines +38 to +42
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually added

@@ -1,16 +1,13 @@
from __future__ import annotations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator Author

@ckunki ckunki Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter coming with PTB version 5 does no longer accept

from exasol.saas.client import openapi

openapi.models.CreateDatabaseInitialCluster(...)

Copy link
Collaborator

@tkilias tkilias Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__

@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 09:12 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 09:17 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 10:41 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 11:15 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 14:00 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 15:36 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 16:14 — with GitHub Actions Inactive
@ckunki ckunki temporarily deployed to manual-approval February 16, 2026 16:42 — with GitHub Actions Inactive
@ckunki ckunki deployed to manual-approval February 17, 2026 08:20 — with GitHub Actions Active
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.1% Coverage on New Code (required ≥ 80%)
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Comment on lines +285 to +288
try:
return still_exists()
except (TryAgain, RetryError) as ex:
raise DatabaseDeleteTimeout from ex
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the main reason for this change is that you can chain the original exception

Comment on lines 26 to +36
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)
Copy link
Collaborator

@tkilias tkilias Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This thing is a bit weird

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, the file name is a bit weird. I know it is possible with pytest, but all other places use test_*

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, the file name is a bit weird. I know it is possible with pytest, but all other places use test_*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants