flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

Allow diffing of two OCI artifacts

Open hiddeco opened this issue 1 year ago • 8 comments

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).

hiddeco avatar May 02 '23 11:05 hiddeco

/assign

sbdtu5498 avatar Jun 06 '23 09:06 sbdtu5498

@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.

makkes avatar Jun 06 '23 12:06 makkes

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 avatar Jun 06 '23 13:06 sbdtu5498

@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 avatar Jun 06 '23 13:06 somtochiama

@somtochiama thanks a lot for the information. I will keep that in mind.

sbdtu5498 avatar Jun 06 '23 13:06 sbdtu5498

Hey @sbdtu5498 , are you still working on this?

somtochiama avatar Aug 03 '23 14:08 somtochiama

@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.

sbdtu5498 avatar Aug 07 '23 09:08 sbdtu5498

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

calerogers avatar Mar 15 '24 16:03 calerogers