Use //go:fix inline and go fix to modernize codebase
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- go
- 領域
- build-system, tooling
調査の方向性
go.mod から始め、pkg/client/informers/externalversions/factory.go と pkg/apis/operator/v1alpha1/ 配下の非推奨 API 型を確認した後、go fix ./... を実行します。結果として生じた変更を issue #9560 のパイプライン前提条件と照合して確認し、その後リポジトリのテストを実行します。Go 1.26 への移行、該当するアノテーション、およびモダナイゼーションが確認・検証済みであれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
Go 1.26 introduced a rewritten go fix subcommand with a source-level inliner. The //go:fix inline directive allows annotating deprecated functions, type aliases, and variables so that go fix (or IDEs) automatically rewrite call sites to the modern replacement.
For tektoncd/operator this is relevant in two ways:
-
As a consumer: Once tektoncd/pipeline adds
//go:fix inlineannotations to its deprecated APIs, operator can rungo fix ./...to auto-migrate usage of deprecated pipeline types and functions. -
Own deprecated APIs: operator has deprecated fields and generated code that could be annotated.
Prerequisite
Bump go.mod to Go 1.26 (currently at 1.25.5).
Opportunities
Own Deprecated APIs
The generated informer factory has the common deprecated wrapper pattern:
// pkg/client/informers/externalversions/factory.go
// Deprecated: Please use NewSharedInformerFactoryWithOptions instead
//
//go:fix inline
func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory {
return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions))
}
Deprecated fields in the operator API types (pkg/apis/operator/v1alpha1/) could also benefit from annotation where applicable.
Consuming pipeline's annotations
Once tektoncd/pipeline annotates its deprecated APIs (tektoncd/pipeline#9560), running go fix ./... in operator will automatically migrate:
- Deprecated type aliases (e.g.
ArrayOrString→ParamValue) - Deprecated wrapper functions
- Deprecated resolution package imports
Go 1.26 built-in modernizers
Beyond //go:fix inline, Go 1.26's go fix ships with 24+ built-in modernizers that automatically apply improvements like using slices.Sort, min/max builtins, strings.Cut, and more. Running go fix ./... after bumping to Go 1.26 would apply all applicable modernizations.
References
- //go:fix inline and the source-level inliner
- Using go fix to modernize Go code
- Related: tektoncd/pipeline#9560
- 主要言語
- Go
- スター
- 606
- フォーク
- 270
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 159
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tektoncd/operator のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 4/5 1週間以上 初心者へのやさしさ 30/100
tektoncd/operator#4275 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
tektoncd/operator#3977 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Support trusted provider hostnames for Pipelines as Code対応中かも @jkhelil が 35 日前に担当しました。 オープンarea/dependency kind/feature
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
tektoncd/operator#3946 · コメント 1 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
tektoncd/operator#3922 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
tektoncd/operator の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[FEATURE]: Set fieldPath and reason on the CEL validation rules対応中かも @bjosv が今日担当しました。 オープンenhancement needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
valkey-io/valkey-operator#618 ·
メンテナーはふだん 3 日以内に返信
-
agent-butler-finding bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jordansmall/spindrift#6414 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Icinga/icinga-kubernetes#294 ·
メンテナーはふだん 4 日以内に返信
-
Cluster details: the Control Plane version field has a different border color than its icon boxオープンkind/design sig/ui
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kubermatic/dashboard#8449 ·
メンテナーはふだん 1 日以内に返信