Closed jhump closed 4 years ago
@mszostok, any chance you could review this fix?
I am in a GitHub organization that has enough teams that we just hit this: we added two new teams but this tool reported our CODEOWNERS
as broken when we tried to refer to the new teams. And the reason is because the new teams ended up on "page 2" of team results.
Hi @jhump sorry for such late response, somehow I didnt notice that 🤦♂
I will check that this weekend and do new release.
once again really sorry. I will update readme how you can ping me:
mszostok
szostok.mateusz@gmail.com
but I will also pay more attention to that repo and change notification.
@mszostok, no worries. I'm patient! :)
The existing code only downloads 1 page of results when trying to list an organization's teams. By default, a page is only 30 items. So organizations with >30 teams may have some teams that are not visible to the check. This causes the checker to think a config is invalid even if it actually is valid.
This change (1) sets the requested page size to 100 (the max), to reduce GitHub API calls; (2) adds a cache of teams by org to the checker struct, again, to reduce API calls to GitHub; and (3) iterates until the response indicates that there are no more pages.