fix(source-github): replace deprecated MessageRepresentationAirbyteTracedErrors with AirbyteTracedException#76038
Conversation
…acedErrors with AirbyteTracedException Replace all imports and usages of the removed MessageRepresentationAirbyteTracedErrors class with AirbyteTracedException from airbyte_cdk.utils.traced_exception. The MessageRepresentationAirbyteTracedErrors class was removed in CDK PR #927 (airbyte-python-cdk v7.10.2) without a backward-compatible alias, causing ImportError at connector startup. Resolves airbytehq/oncall#11850 Co-Authored-By: bot_apk <apk@cognition.ai>
🤖 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 TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit a7e033f. |
|
/ai-prove-fix
|
🔬 Prove-Fix:
|
| Check | Result |
|---|---|
| Viability | ✅ Fix correctly replaces deprecated exception class |
| Safety | ✅ No malicious code or suspicious patterns |
| Breaking Change | ✅ NOT breaking — internal exception handling only |
| Reversibility | ✅ Can be safely rolled back |
Pre-release Published ✅
- Docker Image:
airbyte/source-github:2.1.16-preview.a7e033f - Publish Workflow: View — completed successfully
Evidence Summary
1. Regression Tests — ✅ PASSED
- Workflow: Regression Test Run
- Dev version produced equivalent results to control version (comparison mode)
- No regressions detected
2. Live Connection Test — ✅ PROVING EVIDENCE
- Pinned 1 internal sandbox connection (40 streams) to pre-release
2.1.16-preview.a7e033f - Sync is actively running (16.3 MB / 1,020 records synced, 38+ min elapsed)
- Key signal: Two most recent syncs on this connection previously FAILED — current sync is still running successfully
- Pin left in place for continued validation
Fix Analysis
Replaces deprecated MessageRepresentationAirbyteTracedErrors with AirbyteTracedException in:
source.py(connection check error handling)streams.py(stream read error handling / rate limit backoff)
This is a safe, minimal change — AirbyteTracedException is the parent class, so the catch blocks continue to handle the same exceptions.
Verdict
This PR appears ready for review and merge. Regression tests pass and live connection testing shows proving evidence. For broader validation before release, consider running /ai-canary-prerelease.
Detailed results logged to oncall issue
|
…acedErrors with AirbyteTracedException (airbytehq#76038) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: bot_apk <apk@cognition.ai>
…ad_records PR #76038 (v2.1.16) replaced the deprecated MessageRepresentationAirbyteTracedErrors with AirbyteTracedException in GithubStreamABC.read_records but missed the identical reference in ContributorActivity.read_records (line 1814). This causes a NameError at runtime when the contributor_activity stream hits a backoff exception, since the import was removed but the except clause still referenced the old class name. This commit fixes the remaining reference and updates the test to match. Resolves airbytehq/oncall#11850 Co-Authored-By: davin@airbyte.io <davinchia@gmail.com>
What
Replace all imports and usages of the removed
MessageRepresentationAirbyteTracedErrorsclass withAirbyteTracedExceptionin source-github.MessageRepresentationAirbyteTracedErrorswas removed fromairbyte_cdk.sources.streams.http.http_clientin CDK PR #927 (v7.10.2) without a backward-compatible alias, causingImportErrorat connector startup on newer CDK versions.Resolves https://github.com/airbytehq/oncall/issues/11850:
How
MessageRepresentationAirbyteTracedErrorsimports fromsource.py,streams.py,test_stream.py, andtest_multiple_token_authenticator.pyexcept MessageRepresentationAirbyteTracedErrorswithexcept AirbyteTracedExceptionin exception handlerspytest.raises(...)calls in tests to useAirbyteTracedExceptionReview guide
source_github/source.py—check_connection(line ~206): catches traced exceptions and extractse.messagefor user-friendly error display. Theexcept Exceptionfallback below does similar work, so impact is minimal.source_github/streams.py—read_records(line ~136): catches traced exceptions and inspectse._exception.response.status_code. The pre-existinghasattrguard (line ~140) is meant to protect against exceptions without_exception, though note the guard usesandinstead ofor— this is a pre-existing issue, not introduced here.unit_tests/test_stream.py— mechanical update of exception types inpytest.raises()unit_tests/test_multiple_token_authenticator.py— removal of unused importHuman review checklist
MessageRepresentationAirbyteTracedErrorstoAirbyteTracedExceptioninstreams.py:read_recordswon't mask unexpected exceptions (thehasattrguard on_exceptionmitigates this)hasattrguard logic instreams.pyaround line 140 is sufficient for the broader catchUser Impact
No user-facing behavior change. The connector will no longer crash with
ImportErroron CDK >= v7.10.2.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/83cdd5ae8ab140fa9b4c072d44e9163a