Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete BitBucket Pagination Methods #253

Closed
4 tasks
ataylorme opened this issue Sep 9, 2019 · 6 comments · Fixed by #267
Closed
4 tasks

Incomplete BitBucket Pagination Methods #253

ataylorme opened this issue Sep 9, 2019 · 6 comments · Fixed by #267
Labels
Milestone

Comments

@ataylorme
Copy link
Contributor

src/API/Bitbucket/BitbucketAPI.php has placeholder methods. These should be updated with proper logic to parse the BitBucket API.

  • isPagedResponse
  • getPagerInfo
  • isLastPage
  • getNextPageUri
@ataylorme ataylorme added the bug label Sep 9, 2019
@ataylorme ataylorme added this to the 2.0 milestone Sep 9, 2019
@ataylorme
Copy link
Contributor Author

See the GitHub and GitLab implementations for examples

@danielbachhuber
Copy link
Contributor

@ataylorme What's the best way to reproduce this?

@ataylorme
Copy link
Contributor Author

Pagination kicks in when there are more items returned by the API than can fit in a single request.

I'm not sure where pagination kicks in for BitBucket API requests but terminus build:env:delete:pr with a lot of open PRs would probably trigger it.

@ataylorme
Copy link
Contributor Author

@danielbachhuber
Copy link
Contributor

It looks like branchesForPullRequests() is the only method that makes a pagedRequest():

$data = $this->api()->pagedRequest("repositories/$target_project/pullrequests", $callback, ['state' => implode('&state=', $stateParameters[$state])]);

branchesForPullRequests() is called by eligibleIfClosedPrExists():

public function eligibleIfClosedPRExists()
{
return $this->provider->branchesForPullRequests($this->project, 'all', $this);
}

@ataylorme
Copy link
Contributor Author

Yes, branchesForPullRequests() is used by build:env:delete:pr to determine which multidev branches correspond with open PRs and which should be deleted (closed PRs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants