flux2
flux2 copied to clipboard
Allow diffing of two OCI artifacts
To help people to gather an idea about the difference between two artifacts, we could introduce a flux diff artifact <URL1> <URL2>
command which provides a (Git like) diff of the differences within the compressed tar+gzip
layers of the Artifact images.
To build this functionality, we need to decide on the diff library that should be used. Theoretically, we could piggy back on the diff utility library from go-git in combination with DiffPrettyText
. However, there are discussions at present to replace this due to certain issues.
An additional thing to take into account is that full decompression of <URL1>
and/or <URL2>
to disk may not be required, but that we rather iterate over the contents using tar#NewReader
in combination with reading the file contents from the current tar#Header
using io.Copy(out, reader)
.
/assign
@sbdtu5498 we don't have automation for assignments in place here. The issue is assigned to @somtochiama so if you'd like to work on it it'd be best to discuss next steps with her. I'd also encourage you to join the next regular meeting.
Sure, @somtochiama if you aren't working on it, I can pick it up. Thanks for the invitation @makkes! I will make sure to do that.
@sbdtu5498 You can have a go at it.
Something to note is that there is an existing diff artifact
command that checks if there's a diff between a remote OCI URL and a local directory (it doesn't show a diff, just says if there have been any changes).
So diff artifact
command should be updated to show the actual diff between either another URL or a local directory.
@somtochiama thanks a lot for the information. I will keep that in mind.
Hey @sbdtu5498 , are you still working on this?
@somtochiama sorry for the delays. I was a bit busy. I need to do testing and add the test cases as well so it is still a WIP. I have left some comments in PR let me know on that as well.
Hello I just wanted to see if there is any more movement on this? I’d be interested to see this functionality added.
cc @sbdtu5498