Skip to content

chore: fix more fields in declarative_component_schema #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

lmossman
Copy link
Contributor

@lmossman lmossman commented Apr 30, 2025

Fixes more titles, descriptions, and ordering of anyOfs in declarative_component_schema to get it closer to what we want for the Builder UI.

Summary by CodeRabbit

  • New Features

    • Added new options to customize HTTP requests with request parameters and headers, supporting both key/value pairs and interpolated strings.
  • Improvements

    • Enhanced schema descriptions for primary key variants and clarified documentation for URL fields and sensitive data handling.
    • Deprecated the legacy session token authentication method.
    • Improved configuration accuracy for parent stream settings.
  • Other Changes

    • Adjusted the order of selectable options in various configuration fields for a more intuitive setup experience.

@lmossman lmossman requested a review from bazarnov May 2, 2025 01:51
@lmossman lmossman marked this pull request as ready for review May 2, 2025 01:51
@Copilot Copilot AI review requested due to automatic review settings May 2, 2025 01:51
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 pull request refines the declarative component schema for improved Builder UI consistency by updating field titles, descriptions, and the ordering of anyOf lists.

  • Reorders and adjusts authentication and requester definitions (e.g. shifting NoAuth and updating references to Authenticator).
  • Updates API endpoint, request, and response field metadata to better align with UI expectations.
  • Removes duplicate definitions and adjusts decoder and retriever references.
Comments suppressed due to low confidence (2)

airbyte_cdk/sources/declarative/declarative_component_schema.yaml:3545

  • The removal of JsonDecoder from the decoders list may result in loss of JSON response decoding support. Please confirm that this removal is intentional.
-          - "$ref": "#/definitions/JsonDecoder"

airbyte_cdk/sources/declarative/declarative_component_schema.yaml:3202

  • The removal of SimpleRetriever from the retriever anyOf list might unintentionally limit retriever functionality. Verify if excluding SimpleRetriever is intended.
+          - "$ref": "#/definitions/CustomRetriever"

@lmossman lmossman changed the title fix more fields in declarative_component_schema chore: fix more fields in declarative_component_schema May 2, 2025
@lmossman
Copy link
Contributor Author

lmossman commented May 2, 2025

@bazarnov do you mind looking this over to check if it can be merged without any other changes? It should just be some more reordering and updating titles/descriptions

Copy link
Contributor

coderabbitai bot commented May 2, 2025

📝 Walkthrough

Walkthrough

This change updates the declarative_component_schema.yaml and corresponding Pydantic models in Airbyte's CDK. It reorders union types and anyOf lists for authenticators, decoders, retrievers, and requesters, primarily moving NoAuth authenticator to the end. It adds detailed descriptions for PrimaryKey variants and marks LegacySessionTokenAuthenticator as deprecated. The HttpRequester component gains two new optional fields, request_parameters and request_headers, with clarified descriptions and examples. Deprecated fields related to request bodies and headers are consolidated. The type of lazy_read_pointer in ParentStreamConfig is corrected. Descriptions for URL-related fields in HttpRequester are updated for clarity.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/declarative_component_schema.yaml - Reordered anyOf lists for authenticators (NoAuth last), decoders (XmlDecoder before CsvDecoder, GzipDecoder after JsonlDecoder), and retrievers.
- Added descriptions to PrimaryKey variants.
- Marked LegacySessionTokenAuthenticator as deprecated.
- Added optional request_parameters and request_headers to HttpRequester.
- Updated descriptions for url_base, url, and path in HttpRequester.
- Corrected lazy_read_pointer item type in ParentStreamConfig.
- Reordered retriever options in HttpComponentsResolver.
airbyte_cdk/sources/declarative/models/declarative_component_schema.py - Reordered union types in fields for authenticators, requesters, extractors, retrievers, and decoders.
- Removed description from DeclarativeStream.primary_key field.
- Updated field descriptions for URL fields in HttpRequester.
- Moved and consolidated deprecated request-related fields into a single request_body field.
- Changed title of SimpleRetriever.decoder to "HTTP Response Format".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeclarativeSchema
    participant HttpRequester
    participant Authenticator

    User->>DeclarativeSchema: Define stream with HttpRequester config
    DeclarativeSchema->>HttpRequester: Pass config including request_headers/parameters
    HttpRequester->>Authenticator: Apply selected authenticator (NoAuth last, deprecated excluded)
    HttpRequester-->>DeclarativeSchema: Return configured request behavior
Loading

Possibly related PRs

Suggested labels

declarative-component-schema

Suggested reviewers

  • lmossman

Would you like me to group similar schema reorderings together more explicitly in the changelog for clarity, or keep each adjustment separate as currently done? 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 d0b175d and 38c9e34.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/models/declarative_component_schema.py (10 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
🔇 Additional comments (8)
airbyte_cdk/sources/declarative/models/declarative_component_schema.py (8)

2084-2085: Reordering authenticators makes sense. Moved NoAuth to the end?

The change reorders the authenticators in the SelectiveAuthenticator class, moving the NoAuth authenticator to the end of the list. This is an improvement in UI context since NoAuth is typically a fallback option, not the first choice. Aligns well with Builder UI presentation.


2106-2117: Looks good - reversed order of union types for FileUploader fields.

You've reversed the order of union types for the requester, download_target_extractor, and file_extractor fields in the FileUploader class. This better matches the schema's reference ordering, which helps with consistency. Wdyt?


2147-2147: Description removed from PrimaryKey field.

You've removed the description from the primary_key field in DeclarativeStream, leaving only the title. This is consistent with added descriptive text for PrimaryKey variants in the schema itself. Nice clean-up!


2243-2244: Improved field descriptions for URL components.

Changed references from "Authentication component" to "Authenticator component" in the descriptions for url_base, url, and path fields. This terminology is more precise and matches the actual component names used elsewhere in the codebase.

Also applies to: 2254-2255, 2267-2268


2304-2322: Added new request customization fields with clear descriptions.

Added two new optional fields to HttpRequester:

  • request_parameters - For query parameters with helpful examples
  • request_headers - For non-auth headers with good examples

These additions provide a cleaner way to customize requests compared to the deprecated separate fields. The detailed examples are particularly useful for the Builder UI.


2383-2383: Updated title for request_body field.

The title for the request_body field has been updated, which helps clarify its purpose in the UI. These small changes to titles and descriptions add up to a more intuitive user experience.


2476-2476: Reordered retriever union types.

You've reversed the order of union types in PropertiesFromEndpoint.retriever from (CustomRetriever, SimpleRetriever) to (SimpleRetriever, CustomRetriever). This matches the schema's reordered anyOf list for HttpComponentsResolver retriever options and places the more commonly used option first.


2528-2531: Reordered decoder options and improved title.

The changes include:

  1. Reordering decoder options in SimpleRetriever.decoder - XmlDecoder before CsvDecoder and moving GzipDecoder after JsonlDecoder
  2. Changing the field title from "Decoder" to "HTTP Response Format"

The new title is much more intuitive from a user perspective, making it clearer what this field actually represents. Good UI improvement!

Also applies to: 2539-2539

✨ 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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

♻️ Duplicate comments (1)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (1)

2005-2026: ⚠️ Potential issue

Add request_parameters for dynamic query parameters
Introducing request_parameters is a powerful way to customize outgoing queries. However, in the examples, the key sort_by[asc]: updated_at includes brackets and should be quoted to avoid YAML parsing errors. wdyt?

-          - sort_by[asc]: updated_at
+          - "sort_by[asc]": updated_at
🧹 Nitpick comments (3)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (3)

1918-1925: Clarify deprecation guidance for url_base
The updated description flags url_base as deprecated and shifts emphasis to url and the Authenticator component for sensitive data. Consider if we want to standardize phrasing across similar deprecated fields (e.g., include a link to migration docs)? wdyt?


1937-1943: Introduce url for HTTPRequester
Great addition of the url field with clear instructions to keep credentials out of it. This replaces url_base/path nicely. wdyt on adding linkable: true here for consistency with other fields?


2027-2044: Introduce request_headers for non-auth headers
The new request_headers property complements request_parameters by letting users define extra HTTP headers. This addition makes header customization explicit—should we add an example showing both object and string interpolation? 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 99327c2 and d0b175d.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (12 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
🔇 Additional comments (8)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (8)

300-305: Reorder NoAuth to end of SelectiveAuthenticator options
The NoAuth option has been moved after SessionTokenAuthenticator and before LegacySessionTokenAuthenticator to align the authenticator list with the Builder UI's expected order—placing “no authentication” at the end. wdyt?


1468-1482: Add support for custom components in FileUploader
You’ve included CustomRequester under requester and CustomRecordExtractor under both download_target_extractor and file_extractor, enabling users to inject custom logic. This looks good—should we consider adding examples to demonstrate usage of a custom implementation? wdyt?


1957-1964: Update deprecation notice for path
The path property is now deprecated in favor of url, matching url_base changes. It maintains consistent messaging and ensures users migrate. wdyt?


1986-2001: Align authenticator options order in HTTPRequester
The NoAuth option has been repositioned after CustomAuthenticator to mirror the SelectiveAuthenticator change and UI ordering. Looks aligned—shall we confirm this order is consistent across the codebase? wdyt?


3099-3105: Fix lazy_read_pointer item type
Changing the lazy_read_pointer items from an array to a string simplifies configuration and matches usage patterns. This looks correct. wdyt?


3157-3170: Enhance PrimaryKey variant descriptions
Adding descriptive text for single key, composite key, and nested composite key variants greatly improves clarity. The new titles and descriptions align with UX guidelines. wdyt?


3542-3550: Refine SimpleRetriever decoder title and ordering
Renaming the property to “HTTP Response Format” and reordering the decoders (XmlDecoder before CsvDecoder, GzipDecoder after JsonlDecoder) enhances discoverability in the UI. Should we verify that the default selection in the Builder still behaves as expected? wdyt?


4001-4005: Review retriever ordering in HttpComponentsResolver
The current order is [AsyncRetriever, CustomRetriever, SimpleRetriever], but the PR summary mentioned moving CustomRetriever after SimpleRetriever. Could you confirm the intended sequence for the UI? wdyt?

Likely an incorrect or invalid review comment.

@github-actions github-actions bot added the chore label May 2, 2025
Copy link
Contributor

@bazarnov bazarnov left a comment

Choose a reason for hiding this comment

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

I've also added the changed auto-gen models to this PR, looks like no changes for existing code base. LGTM.

@lmossman
Copy link
Contributor Author

lmossman commented May 2, 2025

@bazarnov do you think I need to be worried about those source-shopify failing checks, or are those unrelated and I can ignore them and just merge?

@bazarnov
Copy link
Contributor

bazarnov commented May 2, 2025

Merge it! Don't get bothered with it.

@lmossman lmossman merged commit 2f11bfa into main May 2, 2025
26 of 28 checks passed
@lmossman lmossman deleted the lmossman/fix-more-declarative_component_schema-things branch May 2, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants