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

max-items is just used for issues, but not for others #755

Closed
xiao623 opened this issue Sep 1, 2021 · 3 comments · Fixed by #757
Closed

max-items is just used for issues, but not for others #755

xiao623 opened this issue Sep 1, 2021 · 3 comments · Fixed by #757

Comments

@xiao623
Copy link
Contributor

xiao623 commented Sep 1, 2021

self.PPER_PAGE: self.max_items,

The value of max-items is only used for issues method, so what is the point of setting this value?

For example:

self.PPER_PAGE: self.VPER_PAGE,

when we called https://api.github.com/repos/apache/spark/pulls/27058/comments?per_page=100&direction=asc&sort=updated, we got Server Error.
But if per_page is 50, the response is 200.

It should also be used in others methods so that we can set per_page what we want.

@xiao623 xiao623 changed the title max-items is just useful for issues, but not for others max-items is just used for issues, but not for others Sep 1, 2021
@vchrombie
Copy link
Member

vchrombie commented Sep 1, 2021

Thanks for opening the issue @xiao623.

From what I understand is, GitHub treats pull_requests as issues too (but not vice versa). So, I guess the backend implements the logic accordingly. It fetches the issues and then filters the pull requests later.

issues_groups = self.issues(from_date=from_date)

when we called https://api.github.com/repos/apache/spark/pulls/27058/comments?per_page=100&direction=asc&sort=updated, we got Server Error.
But if per_page is 50, the response is 200.

I think this is unrelated to perceval and I'm afraid if the problem is from the github side.

apache/spark#27058 has 197 comments

$ curl -sSD/dev/stderr https://api.github.com/repos/apache/spark/pulls/27058/comments\?per_page=100 > /dev/null
HTTP/2 502 
server: GitHub.com
...

apache/spark#5694 has 406 comments

$ curl -sSD/dev/stderr https://api.github.com/repos/apache/spark/pulls/5694/comments\?per_page=100 > /dev/null
HTTP/2 200 
server: GitHub.com
...

I would like to hear more comments from the other community members as well.
Thanks.

@zhquan
Copy link
Member

zhquan commented Sep 3, 2021

@xiao623 - max-items is used when the category is issue or pull_request but only in the first level and not in its sublevels as comments, reactions, etc. That means it will set the per_page to max_items only to fetch issues or pull requests but for each issue/pull to fetch comments the per_page is always the same VPER_PAGE = 100.

Maybe the value max-items should extend to all requests and not only for the first level.

when we called https://api.github.com/repos/apache/spark/pulls/27058/comments?per_page=100&direction=asc&sort=updated, we got Server Error.
But if per_page is 50, the response is 200.

I agree with @vchrombie that the problem is from the GitHub side

@xiao623
Copy link
Contributor Author

xiao623 commented Sep 4, 2021

Yes, I agree that the problem is from the Github side, and I ask for help in GitHub Support Community : got-server-error-when-called-api

Before they fix the problem, we need to modify per_page in issue_comments method so that the program can continue to run.

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

Successfully merging a pull request may close this issue.

3 participants