plugin-rest-endpoint-methods.js icon indicating copy to clipboard operation
plugin-rest-endpoint-methods.js copied to clipboard

GH Actions Self-hosted runner groups endpoints missing

Open Eddman opened this issue 3 years ago • 6 comments

What happened?

I'd like to call Self-hosted runner groups endpoints, but these are missing completely.

They are present in openapi-types, plugin-paginate-rest and types, but are not referenced in plugin-rest-endpoint-methods nor plugin-enterprise-server.

What did you expect to happen? Self-hosted runner groups endpoints should be available in plugin-rest-endpoint-methods and plugin-enterprise-server.

What the problem might be

Eddman avatar Sep 15 '21 08:09 Eddman

As far as I know, this endpoint is only accessible to GitHub Enterprise Cloud, can you confirm?

I remember it wasn't flagged correctly in the OpenAPI spec, so I had to add a workaround on my side https://github.com/gr2m/github-openapi-graphql-query/blob/405891d8cd001f2c126174e6f1bf5f9847213a54/lib/workarounds.js#L15

I didn't further investigate because the plan was to create a separate OpenAPI spec for GitHub Enterprise Cloud, but that still didn't happen. I think there was another reason why I had to add the workaround on my side, I wish I kept track of that instead of just writing "Due to complications" in the comment 🤷🏼

gr2m avatar Sep 15 '21 17:09 gr2m

That is not fully true. Runner groups are available for github.com (single group, but not manageable via API) as well as enterprise cloud as well as GitHub EE (self-hosted).

But you're right: I don't understand why you're "hiding" these 🙂 For me as Octokit user (even thou I'm GHEE user, not cloud) I may want to call these to manage my groups.... And now it is missing in plugin-enterprise-server as well.

Eddman avatar Sep 15 '21 18:09 Eddman

What is "GitHub EE"? Is that GitHub Enterprise Server?

We left out enterprise-only endpoints by default because the @octokit/plugin-rest-endpoint-methods plugin is so widely used, and in most cases folks don't need the Enterprise endpoints. We created https://github.com/octokit/plugin-enterprise-server.js and https://github.com/octokit/plugin-enterprise-cloud.js for that purpose. I think for your case you can use https://github.com/octokit/plugin-enterprise-cloud.js?

I've created the follow up issue on the OpenAPI spec repository, let's see what they API folks say.

We are aware that enterprise support is rather weak right now, it's one of the main motivations behind working on a revamped Octokit, you can follow updates at https://github.com/octokit/octokit-next.js if you are interested

gr2m avatar Sep 15 '21 18:09 gr2m

Yes, sorry, I meant GH Enterprise Server.

Will try to use plugin-enterprise-cloud.js for now...hopefully it will work for Enterprise Server as well. My only problem is that GH APIs usually differ in different versions of Enterprise Server. We're usually few steps behind (currently version 3.0, latest is 3.2, and Enterprise Cloud is even further) and there may already be breaking changes.

Eddman avatar Sep 15 '21 18:09 Eddman

Maybe that was the reason why the flag was not set, because it's supported by both GHEC & GHES, and setting githubCloudOnly to true might be confusing for consumers in GHES.

I think I would recommend to just use octokit.request for now, until we figure this out properly. Introducing methods from GHEC to a GHES environment might cause more problems than it solves.

gr2m avatar Sep 15 '21 18:09 gr2m

+1, could be helpful to implement auto-scaling runners at enterprise level (available in GHES v3.3, partially in GHES v3.2) in Recommended autoscaling solutions => https://github.com/philips-labs/terraform-aws-github-runner/issues/1303

axel3rd avatar Dec 07 '21 18:12 axel3rd