Skip to content

feat(cloud): add pagination for cloud list operations#1024

Merged
Aaron ("AJ") Steers (aaronsteers) merged 9 commits into
mainfrom
devin/1779121915-cloud-pagination
May 19, 2026
Merged

feat(cloud): add pagination for cloud list operations#1024
Aaron ("AJ") Steers (aaronsteers) merged 9 commits into
mainfrom
devin/1779121915-cloud-pagination

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented May 18, 2026

Copy link
Copy Markdown
Member

Summary

Adds optional limit and offset pagination support to PyAirbyte Cloud list operations for connections, workspaces, sources, and destinations, while preserving the existing auto-pagination behavior when no limit is provided.

Also adds pagination for get_job_logs() so sync history requests fetch additional pages when the requested limit exceeds one API page. The list operation implementation preserves exact empty-string name filtering, keeps filtered list fetches at full API page size before applying client-side result limits, rejects non-positive limit values, and distinguishes true job-log 404s from auth/service failures.

Removed stale pagination TODOs from workspace list wrappers and added focused unit coverage for job log pagination plus resource-list pagination edge cases. Added docstrings for the new pagination test helpers/tests after CodeRabbit flagged docstring coverage.

Requested by AJ Steers from Slack thread: https://airbytehq-team.slack.com/archives/C08BHPUMEPJ/p1779121915926609?thread_ts=1779121915.926609&cid=C08BHPUMEPJ

Review & Testing Checklist for Human

  • Verify the new limit and offset parameters on CloudWorkspace.list_connections(), list_sources(), and list_destinations() match expected public API semantics.
  • Confirm filtered list calls with name or name_filter should continue scanning full API pages until enough matching results are found or the API is exhausted.
  • Check that limit=0 should raise PyAirbyteInputError, while offset=0 remains valid.
  • Check that get_job_logs() non-2xx handling matches caller expectations: 404 maps to AirbyteMissingResourceError, other non-2xx responses map to AirbyteError.
  • Run an end-to-end Cloud workspace smoke test with a workspace containing more than one API page of jobs or resources, if available.

Notes

Local validation completed:

  • uv run --project /home/ubuntu/repos/PyAirbyte ruff format --check /home/ubuntu/repos/PyAirbyte/airbyte/_util/api_util.py /home/ubuntu/repos/PyAirbyte/airbyte/cloud/workspaces.py /home/ubuntu/repos/PyAirbyte/tests/unit_tests/test_cloud_api_util.py
  • uv run --project /home/ubuntu/repos/PyAirbyte ruff check /home/ubuntu/repos/PyAirbyte/airbyte/_util/api_util.py /home/ubuntu/repos/PyAirbyte/airbyte/cloud/workspaces.py /home/ubuntu/repos/PyAirbyte/tests/unit_tests/test_cloud_api_util.py
  • uv run --project /home/ubuntu/repos/PyAirbyte ruff check /home/ubuntu/repos/PyAirbyte/tests/unit_tests/test_cloud_api_util.py --select D
  • uv run --project /home/ubuntu/repos/PyAirbyte pyrefly check /home/ubuntu/repos/PyAirbyte/airbyte/_util/api_util.py /home/ubuntu/repos/PyAirbyte/airbyte/cloud/workspaces.py /home/ubuntu/repos/PyAirbyte/tests/unit_tests/test_cloud_api_util.py --output-format=json
  • uv run --project /home/ubuntu/repos/PyAirbyte pytest /home/ubuntu/repos/PyAirbyte/tests/unit_tests/test_cloud_api_util.py -q
  • Real Airbyte Cloud smoke test against the Devin Sandbox workspace before the latest reviewer-only cleanup: 55 connections, 65 sources, 19 destinations, list_connections(limit=2), and get_previous_sync_logs(limit=1) completed successfully.

Devin session

Requested by: Aaron ("AJ") Steers (@aaronsteers)

Summary by CodeRabbit

  • New Features

    • List endpoints now support optional limit-based pagination for connections, workspaces, sources, and destinations; results are capped to the requested limit.
    • Job log retrieval auto-paginates across pages to fulfill larger limits.
  • Improvements

    • Unified limit-style controls across cloud tools and simplified tailing default to from_tail=True.
    • Stronger input validation for pagination and mutual exclusion of name vs name_filter.
  • Tests

    • Expanded unit tests covering pagination, filtering, and edge cases.

Review Change Stack

@devin-ai-integration

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

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds PAGE_SIZE and pagination helpers; list_connections/workspaces/sources/destinations and get_job_logs now accept/validate limit, auto-paginate using PAGE_SIZE with client-side per-page filtering. Cloud wrappers forward limit; MCP tools adopt limit semantics. Unit tests validate paginated request sequences and limit behavior.

Changes

Pagination Support for List and Job Log Functions

Layer / File(s) Summary
Pagination validation and helpers
airbyte/_util/api_util.py
Adds PAGE_SIZE = 100 and helpers _validate_pagination_params and _get_page_limit to validate limit and compute per-request page sizes.
list_connections pagination implementation
airbyte/_util/api_util.py
list_connections gains limit, validates inputs and name/name_filter mutual exclusion, paginates with PAGE_SIZE, filters per-page matches, advances offset, and truncates to limit.
list_workspaces pagination implementation
airbyte/_util/api_util.py
list_workspaces gains limit, validates inputs, iterates API pages using PAGE_SIZE, applies per-page filtering, advances offset, and returns results capped to limit.
list_sources pagination implementation
airbyte/_util/api_util.py
list_sources gains limit, validates inputs, requests PAGE_SIZE pages, filters per-page, advances offset, and enforces overall limit.
list_destinations pagination implementation
airbyte/_util/api_util.py
list_destinations gains limit, validates inputs, iterates PAGE_SIZE pages, filters per-page matches, updates remaining/offset, and truncates output to limit.
get_job_logs auto-pagination and error mapping
airbyte/_util/api_util.py
Reworks get_job_logs to validate limit, auto-paginate across list_jobs pages with computed per-request page sizes, map 404 to AirbyteMissingResourceError, stop on empty/no-next pages, and slice the final result to limit.
list_workspaces_in_organization limit-adaptation
airbyte/_util/api_util.py
Renames parameter to limit, updates docstring, and returns early once accumulated results reach limit.
CloudWorkspace method updates
airbyte/cloud/workspaces.py
CloudWorkspace.list_connections, list_sources, and list_destinations add limit, forward it to api_util.list_*, update docstrings, and remove redundant local post-fetch name filtering.
CloudConnection.get_previous_sync_logs signature change
airbyte/cloud/connections.py
Removes the offset parameter and stops passing an offset into api_util.get_job_logs.
MCP tools adopt limit semantics
airbyte/mcp/cloud.py
SyncJobListResult drops jobs_offset; list_cloud_sync_jobs and connector/workspace listing tools use limit and forward it to workspace/API calls, stopping once limit is reached.
Unit tests for api_util pagination
tests/unit_tests/test_cloud_api_util.py
Adds helpers and tests validating paginated list_connections sequences, list_workspaces pagination, invalid-limit rejection, and get_job_logs auto-pagination request sequence.
MCP cloud list tools tests
tests/unit_tests/test_mcp_cloud.py
Adds test doubles and parametrized tests asserting MCP list tools pass limit to workspace list methods when appropriate and apply local filtering then limit when needed.

Sequence Diagram

sequenceDiagram
  participant Caller
  participant ListFunction as api_util.list_functions
  participant PaginationUtils
  participant API as AirbyteAPI
  participant Result
  Caller->>ListFunction: call with limit (or no limit)
  ListFunction->>PaginationUtils: _validate_pagination_params(limit)
  alt invalid limit
    ListFunction->>Result: raise PyAirbyteInputError
  else
    loop while API indicates next_page and remaining>0
      ListFunction->>PaginationUtils: _get_page_limit(remaining)
      ListFunction->>API: request list endpoint with page_limit and current_offset
      API-->>ListFunction: returns page (data + next_page)
      ListFunction->>ListFunction: filter page items, accumulate matches, decrement remaining, advance offset
    end
    ListFunction->>Result: return accumulated results truncated to limit
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Want extra tests for very large limits or non-matching name_filters to ensure loops stop correctly and remaining logic is robust, wdyt?

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cloud): add pagination for cloud list operations' clearly and concisely summarizes the main change: adding pagination support to Cloud list operations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1779121915-cloud-pagination

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.

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

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/1779121915-cloud-pagination' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1779121915-cloud-pagination'

PR Slash Commands

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

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

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

📝 Edit this welcome message.

@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

PyTest Results (Fast Tests Only, No Creds)

429 tests  +26   429 ✅ +26   6m 0s ⏱️ -1s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit db2aeb3. ± Comparison against base commit 8fb66f2.

♻️ This comment has been updated with latest results.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 17:49
Copilot AI review requested due to automatic review settings May 18, 2026 17:49

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

PyTest Results (Full)

499 tests  +26   481 ✅ +26   24m 59s ⏱️ - 1m 27s
  1 suites ± 0    18 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit db2aeb3. ± Comparison against base commit 8fb66f2.

♻️ This comment has been updated with latest results.

coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 19:12
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 19:17
Comment thread airbyte/_util/api_util.py Outdated
Comment thread airbyte/_util/api_util.py Outdated
Comment thread airbyte/_util/api_util.py Outdated
@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 19:27
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 20:07
@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title feat(cloud): add pagination for cloud list operations feat(cloud): add pagination for cloud list operations May 18, 2026
@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 20:10
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 20:10

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's simplify and remove support for offset. So we'll support limit only in our Python API. Also add limit support on the relevant MCP tools if it does not already exist.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Addressed AJ's latest review request to simplify Cloud pagination to public limit support only.

Changes pushed in 864d6d4:

  • Removed public offset parameters from Cloud list APIs and previous sync logs.
  • Kept internal SDK offset handling only for page traversal starting at offset 0.
  • Standardized Cloud MCP list tools on limit instead of max_items_limit.
  • Removed jobs_offset from the Cloud sync jobs MCP tool.
  • Added focused unit coverage for MCP limit forwarding and updated pagination tests.

Local validation passed:

  • ruff format --check
  • ruff check
  • pyrefly check --output-format=json with 0 errors
  • pytest tests/unit_tests/test_cloud_api_util.py tests/unit_tests/test_mcp_cloud.py -q

Devin session

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (3)
airbyte/mcp/cloud.py (2)

1172-1205: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Could we avoid forwarding limit before the local connection filters run?

workspace.list_connections(limit=limit) truncates the candidate set before name_contains and failing_connections_only are applied, so this can miss later matching/failing connections and return fewer than limit results. The existing break on len(results) >= limit already gives you the final cap once matching rows are appended. wdyt?

Possible adjustment
     workspace: CloudWorkspace = _get_cloud_workspace(ctx, workspace_id)
-    connections = workspace.list_connections(limit=limit)
+    list_limit = None if name_contains or failing_connections_only else limit
+    connections = workspace.list_connections(limit=list_limit)

Also applies to: 1264-1265

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@airbyte/mcp/cloud.py` around lines 1172 - 1205, The call
workspace.list_connections(limit=limit) prematurely truncates candidates before
local filters (name_contains, failing_connections_only) are applied; change it
to fetch without the upstream limit (pass None or omit limit) and then apply the
local filtering loop that inspects name_contains, with_connection_status and
failing_connections_only, appending to results and breaking when len(results) >=
limit (reusing the existing break logic); update both occurrences that pass
limit through to workspace.list_connections to ensure the final cap is enforced
only after local filters run.

812-827: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Could we apply limit after the local name_contains filter instead here?

Passing limit into workspace.list_sources() / workspace.list_destinations() before the substring filter can under-fill the response even when later items match. If the first limit records miss name_contains, this returns too few results. wdyt?

Possible adjustment
 def list_deployed_cloud_source_connectors(...):
     workspace: CloudWorkspace = _get_cloud_workspace(ctx, workspace_id)
-    sources = workspace.list_sources(limit=limit)
+    sources = workspace.list_sources(limit=None if name_contains else limit)

     if name_contains:
         needle = name_contains.lower()
         sources = [s for s in sources if s.name is not None and needle in s.name.lower()]
+    if limit is not None:
+        sources = sources[:limit]

 def list_deployed_cloud_destination_connectors(...):
     workspace: CloudWorkspace = _get_cloud_workspace(ctx, workspace_id)
-    destinations = workspace.list_destinations(limit=limit)
+    destinations = workspace.list_destinations(limit=None if name_contains else limit)

     if name_contains:
         needle = name_contains.lower()
         destinations = [d for d in destinations if d.name is not None and needle in d.name.lower()]
+    if limit is not None:
+        destinations = destinations[:limit]

Also applies to: 863-878

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@airbyte/mcp/cloud.py` around lines 812 - 827, The current code passes limit
into workspace.list_sources(...) which can cause under-filled results when
name_contains is applied afterwards; change the logic so list_sources(...) is
called without the limit parameter, perform the name_contains filtering on the
full list (using the existing needle check in the list comprehension), and only
then apply the limit by slicing the filtered list (e.g., sources =
sources[:limit] if limit is not None). Make the same change for the analogous
destinations flow (workspace.list_destinations, the name_contains filter block)
so filtering happens before truncation.
airbyte/_util/api_util.py (1)

353-370: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Remove the workspace_ids filter to list all accessible workspaces, wdyt?

Line 353 marks workspace_id as intentionally unused, but line 368 passes it as a filter (workspace_ids=[workspace_id]). According to the Airbyte API, providing workspace_ids restricts results to only those exact workspace IDs. Since the function's docstring says "List workspaces" without qualification, this suggests it should return all accessible workspaces, not just the one provided. This contradiction means the pagination loop will only ever return a single workspace, defeating the purpose of the function.

💡 Minimal fix
-    _ = workspace_id  # Not used (yet)
     airbyte_instance: airbyte_api.AirbyteAPI = get_airbyte_server_instance(
         client_id=client_id,
         client_secret=client_secret,
         bearer_token=bearer_token,
         api_root=api_root,
     )
     result: list[models.WorkspaceResponse] = []
     current_offset = 0
     remaining = limit
     base_context = {"workspace_id": workspace_id, "api_root": api_root}
     while remaining is None or remaining > 0:
         try:
             response: api.ListWorkspacesResponse = airbyte_instance.workspaces.list_workspaces(
                 api.ListWorkspacesRequest(
-                    workspace_ids=[workspace_id],
                     offset=current_offset,
                     limit=PAGE_SIZE,
                 ),
             )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@airbyte/_util/api_util.py` around lines 353 - 370, The loop is incorrectly
filtering results by passing workspace_ids=[workspace_id] to
airbyte_instance.workspaces.list_workspaces (despite workspace_id being marked
unused), so remove the workspace_ids parameter from the
api.ListWorkspacesRequest call in that function (leave offset/current_offset and
limit/PAGE_SIZE intact) so the request lists all accessible workspaces; also
remove or update the dummy assignment "_ = workspace_id" (or drop the
workspace_id param from the function signature) to avoid the unused-variable
confusion.
🧹 Nitpick comments (2)
airbyte/cloud/workspaces.py (1)

761-837: ⚡ Quick win

Consider enriching the docstrings for list methods, wdyt?

The implementation looks solid! The limit parameter is cleanly forwarded to api_util, and the list comprehensions are straightforward. However, the docstrings for list_connections, list_sources, and list_destinations are quite minimal.

For a public API, it might help users to understand:

  • What happens when limit=None (auto-pagination through all results)
  • How limit interacts with name and name_filter (e.g., does filtering happen before or after limiting?)
  • Maybe a quick usage example?

This would make the pagination feature more discoverable and reduce potential confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@airbyte/cloud/workspaces.py` around lines 761 - 837, Docstrings for
list_connections, list_sources, and list_destinations are too minimal; update
each method's docstring to explicitly state that limit=None triggers automatic
pagination to return all results, that filtering (name and name_filter) is
applied server-side/when calling api_util before limiting (i.e., filters narrow
the result set then limit caps results), and show a short usage example
demonstrating limit vs. no-limit; reference the methods list_connections,
list_sources, list_destinations and the underlying
api_util.list_connections/list_sources/list_destinations calls so readers know
where pagination/filtering behavior comes from.
tests/unit_tests/test_mcp_cloud.py (1)

118-141: ⚡ Quick win

Could we add a filtered-path case here too?

This verifies that limit is forwarded, but it would not catch the regression where early non-matching items cause the MCP tool to return fewer than limit results. A case with name_contains (and one for failing_connections_only) would pin that contract down. wdyt?

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit_tests/test_mcp_cloud.py` around lines 118 - 141, Add a
filtered-path test so the MCP tool forwards `limit` when filtering is applied:
extend or add a test alongside test_mcp_cloud_list_tools_pass_limit_to_workspace
that calls the same `tool(...)` with `name_contains` (and a separate case with
`failing_connections_only`) set so some workspace items are non-matching, assert
workspace.limits[limit_key] == 1, and assert len(results) == 1 to ensure the
tool returns `limit` matching items (use the same `_CloudWorkspace` stub and
`monkeypatch` of cloud_mcp._get_cloud_workspace to control listed items).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@airbyte/_util/api_util.py`:
- Around line 353-370: The loop is incorrectly filtering results by passing
workspace_ids=[workspace_id] to airbyte_instance.workspaces.list_workspaces
(despite workspace_id being marked unused), so remove the workspace_ids
parameter from the api.ListWorkspacesRequest call in that function (leave
offset/current_offset and limit/PAGE_SIZE intact) so the request lists all
accessible workspaces; also remove or update the dummy assignment "_ =
workspace_id" (or drop the workspace_id param from the function signature) to
avoid the unused-variable confusion.

In `@airbyte/mcp/cloud.py`:
- Around line 1172-1205: The call workspace.list_connections(limit=limit)
prematurely truncates candidates before local filters (name_contains,
failing_connections_only) are applied; change it to fetch without the upstream
limit (pass None or omit limit) and then apply the local filtering loop that
inspects name_contains, with_connection_status and failing_connections_only,
appending to results and breaking when len(results) >= limit (reusing the
existing break logic); update both occurrences that pass limit through to
workspace.list_connections to ensure the final cap is enforced only after local
filters run.
- Around line 812-827: The current code passes limit into
workspace.list_sources(...) which can cause under-filled results when
name_contains is applied afterwards; change the logic so list_sources(...) is
called without the limit parameter, perform the name_contains filtering on the
full list (using the existing needle check in the list comprehension), and only
then apply the limit by slicing the filtered list (e.g., sources =
sources[:limit] if limit is not None). Make the same change for the analogous
destinations flow (workspace.list_destinations, the name_contains filter block)
so filtering happens before truncation.

---

Nitpick comments:
In `@airbyte/cloud/workspaces.py`:
- Around line 761-837: Docstrings for list_connections, list_sources, and
list_destinations are too minimal; update each method's docstring to explicitly
state that limit=None triggers automatic pagination to return all results, that
filtering (name and name_filter) is applied server-side/when calling api_util
before limiting (i.e., filters narrow the result set then limit caps results),
and show a short usage example demonstrating limit vs. no-limit; reference the
methods list_connections, list_sources, list_destinations and the underlying
api_util.list_connections/list_sources/list_destinations calls so readers know
where pagination/filtering behavior comes from.

In `@tests/unit_tests/test_mcp_cloud.py`:
- Around line 118-141: Add a filtered-path test so the MCP tool forwards `limit`
when filtering is applied: extend or add a test alongside
test_mcp_cloud_list_tools_pass_limit_to_workspace that calls the same
`tool(...)` with `name_contains` (and a separate case with
`failing_connections_only`) set so some workspace items are non-matching, assert
workspace.limits[limit_key] == 1, and assert len(results) == 1 to ensure the
tool returns `limit` matching items (use the same `_CloudWorkspace` stub and
`monkeypatch` of cloud_mcp._get_cloud_workspace to control listed items).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6de2af50-6642-46fe-a500-a178eb4999fc

📥 Commits

Reviewing files that changed from the base of the PR and between bf5478d and 864d6d4.

📒 Files selected for processing (6)
  • airbyte/_util/api_util.py
  • airbyte/cloud/connections.py
  • airbyte/cloud/workspaces.py
  • airbyte/mcp/cloud.py
  • tests/unit_tests/test_cloud_api_util.py
  • tests/unit_tests/test_mcp_cloud.py
💤 Files with no reviewable changes (1)
  • airbyte/cloud/connections.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit_tests/test_cloud_api_util.py

@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 21:03
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 21:34
Comment thread airbyte/cloud/connections.py
coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 22:04
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 18, 2026 23:01
@devin-ai-integration devin-ai-integration Bot marked this pull request as draft May 18, 2026 23:14
@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review May 19, 2026 00:41
@aaronsteers Aaron ("AJ") Steers (aaronsteers) merged commit 70a7d82 into main May 19, 2026
23 checks passed
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the devin/1779121915-cloud-pagination branch May 19, 2026 00:43
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