Skip to content

Migrate YAML library to goccy/go-yaml - #56

Merged
apstndb merged 2 commits into
mainfrom
feat/goccy-go-yaml
Jun 28, 2026
Merged

apstndb merged 2 commits into
mainfrom
feat/goccy-go-yaml

Conversation

@apstndb

@apstndb apstndb commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace gopkg.in/yaml.v3 with github.com/goccy/go-yaml v1.19.2 for --param-file parsing and --format=yaml output.
  • Keep 4-space YAML indent and TIMESTAMP wrapping for RFC3339 param-file strings.
  • Refresh YAML golden files for goccy formatting differences.

Test plan

  • go test ./...
  • CI green

Made with Cursor

Use Indent(4) on the YAML encoder and preserve TIMESTAMP wrapping for
RFC3339 strings in param files; refresh output goldens.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the gopkg.in/yaml.v3 dependency with github.com/goccy/go-yaml, updating the YAML encoder configuration to use a 4-space indentation and modifying several golden test files accordingly. It also introduces logic to parse RFC3339Nano strings as TIMESTAMP literals. The review feedback highlights two main issues: first, unconditionally converting RFC3339-compliant strings to TIMESTAMP literals introduces a regression where users can no longer pass actual STRING parameters containing timestamps; second, the new yaml.Encoder implements io.Closer and should be properly closed in the caller to ensure buffered data is flushed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread params/load.go Resolved
Comment thread main.go Resolved
Parse YAML param values via RawMessage so quoted RFC3339 strings stay
STRING literals while unquoted timestamps become TIMESTAMP wrappers.
Defer encoder Close in jq output paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@apstndb

apstndb commented Jun 28, 2026

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the gopkg.in/yaml.v3 dependency with github.com/goccy/go-yaml and updates the YAML encoder configuration to use a 4-space indent, which updates several golden test files. It also introduces proper encoder closing via a new Close method and closeEncoder helper, and refactors parameter loading to better handle quoted strings and timestamps in YAML files. Feedback suggests adding a defensive nil check to the Close method of stringPassThroughEncoderWrapper to prevent potential nil pointer dereferences.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread main.go Resolved
@apstndb
apstndb merged commit dcf0551 into main Jun 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant