From 39c1beffc5b6419fd5998891cd14ed79398adf9c Mon Sep 17 00:00:00 2001 From: Michalis Zampetakis Date: Sat, 20 Jan 2024 23:41:54 +0200 Subject: [PATCH] Fix Bitbucket get pull requests that ignores pagination (#3235) Fixes #3180 --- server/forge/bitbucket/internal/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/forge/bitbucket/internal/client.go b/server/forge/bitbucket/internal/client.go index 03b4b6e4a..c7ca81b01 100644 --- a/server/forge/bitbucket/internal/client.go +++ b/server/forge/bitbucket/internal/client.go @@ -50,7 +50,7 @@ const ( pathStatus = "%s/2.0/repositories/%s/%s/commit/%s/statuses/build" pathBranches = "%s/2.0/repositories/%s/%s/refs/branches?%s" pathOrgPerms = "%s/2.0/workspaces/%s/permissions?%s" - pathPullRequests = "%s/2.0/repositories/%s/%s/pullrequests" + pathPullRequests = "%s/2.0/repositories/%s/%s/pullrequests?%s" pathBranchCommits = "%s/2.0/repositories/%s/%s/commits/%s" pathDir = "%s/2.0/repositories/%s/%s/src/%s%s" ) @@ -235,8 +235,8 @@ func (c *Client) GetUserWorkspaceMembership(workspace, user string) (string, err func (c *Client) ListPullRequests(owner, name string, opts *ListOpts) ([]*PullRequest, error) { out := new(PullRequestResp) - uri := fmt.Sprintf(pathPullRequests, c.base, owner, name) - _, err := c.do(uri, get, opts.Encode(), out) + uri := fmt.Sprintf(pathPullRequests, c.base, owner, name, opts.Encode()) + _, err := c.do(uri, get, nil, out) return out.Values, err }