Skip to content

Conversation

@aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Nov 12, 2025

feat: Add InstallType.ANY and InstallType.INSTALLABLE enum values

Summary

This PR adds two new enum values to InstallType to make the codebase more maintainable and future-proof:

  • InstallType.ANY - Returns all connectors regardless of install type
  • InstallType.INSTALLABLE - Returns all installable connectors (equivalent to what DOCKER currently does, but with clearer semantics)

The PR also replaces uses of InstallType.DOCKER with InstallType.INSTALLABLE in get_connector_api_docs_urls() and get_connector_version_history() where we were using it to mean "all connectors" rather than specifically Docker connectors.

Key changes:

  1. Added InstallType.ANY and InstallType.INSTALLABLE to the enum
  2. Updated get_available_connectors() to handle the new enum values by consolidating DOCKER, ANY, and INSTALLABLE into a single check (also fixes PLR0911 lint error about too many return statements)
  3. Replaced InstallType.DOCKER with InstallType.INSTALLABLE in two functions where we wanted "all connectors" semantics

No behavior changes - all three enum values (DOCKER, ANY, INSTALLABLE) return the same set of connectors (635 total). This is purely a refactoring to improve code clarity and maintainability.

Review & Testing Checklist for Human

  • Verify semantic clarity: Confirm the distinction between ANY, INSTALLABLE, and DOCKER is clear and matches the intended use cases. Currently all three return identical results - is this the desired behavior?
  • Check backward compatibility: Verify that existing code using InstallType.DOCKER still works correctly and that the replacement with INSTALLABLE in the two functions is appropriate
  • Test the new enum values: Run get_available_connectors(InstallType.ANY) and get_available_connectors(InstallType.INSTALLABLE) to verify they return the expected connector lists
  • Consider documentation: Should we add docstrings to the new enum values explaining when to use each one?

Test Plan

from airbyte.registry import get_available_connectors, InstallType

# Verify all three return the same connectors
installable = get_available_connectors(InstallType.INSTALLABLE)
any_type = get_available_connectors(InstallType.ANY)
docker = get_available_connectors(InstallType.DOCKER)
assert installable == any_type == docker

# Verify the functions using INSTALLABLE still work
from airbyte.registry import get_connector_api_docs_urls, get_connector_version_history
docs = get_connector_api_docs_urls("source-faker")
versions = get_connector_version_history("source-faker")

Notes

Summary by CodeRabbit

  • New Features

    • Added two new installation type options to enable an "any" listing mode and an "installable" mode for more flexible connector selection.
  • Bug Fixes / Improvements

    • Connector listings, validation, and version history now account for the new installation modes and more accurately reflect availability when runtime components (e.g., Docker) are present or absent.

- Add InstallType.ANY and InstallType.INSTALLABLE to the InstallType enum
- Update get_available_connectors() to handle new enum values
- Replace InstallType.DOCKER with InstallType.INSTALLABLE in get_connector_api_docs_urls() and get_connector_version_history()
- Consolidate DOCKER, ANY, and INSTALLABLE handling to reduce return statements (fixes PLR0911 lint error)
- No behavior changes, just making code more maintainable and future-proof

Co-Authored-By: AJ Steers <[email protected]>
@devin-ai-integration
Copy link
Contributor

Original prompt from AJ Steers
Received message in Slack channel #ask-devin-ai:

@Devin - In the PyAirbyte MCP server we need to a two new tool called 'Get connector version history' in the registry domain:

For a request regarding specific connector id (source-foo or destination-foo), the tool should return a version history of the connector. For each version the version history needs to contain:
    a. From the registry: the version number, release date
    b. Derived from registry data: name of docker image and DockerHub url to docker image (dynamic from version number)
    c. Also dynamic from connector name: URL to changelog, e.g. <http://docs.airbyte.com/connectors/sources/foo.md#changelog|docs.airbyte.com/connectors/sources/foo.md#changelog> for 'source-foo'.
    d. Scraped from the connector's changelog with parsing errors treated as non-fatal: the PR url and the full title of the PR. (To avoid github rate limiting issues, you may need to scrape from the html link (above), optionally parsing as html or using something like beautiful soup, followed by regex parsing. I'll let you suggest something.)
Your contact points for this project will be me and Nourien Fouad.
Thread URL: https://airbytehq-team.slack.com/archives/C08BHPUMEPJ/p1762888298992019

@devin-ai-integration
Copy link
Contributor

🤖 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
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1762981002-add-installtype-any-installable' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1762981002-add-installtype-any-installable'

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test-pr - Runs tests with the updated PyAirbyte

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

Expanded the InstallType enum with ANY and INSTALLABLE and updated connector-availability and validation logic so ANY is treated like DOCKER for listing/validation and INSTALLABLE selects connectors depending on Docker presence; updated docs/version-history checks to use ANY.

Changes

Cohort / File(s) Summary
Enum extension
airbyte/registry.py
Added ANY = "any" and INSTALLABLE = "installable" members to the InstallType enum and expanded the enum docstring.
Availability & validation logic
airbyte/registry.py
Updated get_available_connectors() to: treat ANY like DOCKER for listing, handle INSTALLABLE by checking Docker presence (Docker installed → all connectors; not installed → only PYTHON and YAML/manifest-only), and unify iteration over the resolved connector set. Updated get_connector_api_docs_urls() and get_connector_version_history() to check membership against ANY (instead of DOCKER) when validating connector existence and to report available_connectors using ANY. Minor logging and filter flow adjustments related to Docker presence.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Registry as airbyte/registry.py
    Note over Registry: install_type ∈ {DOCKER, ANY, INSTALLABLE, PYTHON, YAML, JAVA}
    Client->>Registry: get_available_connectors(install_type)
    alt install_type == DOCKER or install_type == ANY
        Registry-->>Client: return all connectors (includes docker-enabled)
    else alt install_type == INSTALLABLE
        Registry->>Registry: detect Docker availability
        alt Docker present
            Registry-->>Client: return all connectors
        else Docker absent
            Registry-->>Client: return only PYTHON and YAML-only connectors
        end
    else
        Registry-->>Client: return connectors filtered by install_type
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file changed with consistent enum addition and conditional updates.
  • Pay extra attention to:
    • Calls that still log or error mentioning DOCKER explicitly — should they reference ANY/INSTALLABLE instead?
    • INSTALLABLE behavior when Docker detection fails or is flaky.
    • Any downstream code that assumed InstallType had no ANY/INSTALLABLE values — could that affect validation or serialization?
      Would you like me to scan the repo for other DOCKER checks to suggest further updates, wdyt?

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding two new enum values (ANY and INSTALLABLE) to InstallType.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1762981002-add-installtype-any-installable

📜 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 ac321a8 and bfb7b04.

📒 Files selected for processing (1)
  • airbyte/registry.py (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte/registry.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: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (No Creds)
  • GitHub Check: Pytest (Fast)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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/registry.py (1)

55-56: Consider adding docstrings to clarify the semantic intent of these new enum values?

While the names ANY and INSTALLABLE are fairly self-descriptive, adding brief docstrings would help clarify when to use each versus DOCKER (which also returns all connectors currently). Something like:

 class InstallType(str, Enum):
     """The type of installation for a connector."""
 
     YAML = "yaml"
     PYTHON = "python"
     DOCKER = "docker"
     JAVA = "java"
-    ANY = "any"
-    INSTALLABLE = "installable"
+    ANY = "any"  # Returns all connectors regardless of install type
+    INSTALLABLE = "installable"  # Returns all installable connectors (semantic clarification of DOCKER)

This would help future developers understand the subtle semantic differences, 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 7eb746b and 4c52179.

📒 Files selected for processing (1)
  • airbyte/registry.py (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
airbyte/registry.py (1)
airbyte/exceptions.py (1)
  • AirbyteConnectorNotRegisteredError (288-297)
⏰ 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: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (No Creds)
🔇 Additional comments (3)
airbyte/registry.py (3)

274-275: Nice consolidation that improves maintainability!

Grouping DOCKER, ANY, and INSTALLABLE into a single check makes the code cleaner and addresses the PLR0911 lint issue. The logic correctly reflects that all three enum values should return the complete set of connectors.


450-457: Good semantic clarification using INSTALLABLE instead of DOCKER!

The change better expresses the intent of this validation: checking whether the connector is available/installable in the registry, rather than specifically checking for Docker availability. Since this function retrieves documentation URLs from multiple sources (registry metadata and manifest files), the more general "installable" concept is appropriate here.


510-517: Consistent semantic improvement here as well!

Like the change in get_connector_api_docs_urls(), using INSTALLABLE instead of DOCKER better expresses that this function is checking for connector availability in the registry rather than Docker-specific functionality. The consistency across both functions strengthens the clarity of the codebase.

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

PyTest Results (Fast Tests Only, No Creds)

320 tests  ±0   320 ✅ ±0   5m 59s ⏱️ +5s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit bfb7b04. ± Comparison against base commit 7eb746b.

♻️ This comment has been updated with latest results.

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

🧹 Nitpick comments (1)
airbyte/registry.py (1)

55-56: Consider adding docstrings to clarify the semantic distinction between ANY and INSTALLABLE?

While the enum values are defined, their specific purposes aren't documented. Based on the PR description, ANY returns all connectors regardless of install type, while INSTALLABLE clarifies semantics for installable connectors. Would it help to add inline comments or docstrings to make this distinction clear for future developers? WDYT?

Example:

     DOCKER = "docker"
     JAVA = "java"
-    ANY = "any"
-    INSTALLABLE = "installable"
+    ANY = "any"  # Returns all connectors regardless of install type
+    INSTALLABLE = "installable"  # Returns all installable connectors (semantic clarification of DOCKER)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c52179 and ac321a8.

📒 Files selected for processing (1)
  • airbyte/registry.py (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
airbyte/registry.py (1)
airbyte/exceptions.py (1)
  • AirbyteConnectorNotRegisteredError (288-297)
⏰ 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: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Windows)
  • GitHub Check: Pytest (All, Python 3.10, Windows)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (No Creds)
🔇 Additional comments (2)
airbyte/registry.py (2)

450-457: Good semantic improvement using InstallType.ANY here.

The change from InstallType.DOCKER to InstallType.ANY clarifies that this function is checking for connector existence across all install types, not specifically docker-installable connectors. This aligns well with the function's purpose of retrieving documentation URLs regardless of how the connector is installed.


510-517: Consistent semantic improvement here as well.

Just like in get_connector_api_docs_urls(), using InstallType.ANY instead of InstallType.DOCKER better reflects the function's intent to retrieve version history for any connector regardless of install type. The consistency across both functions is good!

- Add explicit handler for InstallType.INSTALLABLE that mirrors the None behavior
- INSTALLABLE is environment-sensitive: returns all connectors if Docker is installed,
  otherwise only Python and YAML connectors
- ANY is environment-independent: always returns all connectors
- Add comprehensive docstrings to InstallType enum to clarify semantics
- Refactor get_available_connectors() to reduce return statements (fixes PLR0911)
- Consolidate None and INSTALLABLE handlers to use single return statements

Co-Authored-By: AJ Steers <[email protected]>
- Format generator expressions to match ruff's canonical style
- Put expression target on separate line from 'for' clause

Co-Authored-By: AJ Steers <[email protected]>
@github-actions
Copy link

PyTest Results (Full)

389 tests  ±0   373 ✅ +1   23m 23s ⏱️ - 7m 1s
  1 suites ±0    16 💤 ±0 
  1 files   ±0     0 ❌  - 1 

Results for commit bfb7b04. ± Comparison against base commit 7eb746b.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants