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

[v3] Improve empty document handling #690

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

Conversation

felixfontein
Copy link

Parts of #684 that haven been fixed by @niemeyer in the meantime.

Thanks, but we need to have all tests either in node_test.go or in the respective test files, using existing conventions. We have plenty of tests and test files already.

So far I found exactly one test for multi-document reading and writing, namely TestEncoderMultipleDocuments in encode_test.go. Where should I put the multi-document decoding and encoding tests with Node?

@felixfontein
Copy link
Author

@niemeyer if you have time, could you at least take a quick look at the tests? Where should I put multi-document tests? Is a new file ok for that?

@niemeyer
Copy link
Contributor

@felixfontein Thanks for the changes. Node test seems nice. We still need to move those tests in yaml_test.go into their respective files. If you have a look around encode_test.go and decode_test.go you'll probably spot the patterns already in use.

@felixfontein felixfontein force-pushed the improve-empty-document-handling branch from 89c04e8 to 3cebf96 Compare January 30, 2021 15:33
@felixfontein felixfontein mentioned this pull request Jan 30, 2021
@felixfontein
Copy link
Author

@niemeyer CI is failing with Error: Unable to find Go version '1.16.0-beta1' for platform linux and architecture x64..

@felixfontein
Copy link
Author

Restarting CI.

@niemeyer
Copy link
Contributor

niemeyer commented May 8, 2021

@felixfontein Sorry for being slow here. I'll reserve some time soon to do another push on go-yaml.

@felixfontein
Copy link
Author

@niemeyer I mainly wanted to re-run tests to see whether the semgrep issue is still around, but now it looks like you (or someone else) has to manually enable the workflow for this PR (GitHub changed policies for GHA to combat folks abusing GHA for crypto mining...).

@felixfontein
Copy link
Author

@niemeyer but thanks for trying to take another look at this :)

@lollipopman
Copy link

@felixfontein & @niemeyer this pull request seems to work correctly against the current v3 branch, is it ready to be merged or is more work required? Would love to be able to preserve comments in empty yaml docs! Thanks!

@felixfontein
Copy link
Author

@lollipopman from my point of view, it is working correctly and can be merged. I'm not that familiar with the code base, though, so maybe I'm missing something. That's why it needs a review.

@glopal
Copy link

glopal commented Apr 24, 2022

@felixfontein @lollipopman Any update on this one? It looks like the build has some failures. Been waiting on this PR for a while now.

@felixfontein
Copy link
Author

@glopal IIRC the CI errors were unrelated to this PR. From my side this PR is still ready. It still needs review by the maintainer.

@pivotaljohn
Copy link

pivotaljohn commented Apr 29, 2022

In a delightful display of dominoes, merging and releasing this fix has the effect of making SOPS work seemlessly with ytt which is a growing combination among those plumbing sensitive data straight through processing pipelines (like folks doing automated deploys to Kubernetes). It currently takes a hack.

This is a subtly valuable fix for a (expanding) group I can point at.

Thanks for all your efforts, @felixfontein!! 🙏🏻

@felixfontein felixfontein force-pushed the improve-empty-document-handling branch from 35d69a4 to af49682 Compare May 31, 2022 18:10
@felixfontein
Copy link
Author

@niemeyer I rebased since I saw that the broken workflow is gone.

@felixfontein felixfontein force-pushed the improve-empty-document-handling branch from af49682 to 21e0769 Compare June 1, 2022 05:07
Copy link

@pieterocp pieterocp left a comment

Choose a reason for hiding this comment

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

One could probably un-comment the two tests in stores/yaml/store_test.go, unless they must only be un-commented post-merge? (Ignore me, different projects, brain-fart)

@pieterocp
Copy link

Any contributors willing to re-review this or does it need a rebase? Be nice to get this into 3.1.0 maybe

@felixfontein
Copy link
Author

It's already rebased to the current v3 branch. The last change to the v3 branch was two years ago.

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.

6 participants