fix(cdk): require shared staging for file transfer#1029
Draft
devin-ai-integration[bot] wants to merge 3 commits into
Draft
fix(cdk): require shared staging for file transfer#1029devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 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/1779128158-fix-file-transfer-staging-dir#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/1779128158-fix-file-transfer-staging-dirPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: bot_apk <apk@cognition.ai>
| # Copyright (c) 2026 Airbyte, Inc., all rights reserved. | ||
| # | ||
|
|
||
| import pytest |
Contributor
Author
There was a problem hiding this comment.
Co-Authored-By: bot_apk <apk@cognition.ai>
|
/test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves https://github.com/airbytehq/oncall/issues/12635:
This fixes file-transfer sources emitting local
/tmp/airbyte-file-transferfile references when the shared staging directory is unavailable. File-transfer code paths now requireAIRBYTE_STAGING_DIRECTORYor the default/staging/filesdirectory to exist and raise anAirbyteTracedExceptionsystem error instead of silently falling back to a source-local path; non-file-transfer local usage keeps the existing/tmp/airbyte-file-transferfallback.The PR also updates CDK standard-test connector instantiation so legacy file-based sources that require
(catalog, config, state)constructor arguments can still run generated standard tests. That addresses the source-google-drive standard-test failure surfaced by this CDK branch, where the test harness previously instantiated the connector with zero arguments.The change is not breaking per the connector/CDK checklist because it does not change stream schemas, specs/configs, streams, primary keys, cursors, or state format. It is a patch bug fix, with a changelog entry added for CDK 6.5.3.
Review & Testing Checklist for Human
/staging/filesfor file-transfer source and destination containers in production jobs.AIRBYTE_STAGING_DIRECTORY; those should now set the env var to an existing local staging directory./tmp/airbyte-file-transfer/...reference and confirm it either uses/staging/files/...or fails early with the new traced exception if the mount is absent.Notes
Declarative-First Evaluation: This is a Python CDK core file-transfer path fix, not a declarative connector behavior change. Declarative alternatives such as filters, transformations, paginators, stream slicing, or
$refoverrides cannot enforce the shared staging-directory invariant before emitting file references.Test Coverage: Added targeted unit tests for configured, missing, invalid, and file-transfer staging-directory behavior; added a file-transfer constructor regression test; updated existing declarative file-uploader tests to use an explicit staging directory; added standard-test coverage for legacy file-based connector instantiation.
Local validation:
poetry run pytest unit_tests/ -x -qpoetry run pytest unit_tests/test/test_standard_tests.py -qpoetry run ruff check .poetry run ruff format --check .poetry run mypy --config-file mypy.ini airbyte_cdkDevin session