fix(cdk): Classify HTTP 400 as config error#1033
fix(cdk): Classify HTTP 400 as config error#1033devin-ai-integration[bot] wants to merge 2 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1779545060-dutchie-error-classification#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1779545060-dutchie-error-classificationPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)4 069 tests ±0 4 058 ✅ ±0 7m 39s ⏱️ -5s Results for commit 51951c3. ± Comparison against base commit f67a9d9. This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
PyTest Results (Full)4 072 tests ±0 4 060 ✅ ±0 11m 29s ⏱️ +32s Results for commit 51951c3. ± Comparison against base commit f67a9d9. This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both. |
Summary
Related to https://github.com/airbytehq/oncall/issues/12695:
https://github.com/airbytehq/oncall/issues/12695
Classify the CDK's default HTTP 400
Bad requesterror asconfig_errorinstead ofsystem_error.Update declarative default error handler coverage so 400 response filters inherit the corrected failure type.
Update HTTP client exception coverage for retry, default backoff, and rate-limit paths to expect
config_errorfor 400 responses.Update resumable full refresh failure coverage so emitted trace errors also expect the corrected 400 classification.
Declarative-First Evaluation
The affected source is a custom Connector Builder/declarative manifest using the CDK
DefaultErrorHandler. The manifest can override individual responses, but the Sentry-highlighted message is emitted by the shared CDK default mapping, so the targeted fix belongs in the CDK runtime rather than a custom Python component or checked-in connector manifest.Breaking Change Evaluation
Not breaking. This changes failure classification metadata for HTTP 400 errors only; it does not change schemas, streams, specs, state, or connector configuration.
Review & Testing Checklist for Human
config_erroris the intended default classification for HTTP 400 responses from declarative HTTP sources.system_errorfor 400s is expected to change.Notes
Tested locally:
poetry run pytest unit_tests/sources/mock_server_tests/test_resumable_full_refresh.py::ResumableFullRefreshStreamTest::test_resumable_full_refresh_failure unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py unit_tests/sources/streams/http/test_http_client.py -x— 93 passed.poetry run ruff check airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py unit_tests/sources/streams/http/test_http_client.py unit_tests/sources/mock_server_tests/test_resumable_full_refresh.py— passed.poetry run ruff format --check airbyte_cdk/sources/streams/http/error_handlers/default_error_mapping.py unit_tests/sources/declarative/requesters/error_handlers/test_default_error_handler.py unit_tests/sources/streams/http/test_http_client.py unit_tests/sources/mock_server_tests/test_resumable_full_refresh.py— passed.Also attempted the full
poetry run pytest unit_tests/ -x; collection currently fails before these tests on missing optional dependencylangchain_coreinunit_tests/destinations/vector_db_based/config_test.py.Link to Devin session: https://app.devin.ai/sessions/8b487aeb34c84f1b98385651d74261f2