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

No reaction on <Сomment Pattern> starting from 31 comment in PR #326

Open
maxvasylets opened this issue May 21, 2020 · 12 comments
Open

No reaction on <Сomment Pattern> starting from 31 comment in PR #326

maxvasylets opened this issue May 21, 2020 · 12 comments

Comments

@maxvasylets
Copy link

maxvasylets commented May 21, 2020

The plugin works fine and reacts to Comment Pattern until we have more than 30 comments.

I did some research and I found that it's probably related to this code: GitHubPRCommentEvent.java#L57

In this code you request PR comments from GitHub, but by default GitHub returns only the first 30 comments and if you need to get more you should specify page number.

This plugin looks great but this issue blocks us to use it for production usage.
I'd appreciate it if we can find a solution and fix this issue.

How to manually check comments and pagination:
curl -H "Authorization: token <github-access-token>" -X GET https://api.github.com/repos/<owner>/<repo-name>/issues/<pr-number>/comments
curl -H "Authorization: token <github-access-token>" -X GET https://api.github.com/repos/<owner>/<repo-name>/issues/<pr-number>/comments?page=2

Useful links:
https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue

GitHub PR Polling Log:
Running GitHub Pull Request trigger check for May 21, 2020 9:16:07 PM on <repo-name> GitHub rate limit before check: GHRateLimit {core {remaining=4979, limit=5000, resetDate=Thu May 21 22:11:00 UTC 2020}search {remaining=30, limit=30, resetDate=Thu May 21 21:17:07 UTC 2020}graphql {remaining=5000, limit=5000, resetDate=Thu May 21 22:16:07 UTC 2020}integrationManifest {remaining=5000, limit=5000, resetDate=Thu May 21 22:16:07 UTC 2020}} No matching comments found for 4 Finished GitHub Pull Request trigger check for <repo-name> at May 21, 2020 9:16:08 PM. Duration: 1301ms

@KostyaSha
Copy link
Owner

Probably adding since may help. Internally it stores the last comment..

@KostyaSha
Copy link
Owner

Looks like https://github.com/hub4j/github-api/blob/495a46e2d87c26add983cc0bfd803ad5466f3678/src/main/java/org/kohsuke/github/GHIssue.java#L429-L451 doesn't support pages and since tag. Need to be implemented in library first

@maxvasylets
Copy link
Author

Correct me if I'm wrong.
As I can see You can just use listComments() method instead of getComments() and get paged iterable result.

@KostyaSha
Copy link
Owner

Shouldn't then it get all pages?

@maxvasylets
Copy link
Author

maxvasylets commented May 22, 2020

yes, all comments from all pages

@maxvasylets
Copy link
Author

After some research, I found that github-api library works fine and the method getComments() returns all available comments in PR.
So the issue seems in this plugin.

@KostyaSha
Copy link
Owner

do you have cache enabled in connector?

@maxvasylets
Copy link
Author

maxvasylets commented Jul 14, 2020

Job > configure > GitHub Pull Requests > GitHub Plugin Repository Provider > Cache connection = true

Anyway, I've tested with Cache connection = false also.

@prawen
Copy link

prawen commented Aug 4, 2020

Same issue. Any update or workaround ?

@KostyaSha
Copy link
Owner

KostyaSha commented Aug 30, 2020

I have no idea what may be wrong. GH api library returns full list of comment that iterated according to date of the previous check. Either library is broken somehow... Nearest issue with extra builds is also related to comments and date. I can add extra logging into DEBUG/TRACE level of corresponding class. Would you be able to capture/check then?

@maxvasylets
Copy link
Author

maxvasylets commented Aug 31, 2020

I don't use it in prod because of this issue but I can try to reproduce this situation on the stand and share logs then.

@ezelkow1
Copy link

I also see this here. Ive been rebuilding a CI on a new system and have been using my own repo to test, so just throwing in my rebuild string as a comment after a certain amount (apparently 31) in test PRs it stops actually triggering

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

4 participants