Skip to content

Conversation

@mrueg
Copy link
Contributor

@mrueg mrueg commented Nov 8, 2025

What this PR does / why we need it:
gopkg.in/yaml is unmaintained, this moves the dependency to a maintained yaml library https://github.com/yaml/go-yaml which is also used by https://github.com/kubernetes-sigs/yaml?tab=readme-ov-file#compatibility (which is used in gatekeeper as well)

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

Copilot AI review requested due to automatic review settings November 8, 2025 00:07
@mrueg mrueg requested a review from a team as a code owner November 8, 2025 00:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the gopkg.in/yaml.v2 dependency from the vendored dependencies. The change completely removes all yaml.v2 source files and updates the vendor modules list accordingly.

Key Changes

  • Removed yaml.v2 entry from vendor/modules.txt
  • Deleted all yaml.v2 source files from vendor/gopkg.in/yaml.v2/ directory
  • Removed yaml.v2 README documentation

Reviewed Changes

Copilot reviewed 7 out of 26 changed files in this pull request and generated no comments.

File Description
vendor/modules.txt Removed yaml.v2 v2.4.0 dependency declaration
vendor/gopkg.in/yaml.v2/*.go Deleted all yaml.v2 Go source files including core functionality
vendor/gopkg.in/yaml.v2/README.md Removed yaml.v2 package documentation

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.05%. Comparing base (3350319) to head (db7e875).
⚠️ Report is 551 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (3350319) and HEAD (db7e875). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (3350319) HEAD (db7e875)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4227       +/-   ##
===========================================
- Coverage   54.49%   41.05%   -13.45%     
===========================================
  Files         134      252      +118     
  Lines       12329    17796     +5467     
===========================================
+ Hits         6719     7306      +587     
- Misses       5116     9847     +4731     
- Partials      494      643      +149     
Flag Coverage Δ
unittests 41.05% <ø> (-13.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@JaydipGabani JaydipGabani left a comment

Choose a reason for hiding this comment

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

@mrueg Thanks for the PR!

"strings"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
Copy link
Contributor

Choose a reason for hiding this comment

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

@mrueg should we just move to v4? are there breaking changes from v3 - v4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to keep the change set minimal. v4 hasn't had an official release. latest is https://github.com/yaml/go-yaml/releases/tag/v4.0.0-rc.3

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Contributor

@JaydipGabani JaydipGabani left a comment

Choose a reason for hiding this comment

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

lgtm. @sozercan ptal

"strings"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

@JaydipGabani
Copy link
Contributor

@mrueg can you resolve conflict?

@mrueg
Copy link
Contributor Author

mrueg commented Nov 28, 2025

@mrueg can you resolve conflict?

Rebased.

@sozercan
Copy link
Member

sozercan commented Dec 2, 2025

do we need to vendor this? lgtm otherwise, thanks!

"github.com/open-policy-agent/gatekeeper/v3/pkg/gator/reader"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2" // yaml.v3 inserts a space before '-', which is inconsistent with standard, kubernetes and kubebuilder format. yaml.v2 does not insert these spaces.
"go.yaml.in/yaml/v2" // yaml.v3 inserts a space before '-', which is inconsistent with standard, kubernetes and kubebuilder format. yaml.v2 does not insert these spaces.
Copy link
Member

Choose a reason for hiding this comment

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

can we get rid of this comment now?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrueg can you address this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrueg ping on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the comment.

@JaydipGabani
Copy link
Contributor

@mrueg plesae fix the conflicts.

Copilot AI review requested due to automatic review settings December 10, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

@JaydipGabani
Copy link
Contributor

@mrueg can you address the feedback above?

@mrueg
Copy link
Contributor Author

mrueg commented Dec 11, 2025

@JaydipGabani which one? The one from CoPilot seems to be wrong, as it effectively reverts this change.

@JaydipGabani
Copy link
Contributor

JaydipGabani commented Dec 11, 2025

Ohh nvm, I thought the earlier feedback was not addressed, we can dismiss copilot one. My appologies.

Copilot AI review requested due to automatic review settings January 4, 2026 23:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

"encoding/json"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The import path "go.yaml.in/yaml/v3" appears to be incorrect. The standard maintained YAML library for Go uses the import path "gopkg.in/yaml.v3" (note the period before v3, not a slash). The repository at https://github.com/go-yaml/yaml documents that the correct import paths are:

  • gopkg.in/yaml.v3 for v3
  • gopkg.in/yaml.v2 for v2

Please verify that "go.yaml.in/yaml/v3" is a valid and maintained module. If the intention is to use the standard go-yaml library, the import should be "gopkg.in/yaml.v3" instead.

Suggested change
"go.yaml.in/yaml/v3"
"gopkg.in/yaml.v3"

Copilot uses AI. Check for mistakes.
@JaydipGabani JaydipGabani merged commit c4715a2 into open-policy-agent:master Jan 6, 2026
19 checks passed
OrKarstoft pushed a commit to OrKarstoft/gatekeeper that referenced this pull request Jan 22, 2026
Signed-off-by: Manuel Rüger <[email protected]>
Co-authored-by: Jaydip Gabani <[email protected]>
Signed-off-by: Oliver Karstoft <[email protected]>
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.

4 participants