refactor!: remove go-github dependency and implement internal GitHub API client #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove go-github Dependency and Implement Internal GitHub API Client
Summary
This PR eliminates the
github.com/google/go-github/v74dependency by implementing a lightweight internal GitHub API client. The change reduces external dependencies while maintaining 100% API compatibility with existing code.Motivation
Changes
New File:
github.goInstallationTokenOptions- configuration for installation token requestsInstallationPermissions- comprehensive permission structureInstallationToken- GitHub API response typeRepository- minimal repository representationgithubClientwith:withEnterpriseURL()ptr[T]()helper for creating pointersModified:
auth.gogithub.com/google/go-github/v74/githubimportWithEnterpriseURLs()toWithEnterpriseURL()(single base URL parameter)Modified:
auth_test.gogo-githubimport from testsgithub.Ptr()with localptr()helperModified:
go.modandgo.sumgithub.com/google/go-github/v74 v74.0.0github.com/google/go-querystring v1.1.0API Compatibility
✅ No breaking changes - The public API remains unchanged:
NewApplicationTokenSource()- unchangedNewInstallationTokenSource()- unchangedNewPersonalAccessTokenSource()- unchangedWithInstallationTokenOptions()- type change but same usage patternWithEnterpriseURL()- simplified fromWithEnterpriseURLs()(removed redundant upload URL parameter)Testing
All existing tests pass without modification:
Benefits
Migration Notes for Users
For Most Users
No action required - this change is transparent to existing code.
For Enterprise GitHub Users
If you were using
WithEnterpriseURLs(baseURL, uploadURL):For Type Users
If you were directly referencing
github.InstallationTokenOptions:Verification