-
Notifications
You must be signed in to change notification settings - Fork 170
cmd/cue: add diff support #8
Comments
Any updates on this feature? |
It would be good for people to give examples of how they would like to use this functionality in a CLI. |
Commenting simply to add the word semantic into the mix 😄 I've taken (perhaps incorrectly) to referring to |
Would be nice to have a diff API in cue lib. Currently I'm using However this works if the instances have only concrete values. So a similar API that can diff cue values directly would be nice (and required in my case to be able to use the flow API) |
@eonpatapon take a look at https://pkg.go.dev/cuelang.org/[email protected]/internal/diff. That is internal for now, but as we shape up the API it should be made non-internal. |
A semantic diff would be really interesting. I think with diffing kubernetes files, the most awkward part is the way that the kubernetes API wants to be given a list of yaml objects but the identity of those objects is usually best defined by their name rather than their position in a list. My current idea for diffing them is to write them out into a directory tree where the name of the file is based on the name and type of the object and then using git diff. Then as long as the yaml and all of its fields and lists of named objects are sorted in some stable way, this is good enough for most kubernetes things. |
Adding something of an experience report here from the world of
In the case of point one this will look like:
Some questions:
Stepping back a bit further, we should also be able to write a semantic diff for point 2, on the basis that CUE knows about the semantics of these different formats (even to some extent the different versions of, say, Yaml, JSON). |
This issue has been migrated to cue-lang/cue#8. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Allow diffing between (snapshots of) previous version and current version.
The text was updated successfully, but these errors were encountered: