Repository navigation
fix(cloud): return actionable errors when creating a connection fails - #1347
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791477590-create-connection-errors' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791477590-create-connection-errors'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
…/1791477590-create-connection-errors
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex (@codex) review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback". |
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit 4f699d6 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit 4f699d6 in the Show a line coverage summary of the most covered files.
Updated |
Aldo Gonzalez (aldogonzalez8)
left a comment
There was a problem hiding this comment.
APPROVED
left annoying comment
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
29ba033
into
release-candidate/v1
TL;DR
create_connection_on_cloud/CloudWorkspace.deploy_connectionnow return readable PyAirbyte errors instead of a rawSDKErrorwhen a create fails. A bad stream name keeps the API's own message. A bad or swappedsource_id/destination_idis caught before the create, and the error names the argument. No other tool changes.Summary
Resolves AGENTIC-2336.
When a create fails,
create_connection_on_cloud(andCloudWorkspace.deploy_connectionunderneath it) leaked a rawairbyte_apiSDKError. The cause:api_util.create_connectionwas one of the few API wrappers withoutexcept SDKError. Agents gotAPI error occurred: Status 400plus a JSON blob, or a bare 403Forbidden, and neither said which argument was wrong.api_util.create_connectionA 400 goes to
AirbyteLibInputErroron purpose. Plain_wrap_sdk_errorwould turn it intoAirbyteCloudError("API error occurred: API error occurred")and drop the response body, which holds the useful line ("No streams found with name [...]")._wrap_sdk_erroritself is unchanged.create_connection_on_cloudapi_util.get_source/get_destination. A not-found result is re-raised asAirbyteMissingResourceErrornaming`source_id`or`destination_id`.selected_streamswas omitted, and the destination never was. A bad or swapped ID with explicit streams therefore reached the create call and leaked a raw 403._get_suggested_streams_for_sourcenow takes the already-fetchedCloudSource, so the source isn't fetched twice.No other tool and no shared error handling changes. Library callers of
deploy_connectionnow get PyAirbyte error types instead ofSDKErrorwhen a create fails.Agent-visible text after the change, from the live sandbox:
No streams found with name [no_such_stream_xyz] and namespace [null]. Please call the .../getstreamproperties endpoint ... Check that every name inselected_streamsis a stream of the source, and thatsource_idanddestination_idare correct.`destination_id` '<id>' was not found in workspace '<ws>', or these credentials can't access it. Airbyte Cloud returns 403 both for IDs that don't exist and for resources outside your access. ...Note: #1148 (replacing the Speakeasy SDK) touches the same
SDKErrorhandling. If it lands first, this needs rebasing.Testing
uv run poe checkandruff format --checkpass.tests/unit_tests/test_cloud_api_util.pyandtests/unit_tests/test_mcp_cloud.py: 243 passed. New tests cover 400 with the API body, 400 with a non-JSON body, 403/500 wrapping, and an unknown source or destination naming the argument.source_idall return the new text. A valid create still succeeded; the throwaway connection was deleted afterwards.Link to Devin session: https://app.devin.ai/sessions/6e92865abf9b4b638db4447c362787d6
Open in Devin Desktop: https://app.devin.ai/desktop/session/6e92865abf9b4b638db4447c362787d6?variant=devin
Requested by: Caleb Evans (@calebevans-ab)
Important
Auto-merge enabled.
This PR is set to merge automatically when all requirements are met.