Skip to content

Conversation

ChristoGrab
Copy link
Collaborator

@ChristoGrab ChristoGrab commented Sep 25, 2025

What

Resolves: https://github.com/airbytehq/airbyte-internal-issues/issues/14540

Loom Demo: https://www.loom.com/share/3f063d020c774861ab0c40a10c429b11

Adds basic try/catch error handling to the manifest-server calls to ensure errors during connector builder calls are surfaced in the builder UI.

Currently, customers are experiencing issues with errors during test reads being swallowed and thrown as generic 500-level errors.

493026242-585d16bd-1521-46de-837a-84e193c0a2b5

How to Test

For quick backend tests, use Postman against a locally deployed instance of the manifest-server. This was the test manifest I used in the request body to replicate the error encountered in the Swarm ticket.

On main, this will cause an unhandled exception to throw the 500 server error.

Screenshot 2025-09-25 at 2 49 42 PM

With the changes, the actual error is caught and the message displayed in the details.

Screenshot 2025-09-25 at 2 48 52 PM

To Test in Platform

Steps to run manifest-server locally and connect to local OSS Airbyte instance:

https://gist.github.com/ChristoGrab/1abaaacc0d1879d8642c946336feb5a9

Summary by CodeRabbit

  • New Features
    • Standardized error responses across manifest endpoints with a clear “detail” message for HTTP 400 cases.
  • Bug Fixes
    • Prevented unhandled exceptions by converting failures into consistent HTTP 400 responses, improving reliability and clarity.
  • Documentation
    • OpenAPI updated to v0.2.0, documenting new 400 responses and the ErrorResponse schema.
  • Chores
    • Application version bumped to 0.2.0.

@github-actions github-actions bot added bug Something isn't working security labels Sep 25, 2025
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This CDK Version

You 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@christo/manifest-server-errors#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 christo/manifest-server-errors

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment

📝 Edit this welcome message.

Copy link

github-actions bot commented Sep 25, 2025

PyTest Results (Fast)

3 786 tests  +5   3 774 ✅ +5   6m 25s ⏱️ -4s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit da7976d. ± Comparison against base commit b28c6e3.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 25, 2025

PyTest Results (Full)

3 789 tests  +5   3 777 ✅ +5   11m 16s ⏱️ +13s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit da7976d. ± Comparison against base commit b28c6e3.

♻️ This comment has been updated with latest results.

@ChristoGrab
Copy link
Collaborator Author

ChristoGrab commented Sep 25, 2025

/autofix

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.

Note: This job can only be run by maintainers. On PRs from forks, this command requires
that the PR author has enabled the Allow edits from maintainers option.

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

@ChristoGrab ChristoGrab marked this pull request as ready for review September 25, 2025 21:30
@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 21:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds basic error handling to the manifest-server calls to improve error reporting in the connector builder UI. Previously, errors during operations like test reads were being swallowed and returned as generic 500-level errors, making debugging difficult for customers.

Key Changes

  • Added try/catch blocks around all manifest-server endpoint operations (test_read, check, discover, resolve, full_resolve)
  • Standardized error responses to return HTTP 400 with descriptive error messages using AirbyteTracedException
  • Added comprehensive test coverage for error handling scenarios

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
airbyte_cdk/manifest_server/routers/manifest.py Added error handling try/catch blocks to all endpoints with descriptive error messages
airbyte_cdk/manifest_server/api_models/manifest.py Added ErrorResponse model for standardized error responses
airbyte_cdk/manifest_server/api_models/init.py Exported the new ErrorResponse model
airbyte_cdk/manifest_server/openapi.yaml Updated OpenAPI spec to include 400 error responses and version bump
airbyte_cdk/manifest_server/app.py Updated application version to 0.2.0
unit_tests/manifest_server/routers/test_manifest.py Added comprehensive test coverage for error handling scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@airbytehq airbytehq deleted a comment from coderabbitai bot Sep 25, 2025
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Introduces a standardized ErrorResponse model, updates FastAPI/OpenAPI versions to 0.2.0, adds 400 Bad Request responses across manifest endpoints, and implements centralized try/except error handling in routers to convert exceptions into structured 400 responses. Adds unit tests validating error translation for each endpoint.

Changes

Cohort / File(s) Summary
API models
airbyte_cdk/manifest_server/api_models/__init__.py, airbyte_cdk/manifest_server/api_models/manifest.py
Added ErrorResponse model (detail: str) and exported it via all.
Router error handling
airbyte_cdk/manifest_server/routers/manifest.py
Wrapped endpoint logic (test_read, check, discover, resolve, full_resolve) in try/except, converting exceptions to HTTP 400 with structured ErrorResponse; annotated 400 responses.
OpenAPI spec
airbyte_cdk/manifest_server/openapi.yaml
Bumped version to 0.2.0; added ErrorResponse schema; added 400 responses referencing ErrorResponse across manifest endpoints.
App version
airbyte_cdk/manifest_server/app.py
Updated FastAPI app version from 0.1.0 to 0.2.0.
Unit tests
unit_tests/manifest_server/routers/test_manifest.py
Added tests that mock failures to assert 400 responses with ErrorResponse.detail for all endpoints.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor C as Client
  participant A as FastAPI Router
  participant P as ManifestCommandProcessor / build_source
  participant E as ErrorResponse

  C->>A: POST /v1/manifest/* (payload)
  rect rgb(240,245,255)
    note right of A: Try core operation
    A->>P: Execute command/build
    P-->>A: Result or Exception
  end

  alt Success
    A-->>C: 200 OK (normal payload)
  else Exception raised
    A->>A: Convert to AirbyteTracedException
    A->>E: Build { detail: "...error..." }
    A-->>C: 400 Bad Request (ErrorResponse)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • aaronsteers

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the primary change of adding basic error handling to manifest-server calls, making it clear and specific to the main purpose of the pull request without extraneous details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch christo/manifest-server-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@girarda
Copy link
Contributor

girarda commented Oct 9, 2025

Hi team, can we get a code review so we can ship this? This is preventing us from iterating on builder projects because errors are not exposed to the user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants