Repository navigation
Conversation
This commit adds new manifest reference tests to capture when we core aspects of the generated manifests. This is inspired by the work we did in `otk` [0]. The test is very fast, there is no depsolving or other network activity, but because "fake" packages get generated we will notice any changes in the packagelists. This is very useful when working on the yamlification of the package lists (and later the other parts) because this way we will spot any differences right away. [0] https://github.com/osbuild/otk/blob/main/test/test_against_images_refs.py
This is a mechanical commit that just adds the reference data of centos-10 and rhel-10.0 to the "manifestdb-light".
This commit is a very naive fix to avoid writing duplicated packages into the osbuild manifest. Writing multiple identical package ids into the manifest is no real problem but with the new manifest compare tooling it creates unneeded diffs.
|
This is using I like the approach (it worked really well in |
gen-manifests-diff is a helper to diff the generated manifests against what the current "main" of the images library would do. Alternatively a revision can be given as the first argument and with that the diff is calculated against that. All images types and architectures are used by default. It is still very fast (typically 3s). Example output: ``` calculating diff against d285ec6 found differences between /tmp/tmpbjhime7p/new and reference manifests: diff -uNr /tmp/tmpbjhime7p/ref/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json /tmp/tmpbjhime7p/new/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json --- /tmp/tmpbjhime7p/ref/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json 2025-03-10 20:55:20.736477268 +0100 +++ /tmp/tmpbjhime7p/new/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json 2025-03-10 20:55:22.294453956 +0100 @@ -161,7 +161,13 @@ }, "kernel_opts": [ "luks.uuid=e3eb0343-83b0-441c-a8aa-6a715afc1d39", - "console=tty0 console=ttyS0,115200n8 net.ifnames=0 nvme_core.io_timeout=4294967295 modprobe.blacklist=vc4 rw coreos.no_persist_ip", + "console=tty0", + "console=ttyS0,115200n8", + "net.ifnames=0", + "nvme_core.io_timeout=4294967295", + "modprobe.blacklist=vc4", + "rw", + "coreos.no_persist_ip", "ignition.platform.id=metal", "$ignition_firstboot" ] ... ``` This is (hopefully) the uncontroversial part of osbuild#1307 and already useful when checking that a yamlification (or other change) is not resulting in any regressions. Also useful to see if a change results in the expected change(s).
gen-manifests-diff is a helper to diff the generated manifests against what the current "main" of the images library would do. Alternatively a revision can be given as the first argument and with that the diff is calculated against that. All images types and architectures are used by default. It is still very fast (typically 3s). Example output: ``` calculating diff against d285ec6 found differences between /tmp/tmpbjhime7p/new and reference manifests: diff -uNr /tmp/tmpbjhime7p/ref/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json /tmp/tmpbjhime7p/new/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json --- /tmp/tmpbjhime7p/ref/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json 2025-03-10 20:55:20.736477268 +0100 +++ /tmp/tmpbjhime7p/new/centos_9-aarch64-edge_ami-edge_ostree_pull_user.json 2025-03-10 20:55:22.294453956 +0100 @@ -161,7 +161,13 @@ }, "kernel_opts": [ "luks.uuid=e3eb0343-83b0-441c-a8aa-6a715afc1d39", - "console=tty0 console=ttyS0,115200n8 net.ifnames=0 nvme_core.io_timeout=4294967295 modprobe.blacklist=vc4 rw coreos.no_persist_ip", + "console=tty0", + "console=ttyS0,115200n8", + "net.ifnames=0", + "nvme_core.io_timeout=4294967295", + "modprobe.blacklist=vc4", + "rw", + "coreos.no_persist_ip", "ignition.platform.id=metal", "$ignition_firstboot" ] ... ``` This is (hopefully) the uncontroversial part of #1307 and already useful when checking that a yamlification (or other change) is not resulting in any regressions. Also useful to see if a change results in the expected change(s).
Yeah, happy to tweak this in whatever shape this is preferred. pytest was the quickest do demo the idea for me. |
|
We had an (offline) discussion about this last week and there was strong disagreement about diffing manifests (even non-depsolved ones as in here) so I'm closing this. We may explore options in the fuure:
both need tooling which this PR does not provide so a new one will be need to be created. |
TODO as a middle ground the idea of having just the list of hashes of the generated manifests was suggested and tooling to create diffs so that we can avoid carrying all the manifests in the git repo
[edit: as expected lots of resistance :) also one suggestion was to make the yaml instead of json to make them easier to diff/merge so less merge conflicts in e.g. the merge-queue (thanks @achilleas-k!)]
This PR adds new manifest reference tests to capture when we
core aspects of the generated manifests. This is inspired by the
work we did in
otk[0].The test is very fast, there is no depsolving or other network
activity, but because "fake" packages get generated we will
notice any changes in the packagelists.
This is very useful when working on the yamlification of the
package lists (and later the other parts) because this way
we will spot any differences right away.
See #1300 for how
this is used.
[0] https://github.com/osbuild/otk/blob/main/test/test_against_images_refs.py