Skip to content

fix(bitbucket): paginate remote-scopes API to return all repositories…#9004

Open
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/#8999
Open

fix(bitbucket): paginate remote-scopes API to return all repositories…#9004
bramhanandlingala wants to merge 1 commit into
apache:mainfrom
bramhanandlingala:fix/#8999

Conversation

@bramhanandlingala

Copy link
Copy Markdown
Contributor

Summary

The Bitbucket remote-scopes endpoint only returned the first 100 repos/workspaces — nextPageToken was always empty, so the UI had no way to load more.

Root Cause

  • listBitbucketRepos / listBitbucketWorkspaces never set the nextPage return value, so nextPageToken was always "".
  • The /repositories/{workspace} call's fields filter also excluded next, so Bitbucket wouldn't have returned it anyway.

Changes Made

  • models/repo.go — added a Next field to WorkspaceResponse and ReposResponse to capture Bitbucket's next link.
  • api/remote_api.go:
    • Added next to the fields filter so Bitbucket includes it in the response.
    • Set nextPage whenever resBody.Next != "", so the UI can request the following page.
  • api/remote_api_test.go — tests for both the next-page and last-page cases.

Does this close any open issues?

Closes #8999

@bramhanandlingala

Copy link
Copy Markdown
Contributor Author

@klesh
could you review and apprve this PR request

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.

[Bug] Bitbucket plugin remote-scopes endpoint does not paginate — only returns first 100 repos

1 participant