Currently this tool seems to work solely off Koji tasks. It does quite a lot of work to parse Koji task info to try and find the 'right ones', including rather ugly/fragile stuff like if file_name.endswith("vhdfixed.xz").
if file_name.endswith("vhdfixed.xz")
Working off Koji tasks also has the consequence that we will sync images even from failed composes, if at least one cloud image build task that this tool would handle completes successfully.
Fedora composes have pretty good metadata produced by pungi, e.g. https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20240426.n.0/compose/metadata/images.json . It's all standardized and codified via https://github.com/release-engineering/productmd , and my https://pagure.io/fedora-qa/fedfind provides some convenience tools for working with the metadata (though you don't have to use it). It should be rather less effort to listen for compose complete messages, get the metadata for the completed compose (the messages provide the base URL for the compose, and the images.json location is always the same relative to the base URL, or if using fedfind you just do fedfind.release.get_release(url=URLGOESHERE)), and use that to locate and identify the images to publish, rather than doing it directly from Koji.
fedfind.release.get_release(url=URLGOESHERE)
The fedora openQA scheduler uses this kind of approach for scheduling compose tasks, you can probably use that as a reference. In https://pagure.io/fedora-qa/fedora_openqa/blob/5699d236210a9bdf489b2cec76cb80d2950a6fc2/f/src/fedora_openqa/schedule.py , jobs_from_compose uses _get_images to find and identify the images it wants to schedule for, with configuration via the WANTED dict in https://pagure.io/fedora-qa/fedora_openqa/blob/5699d236210a9bdf489b2cec76cb80d2950a6fc2/f/src/fedora_openqa/config.py . That whole setup is fairly complex because we schedule a lot of tests on a lot of images, there are some weird things like the made-up 'universal' flavor that has to be mapped to a specific image flavor, and we wanted it to be configurable; you could wind up with something rather simpler for this tool, I think.
jobs_from_compose
_get_images
WANTED
Fixed in #3
Metadata Update from @jcline: - Issue status updated to: Closed (was: Open)