Repository navigation
Switch from gopkg.in/yaml.v3 to go.yaml.in/yaml/v3 - #497
Merged
Merged
Conversation
gopkg.in/yaml.v3 is archived and unmaintained; go.yaml.in/yaml/v3 is its maintained continuation under the YAML organization, with the same v3 API. Replace every import, make go.yaml.in/yaml/v3 a direct requirement (go mod tidy drops gopkg.in/yaml.v3 from go.mod), and add a depguard rule, test files included, so the old path is not auto-imported back. registry.ImageMetadata and registry.RemoteServerMetadata now implement UnmarshalYAML with go.yaml.in/yaml/v3's Node, so their custom unmarshaling runs for callers that decode with go.yaml.in/yaml/v3. Fixes #493 Co-Authored-By: Claude Opus 5.5 <[email protected]>
reyortiz3
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #493
Summary
gopkg.in/yaml.v3import (3 packages, 4 test files) withgo.yaml.in/yaml/v3, the maintained continuation of the archived go-yaml project, with the same v3 API.go.yaml.in/yaml/v3becomes a direct requirement;go mod tidydropsgopkg.in/yaml.v3fromgo.mod(it stays in the module graph only through a sigstore/rekor test dependency).archived_yaml, test files included) that rejectsgopkg.in/yaml.v3, since it is still in the module graph and editors can auto-import it.Note for consumers:
registry.ImageMetadataandregistry.RemoteServerMetadataimplementUnmarshalYAML(*yaml.Node)to flatten the embeddedBaseServerMetadatafields. The node type is nowgo.yaml.in/yaml/v3's, so these custom unmarshalers run when the caller decodes withgo.yaml.in/yaml/v3and not withgopkg.in/yaml.v3(until now it was the reverse). A code search over the stacklok org finds no production code decoding these types from YAML; toolhivemainalready requiresgo.yaml.in/yaml/v3directly.Benefit (measured)
Two throwaway consumer modules built against
mainand against this branch (replaceto each checkout,go mod tidy,go run):maingo.modof a consumer that only usesconfig.Decoderequire gopkg.in/yaml.v3 v3.0.1 // indirectrequire go.yaml.in/yaml/v3 v3.0.6 // indirectconfig.Decodeof a valid documentconfig.Decodewith an unknown keyprotline 3: field prot not found in type main.appConfigImageMetadatadecoded withgo.yaml.in/yaml/v3name="",description="",tier=""(base fields lost)name="fetch",description="Fetches URLs",tier="Official"Test plan
.gofile importsgopkg.in/yaml.v3(grep -rn '"gopkg.in/yaml.v3"' --include='*.go' .is empty).gopkg.in/yaml.v3fails 6registry/typestests (the YAML round-trips lose the base fields), so these tests pin the switch.gopkg.in/yaml.v3; in non-test code the build already fails becausego.modno longer requires it.task lint,task license-check,task redisconn-modules(nested modules unchanged).go test -race ./...green apart fromnetworkingTestValidateCallbackPort, which needs port 8090 free and was held by another process on the machine that ran it.🤖 Generated with Claude Code