Skip to content

feat: remove 1-or-more stream validation #496

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
merged 2 commits into from
Apr 24, 2025

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Apr 18, 2025

Removes the requirement that at least one stream must exist for the manifest to be valid; this supports https://github.com/airbytehq/airbyte-internal-issues/issues/12079, and the ability to test OAuth from the builder without defining a stream

Summary by CodeRabbit

  • Refactor
    • Removed the explicit validation requiring at least one stream in the manifest configuration.

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 removes the requirement for at least one stream (or dynamic stream) to be defined in the manifest, allowing for OAuth testing scenarios without a predefined stream. Key changes include:

  • Removal of the check that raised a ValidationError if no streams are provided.
  • Adjustment of the manifest validation process to rely solely on the JSON schema validation.
Comments suppressed due to low confidence (1)

airbyte_cdk/sources/declarative/manifest_declarative_source.py:285

  • Ensure that the removal of the stream validation check is backed by tests verifying that manifests with no streams are handled as expected.
if not (streams or dynamic_streams):

@github-actions github-actions bot added the enhancement New feature or request label Apr 18, 2025
Copy link
Contributor

coderabbitai bot commented Apr 18, 2025

📝 Walkthrough

Walkthrough

The update removes a validation step from the _validate_source method in the manifest declarative source module. Specifically, it no longer checks for the presence of at least one stream by verifying the existence of the "streams" or "dynamic_streams" keys in the manifest. All other validation logic, including schema validation and version compatibility checks, remains unchanged. Correspondingly, the unit test that verified this validation was also removed.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/manifest_declarative_source.py Removed the explicit check for at least one stream or dynamic stream in the manifest during source validation.
unit_tests/sources/declarative/test_manifest_declarative_source.py Removed the test method that ensured a ValidationError was raised when no streams were present in the manifest.

Possibly related PRs

Would you like me to help draft a note linking these PRs for easier tracking, 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 97d020b and 5308241.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/manifest_declarative_source.py (0 hunks)
  • unit_tests/sources/declarative/test_manifest_declarative_source.py (0 hunks)
💤 Files with no reviewable changes (2)
  • unit_tests/sources/declarative/test_manifest_declarative_source.py
  • airbyte_cdk/sources/declarative/manifest_declarative_source.py
⏰ 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: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
  • GitHub Check: SDM Docker Image Build
✨ 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.

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.

@chandlerprall chandlerprall force-pushed the chandler/no-stream-check branch from 97d020b to 5308241 Compare April 24, 2025 15:37
@chandlerprall chandlerprall merged commit d69dff3 into main Apr 24, 2025
28 checks passed
@chandlerprall chandlerprall deleted the chandler/no-stream-check branch April 24, 2025 17:35
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.

2 participants