SilentNul opened a new pull request, #3786:
URL: https://github.com/apache/dubbo-go/pull/3786
Bumps `go.yaml.in/yaml/v4` from `v4.0.0-rc.6` to `v4.0.0-rc.7`, validating
the
release candidate that yaml/go-yaml asked downstreams to test before cutting
v4.0.0 on **November 4, 2026** (#3785, tracking issue yaml/go-yaml#469).
## Why
18 Go files in this repo import `go.yaml.in/yaml/v4` — the important ones
being
`config_center/parser/configuration_parser.go` (central config parsing), the
router rule parsers (`cluster/router/{condition,tag,affinity,script}`), the
REST/gRPC config readers, and the Apollo/getty paths. Two of the 18 live in
the
separate `tools/protoc-gen-triple-openapi` module, one is a test file, and
one
is `tools/benchmark`. That makes dubbo-go a meaningful downstream test
surface
for the parser.
## Changes
- `go.mod`: `go.yaml.in/yaml/v4 v4.0.0-rc.6` → `v4.0.0-rc.7`
- `go.sum`: two lines **added** for rc.7 (the rc.6 lines stay in place,
which is
what `go get` leaves behind)
No other dependency changes: rc.7's `go.mod` file is byte-identical to rc.6's
(same `h1:` for the mod file), so the module graph is unchanged. No `replace`
directive is involved.
`tools/protoc-gen-triple-openapi` (a **separate module** in this repo) is
deliberately **left on rc.6** — see below.
## Verification
Environment: Go 1.25.12, windows/amd64, based on `main` @ 555a9ba.
- `go build ./...` — **passes** for the whole module
- `go test` on every YAML-consuming package — **pass**:
```
ok cluster/router/condition 1.340s
ok cluster/router/tag 0.783s
ok cluster/router/affinity 0.719s
ok config_center/parser 2.944s
ok protocol/rest/config/reader 0.785s
ok protocol/triple/openapi 3.383s
ok protocol/triple/internal/http3config 2.126s
```
- `go vet ./config_center/parser/... ./cluster/router/condition/...` — clean
**Scope, stated honestly:** the full test suite was *not* run locally —
several
packages need docker fixtures (zookeeper / nacos / etcd). What ran is:
full-module
build, tests on the packages above, vet on two of them. CI covers the rest.
## One blocker found: rc.7 breaks `yaml.Dumper` consumers
`tools/protoc-gen-triple-openapi` fails to build on rc.7:
```
github.com/pb33f/[email protected]/datamodel/high/v3/document.go:178:13:
yamlDumper.SetIndent undefined (type *yaml.Dumper has no field or method
SetIndent)
```
Root cause is a change in rc.7 itself, not in libopenapi. In rc.6 `Dumper`
was an
**exported alias** of the internal type, so it carried all its methods:
```go
// rc.6, yaml.go:555
type Dumper = libyaml.Dumper // Dump, Close, SetIndent, SetCompactSeqIndent
```
In rc.7 it became a **wrapper struct** that forwards only two methods:
```go
// rc.7, yaml.go:855-884
type Dumper struct{ dumper *libyaml.Dumper }
func (d *Dumper) Dump(in any) error
func (d *Dumper) Close() error
```
`libopenapi` calls `NewDumper(...).SetIndent(indent)` in
`(*Document).RenderWithIndention`, so it no longer compiles. Bisected
locally:
the same submodule builds cleanly on rc.6 and fails on rc.7.
Upstream report with a minimal reproducer: yaml/go-yaml#469.
That submodule can be bumped in a follow-up once rc.8/v4.0.0 addresses it, or
once libopenapi stops calling the removed methods.
## One behaviour change in rc.7 worth noting
`constructTimestamp` now also handles `string` targets
(`internal/libyaml/constructor.go:416-418`, `case reflect.String` →
`out.SetString(n.Value)`).
Measured on a minimal program (`t: 2020-01-01` into `struct{ T string }`):
```
rc.6: err=yaml: construct errors: line 1: cannot construct !!timestamp
`2020-01-01` into string T=""
rc.7: err=<nil> T="2020-01-01"
```
So this is a real behaviour change: previously such a document failed with a
construct error (and left the field empty), now it decodes to the raw text.
It
is relevant to dubbo-go's config structs, which mix `string` and typed
fields —
in the packages listed above no such document exists, so nothing changed for
us.
No exported signature used by the main module changed; the bump is
source-compatible for us.
Fixes: #3785
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]