tektoncd / tektoncd/chains

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

Open
#1,583 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/cleanup
Dominant language
Go
Stars
277
Forks
164
Avg merge
2d 3h
Merged PRs (30d)
61

Description

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.goBackend struct (deprecated, use Storer instead)
  • pkg/chains/storage/gcs/gcs.goBackend struct
  • pkg/chains/storage/oci/legacy.goBackend 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.ArrayOrStringv1beta1.ParamValue
  • Deprecated resolution package imports
  • Other deprecated type aliases and wrapper functions

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with go.mod and the deprecated Backend definitions in pkg/chains/storage/tekton/tekton.go, pkg/chains/storage/gcs/gcs.go, and pkg/chains/storage/oci/legacy.go. Check tektoncd/pipeline#9560 before running go fix ./... to identify migrations enabled by the dependency. Done means Go 1.26 is required and the applicable deprecated storage APIs and pipeline usages are migrated or annotated.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.