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

Bump gopkg.in/yaml.v2 to v2.4.0: fixes inconsistent long lines wrapping #62

Merged
merged 1 commit into from Sep 22, 2021

Conversation

akram
Copy link

@akram akram commented Sep 21, 2021

Fixes #54 which is required to fix other issues like:

I have added a test case and tested it with version 2.2.8 of gopkg.in which breaks with:

--- FAIL: TestJSONToYAML (0.00s)
    yaml_test.go:382: converting {"t":"a"}
    yaml_test.go:382: converting {"t":null}
    yaml_test.go:382: converting {"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}
    yaml_test.go:390: Failed to convert JSON to YAML, input: `{"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}`, expected `t: this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80
        `, got `t: this is very long line with spaces and it must be longer than 80 so we will repeat
          that it must be longer that 80
        `
FAIL

using v2.3.0 works well:

=== RUN   TestJSONToYAML
    yaml_test.go:382: converting {"t":"a"}
    yaml_test.go:382: converting {"t":null}
    yaml_test.go:382: converting {"t":"this is very long line with spaces and it must be longer than 80 so we will repeat that it must be longer that 80"}
--- PASS: TestJSONToYAML (0.00s)

@k8s-ci-robot
Copy link

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 21, 2021
@k8s-ci-robot
Copy link

Welcome @akram!

It looks like this is your first PR to kubernetes-sigs/yaml 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/yaml has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 21, 2021
@akram
Copy link
Author

akram commented Sep 21, 2021

/assign @liggitt

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 21, 2021
go.mod Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 21, 2021
@akram akram changed the title Bump gopkg.in/yaml.v2 to v2.3.0: fixes inconsistent long lines wrapping Bump gopkg.in/yaml.v2 to v2.4.0: fixes inconsistent long lines wrapping Sep 21, 2021
yaml.go Outdated Show resolved Hide resolved
yaml_test.go Show resolved Hide resolved
Calls the FutureLineWrap function to globally disable lines wrapping in unit tests.
@akram akram closed this Sep 22, 2021
@akram akram deleted the use-goyaml-2.3.0 branch September 22, 2021 08:53
@akram akram restored the use-goyaml-2.3.0 branch September 22, 2021 10:38
@akram akram reopened this Sep 22, 2021
@liggitt
Copy link

liggitt commented Sep 22, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2021
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akram, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 22, 2021
@k8s-ci-robot k8s-ci-robot merged commit cea7ff5 into kubernetes-sigs:master Sep 22, 2021
@@ -271,6 +271,10 @@ func TestJSONToYAML(t *testing.T) {
`{"t":null}`,
"t: null\n",
nil,
},{
Copy link

@maver1ck maver1ck Sep 22, 2021

Choose a reason for hiding this comment

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

I think this line break lint tests.
https://github.com/kubernetes-sigs/yaml/runs/3676349895

Copy link

Choose a reason for hiding this comment

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

@akram can you format the files in a follow up PR?

Copy link
Author

Choose a reason for hiding this comment

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

sure @liggitt

Copy link
Author

Choose a reason for hiding this comment

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

here it is #63

@karlschriek
Copy link

Is kubernetes-sigs/kustomize#947 supposed to be fixed by this, or something additional still needed?

@karlschriek
Copy link

Nope, this in itself doesn't fix kubernetes-sigs/kustomize#947. I just rebuilt 4.3.0 with sigs.k8s.io/yaml bumped from 1.2.0 to 1.3.0 and still get the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump version of go-yaml to 2.3.0
5 participants