docs(api): exclude retiring connection endpoints from the public spec - #175
docs(api): exclude retiring connection endpoints from the public spec#175hotdata-automation[bot] wants to merge 1 commit into
Conversation
| from typing_extensions import Literal, Self | ||
|
|
||
| JOBRESULT_ONE_OF_SCHEMAS = ["BulkCreateDatabasesResult", "ConnectionRefreshResult", "IndexInfoResponse", "LoadManagedTableResponse", "TableRefreshResult"] | ||
| JOBRESULT_ONE_OF_SCHEMAS = ["BulkCreateDatabasesResult", "IndexInfoResponse", "LoadManagedTableResponse", "TableRefreshResult"] |
There was a problem hiding this comment.
ConnectionRefreshResult was dropped from this oneOf, but JobType still declares DATA_REFRESH_CONNECTION = 'data_refresh_connection' (hotdata/models/job_type.py:33).
JobStatusResponse.from_dict calls JobResult.from_dict(obj["result"]) unconditionally when result is non-null (hotdata/models/job_status_response.py:119), and JobResult.from_json raises ValueError("No match found ...") when nothing matches. A connection-refresh payload (connection_id, duration_ms, tables_refreshed, tables_failed, total_rows) matches none of the four remaining variants — TableRefreshResult requires rows_synced/schema_name/table_name.
So jobs_api.get_job on a completed data_refresh_connection job — and list_jobs for any workspace that has one in history — will raise instead of deserializing. If the job type is genuinely retired too, it should come out of JobType in the same spec change; if it isn't, ConnectionRefreshResult needs to stay in the JobResult union. Worth confirming upstream in hotdata-dev/www.hotdata.dev#343 before this merges.
|
|
||
| ### Changed | ||
|
|
||
| - docs(api): exclude retiring connection endpoints from the public spec |
There was a problem hiding this comment.
nit: this entry is filed under ### Changed, but the change removes public API surface that shipped in 0.10.0 — SecretsApi, RefreshApi, ConnectionTypesApi, ConnectionsApi.check_connection_health, and ~17 exported models. Anyone importing those breaks on upgrade. Consider a ### Removed section listing the dropped classes so the release notes make the break visible to users. (not blocking)
There was a problem hiding this comment.
Review
My copy of the full diff was truncated (it cut off partway through hotdata/api/refresh_api.py). I reviewed the remainder against the checked-out tree at the head SHA rather than the diff text — the deleted modules are confirmed absent from the working tree.
Blocking Issues
1. Hand-written integration tests still import the deleted modules — pytest tests/integration will fail at collection.
.github/workflows/regenerate.yml:47-53 deliberately leaves tests/ (plural, hand-written) untouched during regen, so this PR removed the generated APIs without updating the tests that consume them:
tests/integration/conftest.py:17—from hotdata.api.connection_types_api import ConnectionTypesApitests/integration/conftest.py:25—from hotdata.api.refresh_api import RefreshApitests/integration/conftest.py:27—from hotdata.api.secrets_api import SecretsApitests/integration/test_connection_types_read.py:9—ConnectionTypesApitests/integration/test_secrets_crud.py:15,17,18—SecretsApi,CreateSecretRequest,UpdateSecretRequest
Because these are module-scope imports in conftest.py, the ImportError takes down the entire tests/integration suite, not just the secrets/connection-types scenarios. The Integration Tests / integration job runs pytest tests/integration -v (.github/workflows/integration-tests.yml:99) and is a required check for auto-merge.
2. JobType.DATA_REFRESH_CONNECTION outlived its JobResult variant — see the inline comment on hotdata/models/job_result.py:29. Any completed data_refresh_connection job now fails to deserialize.
Action Required
- Delete
tests/integration/test_secrets_crud.pyandtests/integration/test_connection_types_read.py, and drop thesecrets_api,connection_types_api, andrefresh_apifixtures plus their imports fromtests/integration/conftest.py(lines 17, 25, 27, 155-156, 170-171, 190-191). Confirm the matching scenarios were also removed fromwww.hotdata.dev/api/test-scenarios.yaml, otherwisescenario-paritywill start failing on the missing files. - Remove the
check_connection_healthcall attests/integration/test_connections_read.py:31-33. That test is currently@pytest.mark.skiped so it will not fail today, but it becomes anAttributeErrorthe moment the skip is lifted. - Resolve the
JobResult/JobTypemismatch — either upstream in the spec, or confirm it is intentional.
Items 1 and 2 are repo-local and can be fixed on this branch; item 3 likely belongs in the upstream spec PR (hotdata-dev/www.hotdata.dev PR 343).
Auto-generated from the updated HotData OpenAPI spec.
Source: https://github.com/hotdata-dev/www.hotdata.dev/pull/343