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

Pagination is not implemented #3

Closed
potiuk opened this issue Jan 4, 2020 · 1 comment · Fixed by #4
Closed

Pagination is not implemented #3

potiuk opened this issue Jan 4, 2020 · 1 comment · Fixed by #4

Comments

@potiuk
Copy link
Contributor

potiuk commented Jan 4, 2020

Unfortunately most of the Github APIs returning collections returns maximum 30 responses. This is documented here https://developer.github.com/v3/#pagination but unfortunately it is not mentioned in the particular APIs that are affected. So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's not at all obvious that pagination is in operation and that you should add another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is that in big repositories with > 30 PRs only the OLDEST prs will be checked (that's what is the sorting order). If all those 30 PRs are properly labelled, then the plugin will stop working and will not pick any new PRs. There is an interesting behaviour of that - if there are unlabelled old PRs, they will get updated, so - in fact - they will disappear from the "oldest" list and possibly some new PRs that will be checked in the new pass. However once you have 30 oldest, properly labelled PRs, the plugin stops working. That's really annoying and difficult to detect problem - especially if your repo does not have a lot of PRs.

Pagination is easy. It is described here: https://github.com/google/go-github/#pagination

Pull request with a fix follows shortly.

potiuk added a commit to potiuk/periodic-labeler that referenced this issue Jan 4, 2020
Fixes paulfantom#3.

Unfortunately most of the Github APIs returning collections returns maximum 30
responses. This is documented here https://developer.github.com/v3/#pagination
but unfortunately it is not mentioned in the particular APIs that are affected.
So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's
not at all obvious that pagination is in operation and that you should add
another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is
that in big repositories with > 30 PRs only the OLDEST prs will be checked
(that's what is the sorting order). If all those 30 PRs are properly labelled,
then the plugin will stop working and will not pick any new PRs. There is an
interesting behaviour of that - if there are unlabelled old PRs, they will get
updated, so - in fact - they will disappear from the "oldest" list and possibly
some new PRs that will be checked in the new pass. However once you have 30
oldest, properly labelled PRs, the plugin stops working. That's really annoying
and difficult to detect problem - especially if your repo does not have a lot
of PRs.

Pagination is easy. It is described here:
https://github.com/google/go-github/#pagination
potiuk added a commit to potiuk/periodic-labeler that referenced this issue Jan 4, 2020
Fixes paulfantom#3.

Unfortunately most of the Github APIs returning collections returns maximum 30
responses. This is documented here https://developer.github.com/v3/#pagination
but unfortunately it is not mentioned in the particular APIs that are affected.
So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's
not at all obvious that pagination is in operation and that you should add
another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is
that in big repositories with > 30 PRs only the OLDEST prs will be checked
(that's what is the sorting order). If all those 30 PRs are properly labelled,
then the plugin will stop working and will not pick any new PRs. There is an
interesting behaviour of that - if there are unlabelled old PRs, they will get
updated, so - in fact - they will disappear from the "oldest" list and possibly
some new PRs that will be checked in the new pass. However once you have 30
oldest, properly labelled PRs, the plugin stops working. That's really annoying
and difficult to detect problem - especially if your repo does not have a lot
of PRs.

Pagination is easy. It is described here:
https://github.com/google/go-github/#pagination
potiuk added a commit to potiuk/periodic-labeler that referenced this issue Jan 4, 2020
Fixes paulfantom#3.

Unfortunately most of the Github APIs returning collections returns maximum 30
responses. This is documented here https://developer.github.com/v3/#pagination
but unfortunately it is not mentioned in the particular APIs that are affected.
So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's
not at all obvious that pagination is in operation and that you should add
another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is
that in big repositories with > 30 PRs only the OLDEST prs will be checked
(that's what is the sorting order). If all those 30 PRs are properly labelled,
then the plugin will stop working and will not pick any new PRs. There is an
interesting behaviour of that - if there are unlabelled old PRs, they will get
updated, so - in fact - they will disappear from the "oldest" list and possibly
some new PRs that will be checked in the new pass. However once you have 30
oldest, properly labelled PRs, the plugin stops working. That's really annoying
and difficult to detect problem - especially if your repo does not have a lot
of PRs.

Pagination is easy. It is described here:
https://github.com/google/go-github/#pagination
potiuk added a commit to potiuk/periodic-labeler that referenced this issue Jan 4, 2020
Fixes paulfantom#3.

Unfortunately most of the Github APIs returning collections returns maximum 30
responses. This is documented here https://developer.github.com/v3/#pagination
but unfortunately it is not mentioned in the particular APIs that are affected.
So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's
not at all obvious that pagination is in operation and that you should add
another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is
that in big repositories with > 30 PRs only the OLDEST prs will be checked
(that's what is the sorting order). If all those 30 PRs are properly labelled,
then the plugin will stop working and will not pick any new PRs. There is an
interesting behaviour of that - if there are unlabelled old PRs, they will get
updated, so - in fact - they will disappear from the "oldest" list and possibly
some new PRs that will be checked in the new pass. However once you have 30
oldest, properly labelled PRs, the plugin stops working. That's really annoying
and difficult to detect problem - especially if your repo does not have a lot
of PRs.

Pagination is easy. It is described here:
https://github.com/google/go-github/#pagination
potiuk added a commit to potiuk/periodic-labeler that referenced this issue Jan 4, 2020
Fixes paulfantom#3.

Unfortunately most of the Github APIs returning collections returns maximum 30
responses. This is documented here https://developer.github.com/v3/#pagination
but unfortunately it is not mentioned in the particular APIs that are affected.
So when reading https://developer.github.com/v3/pulls/#list-pull-requests it's
not at all obvious that pagination is in operation and that you should add
another loop through pages.

Periodic labeler does not have pagination implemented, therefore the result is
that in big repositories with > 30 PRs only the OLDEST prs will be checked
(that's what is the sorting order). If all those 30 PRs are properly labelled,
then the plugin will stop working and will not pick any new PRs. There is an
interesting behaviour of that - if there are unlabelled old PRs, they will get
updated, so - in fact - they will disappear from the "oldest" list and possibly
some new PRs that will be checked in the new pass. However once you have 30
oldest, properly labelled PRs, the plugin stops working. That's really annoying
and difficult to detect problem - especially if your repo does not have a lot
of PRs.

Pagination is easy. It is described here:
https://github.com/google/go-github/#pagination
@potiuk
Copy link
Contributor Author

potiuk commented Jan 4, 2020

@paulfantom -> Would love to get this merged :)

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.

1 participant