Skip to content

Conversation

yxxhero
Copy link
Member

@yxxhero yxxhero commented May 15, 2025

This pull request updates the YAML library used in Helmfile from goccy/go-yaml to gopkg.in/yaml.v3, along with associated code changes to reflect this migration. It removes support for goccy/go-yaml and its related functionality, ensuring that yaml.v3 is the default library in Helmfile v1.x. The changes span multiple files, including configuration, runtime logic, tests, and documentation.

YAML Library Migration:

  • Updated the YAML library from goccy/go-yaml to gopkg.in/yaml.v3 across the codebase. (pkg/runtime/runtime.go, pkg/yaml/yaml.go, go.mod) [1] [2] [3]
  • Removed the environment variable HELMFILE_GOCCY_GOYAML and replaced it with HELMFILE_GO_YAML_V3 to toggle between yaml.v2 and yaml.v3. (pkg/envvar/const.go, docs/index.md) [1] [2]
  • Modified YAML encoding and decoding methods to use yaml.v3 features, including strict field validation and indentation settings. (pkg/yaml/yaml.go)

Test Updates:

  • Updated test cases to reflect the migration to yaml.v3, including renaming variables and test descriptions. (pkg/app/app_test.go, pkg/app/app_template_test.go, pkg/tmpl/context_funcs_test.go, pkg/yaml/yaml_test.go) [1] [2] [3] [4]
  • Removed tests and functionality related to JSON-style YAML encoding, which was specific to goccy/go-yaml. (pkg/tmpl/context_funcs_test.go)

Documentation Updates:

  • Updated the documentation to reflect the removal of goccy/go-yaml and the introduction of yaml.v3 as the default YAML library. (docs/index.md)

Dependency Management:

  • Removed goccy/go-yaml from direct dependencies and added gopkg.in/yaml.v3 to the project. (go.mod) [1] [2]

These changes ensure compatibility with yaml.v3 while simplifying the codebase by removing support for goccy/go-yaml.

Signed-off-by: yxxhero <aiopsclub@163.com>
yxxhero added 5 commits May 15, 2025 08:55
…quotes

Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Copy link
Contributor

@zhaque44 zhaque44 left a comment

Choose a reason for hiding this comment

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

Looks good...

@zhaque44 zhaque44 merged commit b52ca9a into main May 15, 2025
16 of 21 checks passed
@zhaque44 zhaque44 deleted the set-gopkg.in/yaml.v3-as-the-default branch May 15, 2025 14:21
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.

2 participants