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

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

Open
critchtionary opened this issue May 5, 2020 · 0 comments

Comments

@critchtionary
Copy link

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

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

No branches or pull requests

1 participant