Repository navigation
Conversation
vacuum v0.32.0+ requires pb33f/jsonpath v0.8.4, which switched its YAML
node type from go.yaml.in/yaml/v4 to github.com/pb33f/go-yaml. Since Go
module resolution selects a single jsonpath for the build, go-apiops was
compiled against the new one and failed to type-check wherever a node
crossed the jsonpath or libopenapi boundary:
cannot use *go.yaml.in/yaml/v4.Node
as *github.com/pb33f/go-yaml.Node
This blocked the vacuum upgrade in both deck (Kong/deck#2299) and
kongctl (Kong/kongctl#2549).
Switch the yaml import across the 20 affected files and move to the
first releases on the new node type: jsonpath v0.8.4 and libopenapi
v0.41.6. The package selector stays `yaml.`, and every symbol in use is
present in the fork, so no logic changes were needed.
BREAKING CHANGE: *yaml.Node in the exported API is now
github.com/pb33f/go-yaml rather than go.yaml.in/yaml/v4. This affects
~40 exported functions and methods plus yamlbasics.NodeSet,
YamlArrayMatcher and YamlArrayIterator. Consumers that name the type
must swap their own import.
BREAKING CHANGE: the minimum Go version is now 1.26, required by
libopenapi v0.41.x.
Verified output is unchanged: all package tests pass, and against the
pre-migration build the generated fixtures (62) and decK-format YAML
output over 60 real config files (147 invocations of add-tags,
remove-tags, list-tags, patch and merge) are byte-identical, including
a case covering comments, anchors, merge keys, flow style, block
scalars and non-ASCII scalars.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #305 +/- ##
=======================================
Coverage 58.82% 58.82%
=======================================
Files 36 36
Lines 3869 3869
=======================================
Hits 2276 2276
Misses 1380 1380
Partials 213 213 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The v2.8.0 release binary is built with Go 1.25 and refuses to load a
config whose module targets a newer Go version:
can't load config: the Go language version (go1.25) used to build
golangci-lint is lower than the targeted Go version (1.26.0)
v2.9.0 is the earliest release built with Go 1.26, and reports no new
issues on this codebase. Later releases do (v2.11.4 surfaces four
pre-existing gosec findings), so keep the bump minimal here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
Migrates go-apiops' YAML node type from
go.yaml.in/yaml/v4togithub.com/pb33f/go-yaml, and moves to the first releases built on that type:pb33f/jsonpathv0.8.4 andpb33f/libopenapiv0.41.6.Why
vacuumv0.32.0+ requirespb33f/jsonpathv0.8.4, which switched its YAML node type fromgo.yaml.in/yaml/v4togithub.com/pb33f/go-yaml. Go module resolution selects a singlejsonpathfor the build, so go-apiops gets compiled against the new one and fails to type-check wherever a node crosses thejsonpathorlibopenapiboundary:Every failing line is inside go-apiops, so this cannot be worked around downstream — Go type identity is per-package-path, and
replacedirectives in a library'sgo.modare ignored by consumers.This currently blocks the vacuum upgrade in two repos:
Both produce the same 7 errors, all of this one class, in
deckformat/entitypointers.go,openapitools/utils.goandyamlbasics/selectors.go.How
The package selector stays
yaml., and every symbol in use (Node,Kind,DocumentNode,SequenceNode,MappingNode,ScalarNode,AliasNode,DoubleQuotedStyle,FlowStyle,Marshal,Unmarshal) exists in the new module, so this is an import-path change across the 20 affected files plusgo.mod/go.sum— no logic changes. Same shape as b19ff9c ("Upgrade to yaml.v4").The libopenapi API surface used here is additive-only across v0.33.0 → v0.41.6: the eight
datamodel/high/v3structs have identical field sets,base.SchemaProxyonly gained methods, anddatamodel.DocumentConfigurationonly gained fields (both flags set here are unchanged).Breaking changes
*yaml.Nodein the exported API is nowgithub.com/pb33f/go-yaml. Affects ~40 exported functions and methods, plusyamlbasics.NodeSet,YamlArrayMatcherandYamlArrayIterator. Consumers that name the type must swap their own import. decK does not (it never spells the type, so it needs only ago.modbump); kongctl does, in roughly 12 files starting withinternal/cmd/root/verbs/patch/file.go.go-version-file: go.mod.Suggest releasing as v0.5.0 rather than a patch, so
go get -udoes not adopt it silently.Validation
go build,go vet,gofmtandgolangci-lint(0 issues) are clean, and all package tests pass.The Go 1.26 floor also required bumping the pinned
golangci-lintin CI: the v2.8.0 release binary is built with Go 1.25 and refuses to load a config targeting a newer Go version. v2.9.0 is the earliest release built with Go 1.26 and reports no new issues here; later releases do (v2.11.4 surfaces four pre-existinggosecfindings), so the bump is kept minimal.The underlying YAML engine does change —
internal/libyamldiffers by ~9,100 lines between the rc.4 in use here and upstream rc.6, and by a further ~670 lines in the fork — so output was compared byte-for-byte against a build ofmain:openapi2kongandopenapi2mcp: identicaladd-tags,remove-tags,list-tags,patch,merge) over 60 real decK config files: identicalDownstream, decK builds and passes its unit tests and lint integration tests against this branch with no source changes — including the cases that exercise vacuum's built-in
recommendedruleset, which needed no golden-file updates. decK's Kong-backed integration suite was not run locally (no Docker available); it does not touch this code path, but CI on the decK PR will cover it.🤖 Generated with Claude Code