Skip to content

Infinite Loop when request changes for Pull Request with more than "page.max.changes" #151

@critchtionary

Description

@critchtionary

Using Bitbucket 6.10.0, Python 3.7.2 and stashy 0.6.
Steps to reproduce:

  1. Check the value of page.max.changes in bitbucket.properties (defaults to 1000)
  2. Create a pull request with more than this amount of changes. Diff tab in pull request should show "This pull request is too large to render. Showing the first N files.
  3. Use stashy to request changes
pr_files = []
for change in bitbucket.projects[project].repos[slug].pull_requests[pr_id].changes():
    filename = change["path"]["toString"]
    if filename in pr_files:
        print("Duplicate file found!")
        print(len(pr_files))
        break # Break out of infinite loop
    pr_files.append(filename)

I would guess it's because the changes API returns isLastPage as False but it doesn't seem possible to get more than one page. The API doc even says "Note: This resource is currently not paged. The server will return at most one page. The server will truncate the number of changes to either the request's page limit or an internal maximum, whichever is smaller. The start parameter of the page request is also ignored. "

https://docs.atlassian.com/bitbucket-server/rest/6.10.0/bitbucket-rest.html#idp295

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions