-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added pagination support for /user/teams github api with link header . #274
Added pagination support for /user/teams github api with link header . #274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good generally, I think there may be a few typos in the comments and I think the logs are potentially a bit too verbose, bear in mind that each of these log lines would be printed for every request
Thanks for picking this up from #102
providers/github.go
Outdated
// 1. When paging is required (Example: When the data size is 100 and the page size is 99 or less) | ||
// 2. When it exceeds the paging frame (Example: When there is only 10 records but the second page is called with a page size of 100) | ||
|
||
// link herder at not last page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo I think
// link herder at not last page | |
// link header at not last page |
providers/github.go
Outdated
|
||
// link herder at not last page | ||
// <https://api.github.com/user/teams?page=1&per_page=100>; rel="prev", <https://api.github.com/user/teams?page=1&per_page=100>; rel="last", <https://api.github.com/user/teams?page=1&per_page=100>; rel="first" | ||
// link herder at last page (doesn't exist last info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo again?
// link herder at last page (doesn't exist last info) | |
// link header at last page (doesn't exist last info) |
providers/github.go
Outdated
// link herder at last page (doesn't exist last info) | ||
// <https://api.github.com/user/teams?page=3&per_page=10>; rel="prev", <https://api.github.com/user/teams?page=1&per_page=10>; rel="first" | ||
|
||
logger.Printf("1:endpoint :[%s]",endpoint.String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need to log these? Could become very noisy in the logs as these would both be printed on every request
providers/github.go
Outdated
logger.Printf("3:doesn't exist last page info. ") | ||
}else{ | ||
last = i | ||
logger.Printf("3:last page index :[%d]", last) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially over-logging here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. How about fixing it (typo &over-logging)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase on master and add a note to the changelog for the entry and we can then get this merged!
b24a937
to
ee6065d
Compare
====================================================== changelog note [oauth2-proxy#274](oauth2-proxy#274) Add github api pagination support (@toshi-miura ,@apratina) ====================================================== I didn't edit CHANGELOG.md. Since # 102 was taken over and the change difference of CHANGELOG.md was large
ee6065d
to
31d7b61
Compare
My statement was rebase, except for changes to the original author. I didn't edit CHANGELOG.md. |
@toshi-miura I appreciate the diff was large, but you can add a new changelog comment now there's no merge to handle right? Since this is a functional change it needs a changelog entry before it can be merged |
Yep that's exactly what I'd like you to add, thank you :) |
Can't pull the latest master CHANGELOG.md because I am a child of # 102, is that okay? |
I would like to ask you what kind of cycle is it to make a release binary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good, has it been tested in it's latest form?
I ’m doing a manual test.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! small typo and then I think we're good to merge :D
CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ | |||
- [#227](https://github.com/pusher/oauth2_proxy/pull/227) Add Keycloak provider (@Ofinka) | |||
- [#273](https://github.com/pusher/oauth2_proxy/pull/273) Support Go 1.13 (@dio) | |||
- [#275](https://github.com/pusher/oauth2_proxy/pull/275) docker: build from debian buster (@syscll) | |||
- [#274](https://github.com/pusher/oauth2_proxy/pull/274) Supports many github teams with api pagination support (@toshi-miura ,@apratina) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [#274](https://github.com/pusher/oauth2_proxy/pull/274) Supports many github teams with api pagination support (@toshi-miura ,@apratina) | |
- [#274](https://github.com/pusher/oauth2_proxy/pull/274) Supports many github teams with api pagination support (@toshi-miura, @apratina) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review, fixed
Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>
I'm sorry to be late |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your work and patience with our reviews @toshi-miura!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the changelog conflict is resolved this should be good to merge.
I resolved the conflict. |
6d98808
to
6326660
Compare
I'm happy with this now, I've fixed up the changelog again, @syscll gonna override your requested changes as I can see this is now resolved |
Thank you for the merge. If the release schedule is decided, |
We are planning to do a release in the next few weeks. We're just finalising a few other PRs. |
Thank you very mush! |
…way config (oauth2-proxy#274) Signed-off-by: bitliu <bitliu@tencent.com>
Description
Added handling of last page pointed out below to #102
Test is done by rewriting the code with a smaller "per_page" value.