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

Add new cosa diff command to diff builds #3968

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Nov 21, 2024

A lot of times when making major changes to content or how artifacts are built, it's helpful to be able to diff the before and after to make sure only what we expect to change changed. For example, this would've been useful for the create_disk.sh to osbuild migration or the more recent tier-x migration (where I ended up doing a lot of comparisons by hand).

Now with the move of the live ISO to osbuild, we have a need for it again.

Add a new cosa diff command for this.

The command supports different kinds of diffs and more can easily be added. For now, I've focused on the core ones (RPMs, OSTree content, initramfs) and the live artifacts since those are the needed currently.

$ cosa diff -h
usage: cmd-diff <snip>

options:
  -h, --help          show this help message and exit
  --from DIFF_FROM    First build ID
  --to DIFF_TO        Second build ID
  --gc                Delete cached diff content
  --rpms              Diff RPMs
  --ostree-ls         Diff OSTree contents using 'ostree diff'
  --ostree            Diff OSTree contents using 'git diff'
  --initrd            Diff initramfs contents
  --live-iso-ls       Diff live ISO listings
  --live-iso          Diff live ISO content
  --live-initrd-ls    Diff live initramfs listings
  --live-initrd       Diff live initramfs content
  --live-rootfs-ls    Diff live rootfs listings
  --live-rootfs       Diff live rootfs content
  --live-squashfs-ls  Diff live squashfs listings
  --live-squashfs     Diff live squashfs content

A lot of times when making major changes to content or how artifacts are
built, it's helpful to be able to diff the before and after to make sure
only what we expect to change changed. For example, this would've been
useful for the `create_disk.sh` to osbuild migration or the more recent
tier-x migration (where I ended up doing a lot of comparisons by hand).

Now with the move of the live ISO to osbuild, we have a need for it
again.

Add a new `cosa diff` command for this.

The command supports different kinds of diffs and more can easily be
added. For now, I've focused on the core ones (RPMs, OSTree content,
initramfs) and the live artifacts since those are the needed currently.

```
$ cosa diff -h
usage: cmd-diff <snip>

options:
  -h, --help          show this help message and exit
  --from DIFF_FROM    First build ID
  --to DIFF_TO        Second build ID
  --gc                Delete cached diff content
  --rpms              Diff RPMs
  --ostree-ls         Diff OSTree contents using 'ostree diff'
  --ostree            Diff OSTree contents using 'git diff'
  --initrd            Diff initramfs contents
  --live-iso-ls       Diff live ISO listings
  --live-iso          Diff live ISO content
  --live-initrd-ls    Diff live initramfs listings
  --live-initrd       Diff live initramfs content
  --live-rootfs-ls    Diff live rootfs listings
  --live-rootfs       Diff live rootfs content
  --live-squashfs-ls  Diff live squashfs listings
  --live-squashfs     Diff live squashfs content
```
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM - let's just get this in and make any fixups later

@dustymabe dustymabe merged commit b76ab0f into coreos:main Nov 26, 2024
5 checks passed
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.

2 participants