Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use sigs.k8s.io/yaml/goyaml.v* instead of gopkg.in/yaml.v* #21273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mmorel-35
Copy link
Contributor

Description

gomodguard allows to block some dependencies.

This ensure than gopkg.in/yaml.v2 and gopkg.in/yaml.v3 are not used anymore as sigs.k8s.io/yaml provides them both

@mmorel-35 mmorel-35 requested a review from a team as a code owner December 20, 2024 10:56
Copy link

bunnyshell bot commented Dec 20, 2024

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@mmorel-35 mmorel-35 force-pushed the gomodguard/yaml branch 6 times, most recently from 67cb14e to 2a7671b Compare December 20, 2024 22:54
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.23%. Comparing base (8126508) to head (5688d45).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21273      +/-   ##
==========================================
+ Coverage   55.19%   55.23%   +0.03%     
==========================================
  Files         337      337              
  Lines       57058    57058              
==========================================
+ Hits        31496    31517      +21     
+ Misses      22863    22847      -16     
+ Partials     2699     2694       -5     

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

Copy link
Contributor

@andrii-korotkov-verkada andrii-korotkov-verkada left a comment

Choose a reason for hiding this comment

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

Hm, there are some differences in how those handle things. E.g. time.Duration for sigs yaml is expected to be integer in nanoseconds, while for regular yaml it'd be in format like "1h".

@andrii-korotkov-verkada
Copy link
Contributor

Can you add a test with time duration parsing or point at the existing one, please?

@andrii-korotkov-verkada
Copy link
Contributor

Looks like it won't accept ints in new versions as duration https://github.com/kubernetes-sigs/yaml/blob/master/goyaml.v3/decode_test.go#L926. Looks like sigs yaml version 1 is used in Argo CD now. Overall, this would be a breaking change, e.g. in my case there's already a config that specifies nanoseconds int for a duration.

I think this may be a change we want for Argo CD v3. For now, I suggest to only migrate places that use gopkg.in/yaml.*, but keep existing places that use sigs yaml v1 (if any were updated).

@mmorel-35
Copy link
Contributor Author

This PR only moves from gopkg.in/yaml.v* to sigs.k8s.io/yaml/goyaml.v* .
So if I follow you, that's fine ?

@mmorel-35 mmorel-35 changed the title chore: use sigs.k8s.io/yaml only to handle yaml chore: use sigs.k8s.io/yaml/goyaml.v* instead of gopkg.in/yaml.v* Dec 30, 2024
@mmorel-35 mmorel-35 force-pushed the gomodguard/yaml branch 2 times, most recently from fa5dc53 to ab12e09 Compare December 30, 2024 17:18
@andrii-korotkov-verkada
Copy link
Contributor

Yeah, I believe so.

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