google / google/go-github

Move compatibility for non github.com targets to `github.With<THING>` options

オープン
#4,237 コメント 6 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
11.3k
フォーク
2.5k
平均マージ
1日 20時間
マージ済み PR(30日)
52

説明

I propose that all compatibility functionality not required for the github.com target be removed from the default client setup and only be included via a `github.With` option. This (hopefully) would make the default client surface area simpler to understand. The justification for this is that you already need to use `github.WithEnterpriseURLs` to target non github.com. I propose the following changes to adopt this pattern, with the potential for other capabilities (such as enabling/disabling preview endpoints) to be added later.

- Default to the latest API version (`2026-03-10`)
- Functions that require a specific version now check against the client version and error if not valid
- Add `github.WithAPIVersion` to explicitly set a version
- Set at the client/service level
- Add `github.WithAdvancedServer` to enable GHAS support
- Better validation of inputs
- Support setting version
- Add compatibility accordingly
- Add `github.WithEnterpriseCloud` to enable GHEC support
- Better validation of inputs
- Deprecate `github.WithEnterpriseURLs`

I'd appreciate any feedback on this proposal.

cc: @gmlewis - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、デフォルトのクライアント設定、既存の github.WithEnterpriseURLs オプション、および提案で説明されている互換性チェックを確認します。API バージョンと github.com 以外のターゲットが現在どのように設定されているかを追跡します。WithAPIVersion、WithAdvancedServer、WithEnterpriseCloud に提案されている動作が一貫して設計・実装され、非推奨のオプションが処理されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go
領域
api, backend-api-design
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。