Commit graph

1 commit

Author SHA1 Message Date
Achilleas Koutsou
e253f7c8b9 tools: new script: update-test-manifests
Add a new script that parses the Schutzfile for repository snapshot
dates and updates any vars.ipp file found in test/data/manifests/ to
match the snapshot date for the same distro.
After modifying the vars.ipp files, it runs `sudo make test-data` to
regenerate all test manifests and then, for each modified manifest,
generates the new diff.json for that stage test.

A few things to note:
- The distro detection for each vars.ipp file is partially
  heuristic-based.  It assumes that the first component of the filename
  is the distribution name.  This is true for our current files, but
  it's not a hard rule.  The script will fail with an error if the first
  component of a filename is not a valid distro name.
- The script uses ruamel.yaml instead of the standard pyyaml.
  ruamel.yaml is much better at preserving the structure of the original
  yaml file during a load-modify-dump and provides more ways of
  controlling indentation and wrapping.  The package will need to be
  installed in any runner that calls this script.
- This script will eventually become part of a GitHub workflow that is
  dispatched from the rpmrepo snapshot creation job.  When that happens,
  it might be changed to take snapshot dates as arguments rather than
  reading them from the Schutzfile.
2025-07-31 00:53:54 +02:00