fix(bitbucket): Fetch all repository pages from Bitbucket Cloud API#112514
Merged
fix(bitbucket): Fetch all repository pages from Bitbucket Cloud API#112514
Conversation
wedamija
approved these changes
Apr 8, 2026
Bitbucket Cloud defaults to pagelen=10 when no parameter is specified, so get_repos() was silently returning only the first 10 repositories for any workspace. This affected repo selector dropdowns, stacktrace linking, code mappings, and unmigratable repo detection. Add _get_all_from_paginated() that follows the "next" URL in Bitbucket response bodies with pagelen=100 (the API max), aggregating all pages. Apply to get_repos() only; search_repositories() is left unchanged. Refs VDY-67
Address PR feedback: forward the page_number_limit parameter from get_repositories() through get_repos() to _get_all_from_paginated() for consistency with the GitHub integration's interface contract. Add tests for multi-page aggregation and page limit enforcement. Refs VDY-67
a452894 to
ea9d018
Compare
Contributor
Backend Test FailuresFailures on
|
Mock response data was missing the uuid field that get_repo_external_id() requires, causing KeyError. Assertions were also missing the external_id key in expected results. Refs VDY-67
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 53be095. Configure here.
Type the username property return and rename a shadowed variable to fix arg-type, no-redef, and return-value errors caught by CI.
Drop the < 1 guard so that zero/negative limits naturally return only the first page (the while loop never executes), matching how GitHub's _get_with_pagination handles the same case. Add tests for both the zero-limit and excessive-limit clamping paths.
george-sentry
pushed a commit
that referenced
this pull request
Apr 9, 2026
…112514) ## Summary - Bitbucket Cloud defaults to `pagelen=10` when no parameter is specified, so `get_repos()` was silently returning only the first 10 repositories for any workspace - This affected repo selector dropdowns, stacktrace linking, code mappings, and unmigratable repo detection for any Bitbucket Cloud workspace with >10 repos - Add `_get_all_from_paginated()` that follows the `next` URL in Bitbucket response bodies with `pagelen=100` (the API max), aggregating all pages - Applied to `get_repos()` only; `search_repositories()` is left unchanged ## Test plan - [x] Existing Bitbucket tests pass (65/65) - [x] Manually test with a Bitbucket Cloud workspace that has >10 repos to confirm all repos are now returned Refs VDY-67
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
pagelen=10when no parameter is specified, soget_repos()was silently returning only the first 10 repositories for any workspace_get_all_from_paginated()that follows thenextURL in Bitbucket response bodies withpagelen=100(the API max), aggregating all pagesget_repos()only;search_repositories()is left unchangedTest plan
Refs VDY-67