go-github icon indicating copy to clipboard operation
go-github copied to clipboard

methods in wrong services

Open zyfy29 opened this issue 2 months ago • 3 comments

https://github.com/google/go-github/blob/06b8b3a37d131dad74fa504c99cb893bcda4ec4e/github/repos_actions_permissions.go#L34-L39

Methods in this file belong to ActionsService but wrongly separated to RepositoriesService.

Also:

https://github.com/google/go-github/blob/06b8b3a37d131dad74fa504c99cb893bcda4ec4e/github/enterprise_actions_hosted_runners.go#L13-L18

and so on.

I'd like to create a pr to fix it, but it will introduce breaking API changes. Is that OK?

zyfy29 avatar Oct 09 '25 04:10 zyfy29

Also,

https://github.com/google/go-github/blob/06b8b3a37d131dad74fa504c99cb893bcda4ec4e/github/orgs_actions_allowed.go#L12-L19

Here provides an alias for the wrong methods. It has been deprecated for nearly 2 years. Is it OK to be removed now?

zyfy29 avatar Oct 09 '25 04:10 zyfy29

So naming is a bit tricky/nuanced/flexible...

We have striven to match the structure in the official GitHub v3 API documentation. However, I must note that we have seen more than one significant reorganization of the official documentation over the years, so this is unfortunately a moving target.

Your first example might make sense to move, however, for your second example, an argument could be made that it is in the correct location due to its relationship to Enterprise.

As for deprecation and removal of methods, we have a serious problem in this repo because we continue to support Enterprise in addition to public GitHub. We have had to revert changes in the past due to requests from Enterprise users.

So I'm very hesitant to move/break/remove things unless there are really good reasons to, which does occasionally happen.

gmlewis avatar Oct 09 '25 11:10 gmlewis

We can leave this issue open in case others have opinions. If there is enough interest for particular methods, we can entertain moving them into their proper places. Otherwise, i think it is best to wait on this.

gmlewis avatar Oct 09 '25 14:10 gmlewis