Conversation
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In util/yaml/yaml.go, Unmarshal currently calls goyaml.Unmarshal(b, &res), which will pass a pointer to the interface instead of the underlying value; this should likely be goyaml.Unmarshal(b, res) so callers can pass their destination directly.
- Consider extending the util/yaml package to expose Encoder/Decoder helpers (e.g., NewEncoder/NewDecoder) so that call sites like settings.SetYaml can consistently use the wrapper instead of mixing direct goyaml usage with the custom Unmarshal behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In util/yaml/yaml.go, Unmarshal currently calls goyaml.Unmarshal(b, &res), which will pass a pointer to the interface instead of the underlying value; this should likely be goyaml.Unmarshal(b, res) so callers can pass their destination directly.
- Consider extending the util/yaml package to expose Encoder/Decoder helpers (e.g., NewEncoder/NewDecoder) so that call sites like settings.SetYaml can consistently use the wrapper instead of mixing direct goyaml usage with the custom Unmarshal behavior.
## Individual Comments
### Comment 1
<location path="util/yaml/yaml.go" line_range="14-15" />
<code_context>
+}
+
+// Unmarshal invokes unmarshaler, ignoring empty document errors
+func Unmarshal(b []byte, res any) error {
+ err := goyaml.Unmarshal(b, &res)
+ if err != nil && strings.Contains(err.Error(), "no documents in stream") {
+ err = nil
</code_context>
<issue_to_address>
**issue (bug_risk):** Unmarshal is unmarshalling into a copy of `res` instead of the caller’s value
Here `res` should be passed directly to `goyaml.Unmarshal`. Because `res` is already a pointer to the target value, using `&res` gives `Unmarshal` a `*interface{}` (or pointer-to-`any`), so it only populates that temporary rather than the caller’s value. This means the caller observes no changes. Use `goyaml.Unmarshal(b, res)` instead.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
andig
commented
May 6, 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.
Fix #29672 (for real)