-
Notifications
You must be signed in to change notification settings - Fork 889
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
Consolidate Flatten/Unflatten pre/post processing #1356
Conversation
If you merge this one, do not merge #1355. Just one or the other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I like the general idea, though I would avoid breaking backwards compatibility (Flatten
/Unflatten
signatures) and would make it more modular. What do you (and also others) think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favor of this solution, but would prefer it not breaking signatures of existing functions.
@felixfontein I'll make the suggested changes. Should take me about an hour. (phantom edit, never mind the second sentence) @hiddeco Do we still want to leave the functions exported (capital function name)? There are no callers outside of the package. |
9657857
to
7ba2e29
Compare
@felixfontein / @hiddeco The suggested changes are in.
Let me know if there you need any additional changes. |
🤔 Thinking more about the Metadata encoding for the 🤔 🤔 I wonder if it might be advantageous to encode it as one line of json? or even json base64 encoded? It would eliminate the I'm not advocating the json (w/ or w/o base64). Just thinking of alternatives that would be more robust. Just something to think about for the next major version. Anyway, thank you for a great tool. I'm making a lot of use it in container images. |
7ba2e29
to
8bf7923
Compare
@felixfontein / @hiddeco Do I need to keep this branch up to date with main? (I did not see any recommendations in CONTRIBUTING.md) |
@lancerushing I think that's only necessary in case of conflicts; we can simply rebase before merging with the UI (at least as long as there are no conflicts and rebase just runs through). |
One addition to "less readable" is that diffs are no longer useful. Right now if some metadata changes (for example you add a new key, or remove one), you can easily see what happens from the diff. That wouldn't be possible anymore. Also changing the way how metadata is stored would break backwards compatibility, so for some time we would have to support both the old and new way how metadata is stored. Having generic code for such stores that allow to flatten/unflatten metadata and do other operations (like handling formats where every value is a string) is probably the best way forward. |
Thanks for the all the discussion. Do we have an ETA when we this could be merged? Thank you again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention 'metadata' in these comments. Besides that, LGTM!
732d46e
to
df900c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the lack of doc blocks, I am happy with this implementation.
Anything I need to do to get the PR merged? |
@lancerushing if you could add doc blocks to the functions which do not have one, then this should be good to go. |
Done. Added comments for the new functions that were missing comments. -Thank you, Lance |
Fixes getsops#1353 Consolidate the common json marshalling and \n handing to stores/flatten.go Make existing functions unexported. Add casts for MACOnlyEncrypted Signed-off-by: Lance Rushing <lance@lancerushing.com>
Signed-off-by: Lance Rushing <lance@lancerushing.com>
Signed-off-by: Lance Rushing <lance@lancerushing.com>
Signed-off-by: Lance Rushing <lance@lancerushing.com>
Signed-off-by: Lance Rushing <lance@lancerushing.com>
962c556
to
7d90cf2
Compare
@lancerushing thank you very much for fixing this! |
🎉 Thank you for the merge and a great project! Let me know if I can help with anything else. |
Fixes #1353
Consolidate the common json marshalling and \n handing to stores/flatten.go
Make existing functions unexported.
Add casts for MACOnlyEncrypted.
When I was investigating #1353 I noticed code duplication in
dotenv/store.go
andini/store.go
. It seemed cleaner to consolidate the the code.