actions-runner-controller/simulator
Tingluo Huang ebe7d060cb
Find runner groups that visible to repository using a single API call. (#1324)
The [ListRunnerGroup API](https://docs.github.com/en/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization) now add a new query parameter `visible_to_repository`.

We were doing `N+1` lookup when trying to find which runner group can be used for job from a certain repository.
- List all runner groups
- Loop through all groups to check repository access for each of them via [API](https://docs.github.com/en/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization)

The new query parameter `visible_to_repository` should allow us to get the runner groups with access in one call.

Limitation:
- The new query parameter is only supported in GitHub.com, which means anyone who uses ARC in GitHub Enterprise Server won't get this.
- I am working on a PR to update `go-github` library to support the new parameter, but it will take a few weeks for a newer `go-github` to be released, so in the meantime, I am duplicating the implementation in ARC as well to support the new query parameter.
2022-04-24 10:54:40 +09:00
..
runnergroup_visibility.go Find runner groups that visible to repository using a single API call. (#1324) 2022-04-24 10:54:40 +09:00
runnergroups.go Fix issue that visible runner groups are printed as if empty in log 2022-02-19 14:43:41 +09:00
runnergroups_test.go Option to consider runner group visibility on scale based on webhook (#1062) 2022-02-16 19:08:56 +09:00