Skip to content

chore(deps): replace archived gopkg.in/yaml.v2 with go.yaml.in/yaml/v3 - #422

Merged
benjaminjkraft merged 4 commits into
Khan:mainfrom
levenleven:levenleven/chore/replace-yaml-v2-with-maintained-fork
Aug 8, 2026
Merged

benjaminjkraft merged 4 commits into
Khan:mainfrom
levenleven:levenleven/chore/replace-yaml-v2-with-maintained-fork

Conversation

@levenleven

Copy link
Copy Markdown
Contributor

gopkg.in/yaml.v2 is archived. This swaps genqlient's config parsing to the maintained go.yaml.in/yaml/v3 (the YAML organization's successor to gopkg.in/yaml.v3).

The migration is behavior-preserving vs yaml.v2, verified by comparing both libraries on genqlient's config shape:

  • YAML 1.1 booleans (yes/no/on/off) still decode to bools
  • octal-looking strings (e.g. 0777) stay strings, not coerced to ints
  • unknown fields are still rejected (KnownFields(true) replaces UnmarshalStrict)
  • empty/comment-only config files still parse to an empty config
  • StringList's obsolete UnmarshalYAML is unchanged (v3 still supports it)

A new testdata/validConfig/YAML11Booleans.yaml fixture locks in the boolean and octal-string parity.

Note: the transitive gopkg.in/yaml.v3 remains, pulled in only by test-only deps (gqlgen, gqlparser, testify); it will drop once those upstreams migrate.

@levenleven
levenleven force-pushed the levenleven/chore/replace-yaml-v2-with-maintained-fork branch from 7949741 to 4bed409 Compare July 17, 2026 14:21
@levenleven
levenleven marked this pull request as ready for review July 17, 2026 14:21

@ccoVeille ccoVeille 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.

yaml/go-yaml maintainer here

Thanks for migrating to the maintained lib.

One minor remark, otherwise LGTM 👍

Comment thread generate/config.go Resolved
gopkg.in/yaml.v2 is archived. Switch config parsing to the maintained
go.yaml.in/yaml/v3 (the YAML org's successor to gopkg.in/yaml.v3), which
preserves yaml.v2 behavior: YAML 1.1 booleans (yes/no/on/off), octal-looking
strings, strict unknown-field rejection, and the obsolete StringList
unmarshaler. UnmarshalStrict is replaced by a decoder with KnownFields(true),
treating an empty file as an empty config.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@levenleven
levenleven force-pushed the levenleven/chore/replace-yaml-v2-with-maintained-fork branch from 4bed409 to bf3c691 Compare July 18, 2026 08:12

@benjaminjkraft benjaminjkraft left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As a check that the package is legit, it's used by e.g. dd-agent: https://github.com/DataDog/datadog-agent/blob/pkg/config/schema/v0.82.0/pkg/config/schema/go.mod. Beyond that, should be good if tests pass.

Comment thread generate/config.go Resolved
@benjaminjkraft
benjaminjkraft merged commit f53a04c into Khan:main Aug 8, 2026
5 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.

3 participants