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

should fromCredentials not be public?

Open maxandersen opened this issue 10 months ago • 5 comments

Describe the bug GithubBuilder.fromCredentials is not public and given the auth provider field is not public it is not possible to implement the "honor .github and env" manually.

Thus should that method not be public?

maxandersen avatar Feb 22 '25 20:02 maxandersen

You can use GitHub.connect().

gsmet avatar Feb 23 '25 08:02 gsmet

GitHub.connect() calls builds immediately so can't hook in the okhttp caching connector when using that afaics.

maxandersen avatar Feb 23 '25 08:02 maxandersen

@maxandersen
I'm marking this as bug for now, but I'm not sure of the right answer yet. I don't know if GithubBuilder.fromCredentials should be public or if it was intended only as a convenience method. I might not have wanted to make it public because the behavior was poorly defined or hard to test. Needs some digging.

bitwiseman avatar Feb 24 '25 18:02 bitwiseman

@bitwiseman sounds good. mind you - before the change of how auth works I could have implemented it without use of this method but for now I can't as no way to detect if the fromEnv etc. setup had an effect or not.

maxandersen avatar Feb 25 '25 12:02 maxandersen

@maxandersen I'm open to a PR if you have a suggestion for how to address this issue.

bitwiseman avatar Mar 23 '25 07:03 bitwiseman