Skip to content

[Bitbucket Cloud] pullrequests pagination invalid URL (using each) #801

@rivoric

Description

@rivoric

Using pullrequests.each() only works if the number of open pull requests fits in a single page (<=10). The first call (without a page number) works but the second call fails. Debug shows the following 2 calls

https://api.bitbucket.org:443 "GET /2.0/repositories/summitmedia/automotive-retail-frontend/pullrequests/ HTTP/1.1" 200 None
https://api.bitbucket.org:443 "GET /2.0/repositories/summitmedia/automotive-retail-frontend/pullrequests/?page=2/ HTTP/1.1" 400 55

The problem is the trailing slash is added to the end of the URL giving the invalid page number, ie 2/

The value of next being returned from the first call is correct. The each method sets trailing=True and this causes the trailing slash to be added on subsequent calls. I think either not setting this to true or having _get_paged set trailing=False if there is next value (similar to how it sets absolute=True) would fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions