Skip to content

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Aug 21, 2025

There were 2 problems with the info about stream template fields in the declarative_component_schema:

  1. The components_values variable was not documented in the interpolation section, which meant it never showed up in the jinja suggestions menu in the Builder UI. This PR adds it so that it shows up in the UI like this:
    Screenshot 2025-08-21 at 2 05 15 PM

  2. The examples for the field_path in components mappings were not really practical. This PR replaces the examples with ones that users might actually want to use.

Summary by CodeRabbit

  • New Features

    • Added a new interpolation variable (components_values) for dynamic stream/component templating, enabling access to resolver-produced record data in templates.
  • Documentation

    • Updated field path examples in the declarative schema to be data-agnostic and context-oriented (e.g., name, retriever.requester.url).
    • Preserved wildcard examples for flexible path matching.
    • Clarified example usage of the new interpolation variable with simple object samples.

@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 21:10
@github-actions github-actions bot added bug Something isn't working security labels Aug 21, 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@lmossman/improve-stream-template-info#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 lmossman/improve-stream-template-info

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
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 documentation and examples for stream template information in the declarative component schema. It updates examples to be more relevant and adds documentation for the components_values variable.

  • Updated examples in the schema to show more realistic stream template usage patterns
  • Added documentation for the components_values interpolation variable with description and examples

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

@lmossman lmossman requested a review from ChristoGrab August 21, 2025 21:15
Copy link
Contributor

coderabbitai bot commented Aug 21, 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

Updated schema examples and interpolation metadata in declarative_component_schema.yaml: field_path examples for DpathExtractor and ComponentMappingDefinition now use top-level/name and retriever/requester paths; added a new interpolation variable components_values (object) with description and example. No runtime logic changes.

Changes

Cohort / File(s) Change Summary
Field path example updates
airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Replaced previous data-centric field_path.examples (e.g., ["data", ...]) with examples like ["name"], ["retriever","requester","url"], and ["retriever","requester","{{ components_values.field }}"]. Preserved wildcard examples (["*", "**", "name"]).
Interpolation variable addition
airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Added interpolation.variables.components_values (type: object) with a description and example showing a component record (e.g., name: "accounts", id: 1234).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User Config
  participant CR as Components Resolver
  participant INT as Interpolation Engine
  participant SG as Stream Generator

  U->>CR: Define components (e.g., name, id)
  CR-->>INT: Provide components_values object
  U->>INT: Templates with field_path (e.g., ["retriever","requester","url"], ["name"])
  INT-->>SG: Resolved values using components_values and context
  SG-->>U: Generated stream(s)
  note over INT,SG: New variable: components_values available during interpolation
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • chandlerprall
  • aldogonzalez8

Would you like me to propose alternate example paths that include nested arrays or HTTP-header-related examples for completeness, wdyt?

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 17bb208 and 1ddac34.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2 hunks)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml
⏰ 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). (8)
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: SDM Docker Image Build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lmossman/improve-stream-template-info

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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

1608-1609: Schema keyword typo breaks JSON Schema validation (additional_properties → additionalProperties).

This field uses additional_properties instead of additionalProperties. JSON Schema won’t recognize it, so this object won’t accept arbitrary params as intended.

Patch?

-      $parameters:
-        type: object
-        additional_properties: true
+      $parameters:
+        type: object
+        additionalProperties: true
🧹 Nitpick comments (5)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (5)

4145-4148: Updated field_path examples improve clarity; consider adding a defensive example using default values.

Nice switch to name/retriever context and showcasing components_values in paths. Would you add one more example that demonstrates a safe default to avoid KeyError during interpolation, e.g. ["retriever", "requester", "{{ components_values.get('field', 'path') }}"] to guide users toward resilient templates, wdyt?


1868-1872: AI summary inconsistent with DpathExtractor examples; do we also want to update these to match the new guidance?

The PR summary mentions replacing data-rooted examples with name/retriever/requester paths for DpathExtractor. This block still shows the old ["data", ...] examples. If the intent is to align extractor examples with the component templating guidance, shall we update to something like:

  • ["name"]
  • ["retriever", "requester", "url"]
  • ["retriever", "requester", "{{ parameters.name }}"]
  • ["*", "**", "name"]
    wdyt?

4683-4684: Minor grammar: duplicate word in config variable description.

There's a small typo: “the the”. Want to fix it?

-      description: The connector configuration. The object's keys are the same as the the keys defined in the connection specification.
+      description: The connector configuration. The object's keys are the same as the keys defined in the connection specification.

4719-4721: Type of last_page_size should be an integer, not object.

The description says “Number of records…”, but type is object. Should we correct it to integer?

-      type: object
+      type: integer

2899-2904: Typos in OAuth interpolation context names (Decorer → Decoder) could confuse readers.

Within the examples, base64Decorer/urlDecorer appear; elsewhere you use Decoder/Decoder. Want to normalize?

-            + base64Decorer - decode from `base64` encoded string, {{ {{my_string_variable_or_string_value}} | base64Decoder }}
+            + base64Decoder - decode from `base64` encoded string, {{ {{my_string_variable_or_string_value}} | base64Decoder }}
-            + urlDecorer - decode the input url-encoded string into text format, {{ urlDecoder:https%3A%2F%2Fairbyte.io | urlDecoder}}
+            + urlDecoder - decode the input url-encoded string into text format, {{ urlDecoder:https%3A%2F%2Fairbyte.io | urlDecoder }}

Also, minor spacing in the second example after the closing braces added for consistency. wdyt?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cd48741 and 17bb208.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml

[error] 4783-4783: trailing spaces

(trailing-spaces)

⏰ 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). (10)
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-shopify
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)

Copy link

PyTest Results (Fast)

3 694 tests  ±0   3 683 ✅ ±0   6m 24s ⏱️ -7s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1ddac34. ± Comparison against base commit cd48741.

Copy link

PyTest Results (Full)

3 697 tests  ±0   3 686 ✅ ±0   9m 36s ⏱️ +2s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1ddac34. ± Comparison against base commit cd48741.

Copy link
Collaborator

@ChristoGrab ChristoGrab left a comment

Choose a reason for hiding this comment

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

Good catch, thanks @lmossman!

@lmossman lmossman merged commit 56ab9b5 into main Aug 25, 2025
26 checks passed
@lmossman lmossman deleted the lmossman/improve-stream-template-info branch August 25, 2025 17:33
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