Skip to content

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Jul 30, 2025

feat(cdk): improve connector builder field descriptions and examples

Summary

This PR enhances the Field() annotations in the CDK's Pydantic models to improve helper tooltips in the Connector Builder UI. The changes focus on making field descriptions more user-friendly and adding realistic examples with proper interpolation syntax.

Key improvements:

  • Authentication components: Enhanced descriptions and examples for ApiKeyAuthenticator, BearerAuthenticator, BasicHttpAuthenticator, etc.
  • Pagination strategies: Improved guidance for CursorPagination, OffsetIncrement, and PageIncrement with clearer use-case explanations
  • Incremental sync: Better examples and descriptions for DatetimeBasedCursor fields like start_datetime, cursor_field, step, etc.
  • Record processing: Enhanced descriptions for RecordSelector, DpathExtractor, and validation components
  • Stream configuration: Improved examples and descriptions for stream naming and configuration

The changes are designed to flow through to the Connector Builder UI via the schema-driven form generation, where manifestHelpers.tsx extracts descriptions and examples from the regenerated declarative_component_schema.yaml.

Review & Testing Checklist for Human

  • Test Connector Builder UI: Verify that improved tooltips appear correctly in the actual Connector Builder interface and are helpful to users
  • Validate example accuracy: Review that the new examples follow realistic API patterns and use correct interpolation syntax (e.g., {{ config['field'] }}, {{ response.next_page }})
  • Check description clarity: Ensure descriptions are user-friendly, not overly technical, and provide actionable guidance for when/how to use each field
  • Verify schema regeneration: Confirm that the YAML schema was properly regenerated and contains all the improvements from the Pydantic model changes
  • Test interpolation examples: Validate that the interpolation patterns used in examples are valid and follow CDK conventions

Recommended test plan: Open Connector Builder UI, create a new connector, and navigate through authentication, pagination, and incremental sync configurations to verify the improved helper text appears and is useful.


Diagram

%%{ init : { "theme" : "default" }}%%
graph TB
    PydanticModels["airbyte_cdk/sources/declarative/models/<br/>declarative_component_schema.py"]:::major-edit
    YAMLSchema["airbyte_cdk/sources/declarative/<br/>declarative_component_schema.yaml"]:::minor-edit
    ManifestHelpers["airbyte-platform-internal/oss/airbyte-webapp/<br/>src/components/connectorBuilder__deprecated/<br/>Builder/manifestHelpers.tsx"]:::context
    ConnectorBuilderUI["Connector Builder UI<br/>(Tooltips & Helper Text)"]:::context
    
    PydanticModels -->|"poetry run poe build<br/>auto-generates"| YAMLSchema
    YAMLSchema -->|"getLabelAndTooltip()<br/>extracts metadata"| ManifestHelpers
    ManifestHelpers -->|"renders tooltips"| ConnectorBuilderUI
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit  
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

  • This addresses user feedback about inconsistent and lacking field helpers in the Connector Builder UI
  • Changes are strictly limited to Field() annotations as requested - no other code modifications
  • The improvements focus on commonly used components that users interact with most frequently
  • All changes maintain backward compatibility since they only enhance documentation, not functionality

Link to Devin run: https://app.devin.ai/sessions/1a4ee9eab5204c3e94d7535f32791295
Requested by: @aaronsteers

Summary by CodeRabbit

  • Chores
    • Removed copyright header from documentation.

- Enhanced Field() annotations for authentication components (ApiKeyAuthenticator, BearerAuthenticator, etc.)
- Improved pagination strategy descriptions and examples (CursorPagination, OffsetIncrement, PageIncrement)
- Added better examples and descriptions for incremental sync components (DatetimeBasedCursor)
- Enhanced record processing component descriptions (RecordSelector, DpathExtractor, validators)
- Improved stream configuration field descriptions and examples
- Added realistic examples with interpolation syntax for better user guidance
- Regenerated declarative_component_schema.yaml from updated Pydantic models

These improvements enhance the Connector Builder UI helper tooltips to provide
more user-friendly guidance and examples for configuring connectors.

Co-Authored-By: AJ Steers <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 20:32
Copy link
Contributor

Original prompt from AJ Steers
SYSTEM:
=== BEGIN THREAD HISTORY (in #product-team) ===
Axel Amar (U0926U2QFFG): Hi Team,

I have been playing with the Connector builder to fork an existing connector (GMAIL) and thought I would share some feedback on things that could be improved_:_ 

• *Collapsing:* A stream setup can be very long and being able to collapse all the sections would be helpful. Today, you can only collapse `Advanced settings` or inactive/toggled-off sections. Would be great to be able to collapse even active sections. Example: Authentication, I am copying streams with the same/shared authentication, once set up I can just keep it collapsed and forget about it rather than continuing scrolling past it. 
• *Helpers:* the little 'i' icons for each fields are very helpful but not always at a consistent levels of usefulness. Notably, examples with the expected values aren't available for each field. A link to the documentation for each field would also be helpful 
• *Connector payload/data:* We create quite a few objects in the connector from config data, primary keys etc.. would be great to have access to a list of all these objects and value to help with debugging. Example: I am setting up a Composite Nested key for one of my stream but I have no idea if it was captured properly, or how I should  reference it in child-streams
• *AI (*ping <@U05AKF1BCC9> heard you re working on it)*:* I am using the Gmail API forked from an existing connector so not a good use case for the AI builder. However, there is definitely room to leverage AI here. I had many specific questions regarding either the google API or mostly about the airbyte connector builder itself. I ended up copy/pasting JSON responses or UI screenshots to chatgpt to help me configure the connector builder. Would be great to have an interface/chat bar to ask questions directly in the builder where the request/response/YAML/settings would be passed as context automatically. Google did that pretty well in their Python notebooks where they embedded Gemini on the side bar to ask questions
Happy to chat with anyone to give more details, or if anyone wants to help me debug that connector :slightly_smiling_face:

<https://files.slack.com/files-pri/T02TET08MDH-F098MMRMPSM/image.png>

AJ Steers (U05AKF1BCC9): Thanks for sharing this and for tagging me in the ai component. I agree that a sidebar for LLM chat would be super helpful. We're planning (tentatively) to pick this up later in the year after MCP tools are in place.

AJ Steers (U05AKF1BCC9): <@U0926U2QFFG> - regarding "Helpers" above, these tips are driven by our JSON schema file, and upstream by the "description" and "examples" fields in the pydantic models that live in the Python CDK. I can ask Devin to add examples where they are missing and more helpful guidance where it is currently least helpful. Can you please provide specific cases that you found lacking? I'll have Devin take a pass generally, and I'll make sure it specifically covers anything that you call out specifically.

AJ Steers (U05AKF1BCC9): @Devin - using the context above, see if you can address the "Helpers" feedback. I'll provide more specifics and feedback after your first pass.

AJ Steers (U05AKF1BCC9): @Devin - using the context above, see if you can address the "Helpers" feedback. I'll provide more specifics and feedback after your first pass.
=== END THREAD HISTORY ===

The latest message is the one right above that tagged you.

Copy link
Contributor

devin-ai-integration bot commented Jul 30, 2025

🤖 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 github-actions bot added the enhancement New feature or request label Jul 30, 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@devin/1753906835-improve-connector-builder-helpers#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/1753906835-improve-connector-builder-helpers

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 <command> - Runs any poe command in the CDK environment

📝 Edit this welcome message.

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 improves the Field() annotations in the CDK's Pydantic models to enhance helper tooltips in the Connector Builder UI. The changes focus on making field descriptions more user-friendly and adding realistic examples with proper interpolation syntax.

  • Enhanced field descriptions and examples for authentication, pagination, and incremental sync components
  • Improved code formatting and readability by properly formatting multi-line Field() declarations
  • Updated examples to use realistic API patterns with correct interpolation syntax

type: Literal["DeclarativeStream"]
name: Optional[str] = Field("", description="The stream name.", example=["Users"], title="Name")
name: Optional[str] = Field(
"", description="The stream name.", example=["Users"], title="Name"
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The example for stream name should be a string, not a list. Stream names are strings like "Users", not arrays. Change example=["Users"] to example="Users".

Suggested change
"", description="The stream name.", example=["Users"], title="Name"
"", description="The stream name.", example="Users", title="Name"

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot - I don't think that is correct. Confirm if you can view the docs, but despite the weird making, I think this aligns with "examples" in the JSON schema spec, which can be an array.

type: Literal["StateDelegatingStream"]
name: str = Field(..., description="The stream name.", example=["Users"], title="Name")
name: str = Field(
..., description="The stream name.", example=["Users"], title="Name"
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

The example for stream name should be a string, not a list. Stream names are strings like "Users", not arrays. Change example=["Users"] to example="Users".

Suggested change
..., description="The stream name.", example=["Users"], title="Name"
..., description="The stream name.", example="Users", title="Name"

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto my comment above. I don't know if that's correct.

Copy link
Contributor

coderabbitai bot commented Jul 30, 2025

📝 Walkthrough

Walkthrough

This change removes the copyright header from the declarative_component_schema.py file. No other modifications were made to the code or its logic.

Changes

Cohort / File(s) Change Summary
Header Removal
airbyte_cdk/sources/declarative/models/declarative_component_schema.py
Removed copyright header line from file

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • lmossman

Would you like to standardize header removal across similar files as well, or is this a one-off change for now—wdyt?


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4cbaaf and e69647e.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (0 hunks)
💤 Files with no reviewable changes (1)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1753906835-improve-connector-builder-helpers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@aaronsteers aaronsteers marked this pull request as draft July 30, 2025 20:37
Copy link

github-actions bot commented Jul 30, 2025

PyTest Results (Fast)

3 689 tests  ±0   3 678 ✅ ±0   6m 25s ⏱️ -9s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1f64c8f. ± Comparison against base commit e4cbaaf.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 30, 2025

PyTest Results (Full)

3 692 tests  ±0   3 681 ✅ ±0   11m 38s ⏱️ -7s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1f64c8f. ± Comparison against base commit e4cbaaf.

♻️ This comment has been updated with latest results.

devin-ai-integration bot and others added 3 commits July 30, 2025 20:51
…criptions

- Add GraphQL query examples for RequestBodyGraphQlQuery with realistic syntax
- Enhance CustomIncrementalSync cursor_field with examples and better description
- Improve stream name descriptions with user guidance and consistency tips
- Add comprehensive examples for request body value fields (PlainText, UrlEncodedForm, JsonObject)
- Enhance pagination strategy descriptions and examples for CursorPagination, OffsetIncrement, PageIncrement
- Improve ApiKeyAuthenticator descriptions with more context about configuration references
- Focus on complex components where user input is not obvious
- All examples include realistic interpolation syntax like {{ config['field_name'] }}

Co-Authored-By: AJ Steers <[email protected]>
- Add GraphQL query examples for RequestBodyGraphQlQuery
- Enhance CustomIncrementalSync cursor_field with examples and title
- Fix stream name example format (string instead of array)
- Improve CursorPagination descriptions and add varied examples
- Enhance ApiKeyAuthenticator with more header examples and better descriptions
- Add realistic interpolation examples using {{ config['field'] }} syntax
- Focus on complex components where user input is not obvious

Co-Authored-By: AJ Steers <[email protected]>
@aaronsteers
Copy link
Contributor Author

aaronsteers commented Jul 30, 2025

/poe build

Running poe build...

Link to job logs.

❌ Poe command build failed. Please inspect the logs.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant