Skip to content

fix(manifest-server): return 400 for disallowed custom code#1020

Draft
Ilja Herdt (Airbyte) (iherdt-airbyte) wants to merge 1 commit into
mainfrom
devin/1778536209-builder-custom-code-error
Draft

fix(manifest-server): return 400 for disallowed custom code#1020
Ilja Herdt (Airbyte) (iherdt-airbyte) wants to merge 1 commit into
mainfrom
devin/1778536209-builder-custom-code-error

Conversation

@iherdt-airbyte
Copy link
Copy Markdown

Summary

This updates the manifest-server test_read source-build path to convert AirbyteCustomCodeNotPermittedError into a client-facing 400 response instead of letting it escape as a generic 500. This should make Cloud Connector Builder show the custom-code permission issue instead of an unknown error.

Review & Testing Checklist for Human

  • Verify the Connector Builder UI displays the returned 400 detail clearly for manifests with custom components in workspaces where custom code execution is disabled.
  • Confirm this does not change behavior for environments that allow custom code execution.
  • Confirm the 400 response text is acceptable for user-facing Cloud Builder errors.

Notes

Local checks run:

  • poetry --directory /home/ubuntu/repos/airbyte-python-cdk run pytest /home/ubuntu/repos/airbyte-python-cdk/unit_tests/manifest_server/routers/test_manifest.py -q
  • poetry --directory /home/ubuntu/repos/airbyte-python-cdk run ruff check /home/ubuntu/repos/airbyte-python-cdk/airbyte_cdk/manifest_server/routers/manifest.py /home/ubuntu/repos/airbyte-python-cdk/unit_tests/manifest_server/routers/test_manifest.py
  • poetry --directory /home/ubuntu/repos/airbyte-python-cdk run ruff format --check /home/ubuntu/repos/airbyte-python-cdk/airbyte_cdk/manifest_server/routers/manifest.py /home/ubuntu/repos/airbyte-python-cdk/unit_tests/manifest_server/routers/test_manifest.py

mypy on the changed router was attempted but blocked by missing third-party stubs for existing imports (jsonschema, airbyte_protocol_dataclasses.models) in this local environment.

Link to Devin session: https://app.devin.ai/sessions/9a396e45928647fe9673dc21e7846c71
Requested by: Ilja Herdt (Airbyte) (@iherdt-airbyte)

@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

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@devin/1778536209-builder-custom-code-error#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/1778536209-builder-custom-code-error

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
  • /prerelease - Triggers a prerelease publish with default arguments
  • /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
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link
Copy Markdown

PyTest Results (Fast)

4 060 tests  +1   4 049 ✅ +1   7m 58s ⏱️ +13s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 8d165cb. ± Comparison against base commit d3d1346.

@github-actions
Copy link
Copy Markdown

PyTest Results (Full)

4 063 tests  +1   4 051 ✅ +1   11m 3s ⏱️ +7s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 8d165cb. ± Comparison against base commit d3d1346.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant