Skip to content

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Jul 16, 2025

interpolation_context was missing from multiple auth fields that commonly need to access the config interpolation variable.

This is a problem for the Builder UI, as interpolation_context is how the Builder UI knows whether it should render the JinjaInput component for a field, which offers suggestions and formatting for jinja expressions.

This PR fixes the issue by adding this property to the fields that were missing it.

Summary by CodeRabbit

  • Documentation
    • Clarified that several authentication fields now explicitly support dynamic value interpolation using connector configuration. This applies to secret key fields in JWT authentication and client credentials in OAuth authentication.
    • Corrected example syntax for OAuth client ID and client secret fields to improve clarity.

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/add-interpolation-context-to-auth-fields#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/add-interpolation-context-to-auth-fields

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.

@lmossman lmossman changed the title add interpolation_context to auth fields fix: add interpolation_context to auth fields Jul 16, 2025
@lmossman lmossman marked this pull request as ready for review July 16, 2025 23:12
@lmossman lmossman requested review from Copilot and ChristoGrab July 16, 2025 23:12
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 fixes missing interpolation_context properties in authentication field definitions within the declarative component schema. The change enables the Builder UI to properly render JinjaInput components for these fields, which provide suggestions and formatting for Jinja expressions that reference configuration variables.

Key Changes

  • Added interpolation_context: [config] to JWT authentication secret key field
  • Added interpolation_context: [config] to OAuth2 client ID, client secret, refresh token, and access token fields

Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

Walkthrough

The declarative component schema YAML file was updated to add an interpolation_context: ["config"] key to several authentication-related string properties, clarifying that these fields support value interpolation using the connector configuration. Additionally, example strings in the OAuthAuthenticator model for client_id and client_secret were corrected to properly close the interpolation syntax. No other schema or functional changes were made.

Changes

File Change Summary
airbyte_cdk/sources/declarative/declarative_component_schema.yaml Added interpolation_context: ["config"] to secret_key (JwtAuthenticator), and client_id, client_secret, refresh_token, access_token_value (OAuthAuthenticator) properties
airbyte_cdk/sources/declarative/models/declarative_component_schema.py Fixed example strings for client_id and client_secret in OAuthAuthenticator to properly close interpolation braces and reformatted examples for clarity

Suggested labels

bug

Suggested reviewers

  • lmossman
  • chandlerprall

Would you like to highlight these schema clarifications and example fixes in the changelog for connector developers, wdyt?

Possibly related PRs


📜 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 d17c024 and e264808.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (5 hunks)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (2 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). (4)
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
✨ Finishing Touches
  • 📝 Generate Docstrings

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 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.

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: 0

🧹 Nitpick comments (1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

1224-1285: Consistent update across OAuth fields – consider adding the same for token_refresh_endpoint?

client_id, client_secret, refresh_token, and access_token_value now advertise ["config"] as their interpolation context – this aligns them with other auth components 💯.
For full parity, users sometimes template the token_refresh_endpoint itself (e.g., multi-tenant hosts). Would adding an interpolation_context there make sense too, or is that intentionally static? wdyt?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ff16dbf and d17c024.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the `declarative_component_schema.py` file is auto-generated from `declarative_component_schema.yaml` and should be ignored in the recommended reviewing order.
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (3)

undefined

<retrieved_learning>
Learnt from: pnilan
PR: airbytehq/airbyte-python-cdk#0
File: :0-0
Timestamp: 2024-12-11T16:34:46.319Z
Learning: In the airbytehq/airbyte-python-cdk repository, the declarative_component_schema.py file is auto-generated from declarative_component_schema.yaml and should be ignored in the recommended reviewing order.
</retrieved_learning>

<retrieved_learning>
Learnt from: ChristoGrab
PR: #58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the YamlDeclarativeSource class in airbyte_cdk/sources/declarative/yaml_declarative_source.py, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
</retrieved_learning>

<retrieved_learning>
Learnt from: aaronsteers
PR: #58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in airbyte_cdk/cli/source_declarative_manifest/, including _run.py, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
</retrieved_learning>

⏰ 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). (5)
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
🔇 Additional comments (1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

1088-1102: 👍 Interpolation context for secret_key looks correct – did we remember to regenerate the autogen .py schema afterwards?

Adding interpolation_context: ["config"] will unlock the JinjaInput in Builder – nice.
Because declarative_component_schema.py is generated from this YAML, a quick follow-up check that the file was (or will be) re-generated keeps tooling in sync, wdyt?

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

PyTest Results (Fast)

3 695 tests  ±0   3 684 ✅ ±0   6m 18s ⏱️ ±0s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit e264808. ± Comparison against base commit ff16dbf.

Copy link

PyTest Results (Full)

3 698 tests   3 687 ✅  17m 58s ⏱️
    1 suites     11 💤
    1 files        0 ❌

Results for commit e264808.

Copy link
Contributor Author

lmossman commented Jul 17, 2025

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.

Nice catch @lmossman!

@lmossman lmossman merged commit 312f2e1 into main Jul 17, 2025
26 checks passed
@lmossman lmossman deleted the lmossman/add-interpolation-context-to-auth-fields branch July 17, 2025 21:27
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