Closed alohr51 closed 4 years ago
A quick bandaid fix may be to just add the query param?per_page=100
to the end of the GitHub team request API URL. It may be rare users are apart of more than 100 teams.
The true solution and fix is to properly implement pagination requests to the GitHub API.
sure
added pagination up to 100
To be extra clear- pagination wasn't added to the CLI yet, just a flag was added to show 100 results per page instead of the default 30. CLI is still only looking at the first page.
since Java CLI Code is being frozen for the most part and we added pagination to 100, closing out this issue
Not all teams are returned from the call to GitHub. I was recently added to a GHE team and tried logging into the CLI via the /login endpoint and it was rejected even tho configured is set up properly.
I get back a 400 with
I made sure that team was configured correctly in the kabanero CR.
I believe the problem to be the fact that the GitHub API has a pagination feature that limits the returned teams to 30 by default. CLI is probably not doing pagination requests which results in a truncated team list.
From the CLI logs, I confirmed the above because the logs listed the teams its looking through and it only listed 30 of my teams when I am apart of more than 30. The team that would have authenticated me is on the 2nd or greater page of returned results from the GitHub API.
https://developer.github.com/enterprise/2.19/v3/#pagination