Use //go:fix inline for deprecated storage backends and migrate off deprecated pipeline APIs

Aperta
#1,583 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Inizia con go.mod e le definizioni obsolete di Backend in pkg/chains/storage/tekton/tekton.go, pkg/chains/storage/gcs/gcs.go e pkg/chains/storage/oci/legacy.go. Controlla tektoncd/pipeline#9560 prima di eseguire go fix ./... per identificare le migrazioni abilitate dalla dipendenza. Il lavoro è completato quando è richiesto Go 1.26 e le API di storage obsolete applicabili e gli utilizzi della pipeline sono stati migrati o annotati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/cleanup

Description

Go 1.26 introduced //go:fix inline — a directive that allows go fix and IDEs to automatically rewrite call sites of deprecated functions, type aliases, and variables to their modern replacements. See the Go blog post for details.

There are two sides to this for tektoncd/chains:

  1. As a consumer: Once tektoncd/pipeline adds //go:fix inline annotations to its deprecated APIs, chains can run go fix ./... to auto-migrate (e.g. v1beta1 type aliases, deprecated resolution APIs).

  2. As a library: chains has its own deprecated types that could benefit from annotation.

Prerequisite

Bump go.mod to Go 1.26 (currently at 1.25.5).

Opportunities

Deprecated Storage Backends

The following storage backends are deprecated in favor of Storer:

  • pkg/chains/storage/tekton/tekton.go — Backend struct (deprecated, use Storer instead)
  • pkg/chains/storage/gcs/gcs.go — Backend struct
  • pkg/chains/storage/oci/legacy.go — Backend struct

If there are constructor functions like NewStorageBackend() that simply wrap the new API, those can be annotated with //go:fix inline:

// Deprecated: use NewStorer instead.
//
//go:fix inline
func NewStorageBackend(ps versioned.Interface) *Backend {
	return &Backend{pipelineclientset: ps}
}
Consuming pipeline's annotations

Once tektoncd/pipeline annotates its deprecated APIs (tektoncd/pipeline#9560), running go fix ./... in chains will automatically migrate:

  • v1beta1.ArrayOrString → v1beta1.ParamValue
  • Deprecated resolution package imports
  • Other deprecated type aliases and wrapper functions

References

Lingua principale
Go
Stelle
279
Fork
171
Merge medio
2g 4h
PR unite (30g)
70

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tektoncd/chains

Tutte le issue di tektoncd/chains

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.