`cosa decompress` ignores build if it's not the latest in the builds/builds.json
cosa decompress command appears to only operate on the latest build listed in the builds/builds.json file. It ignores other locally present builds, even when one is explicitly fetched using cosa buildfetch and pointed to by the builds/latest symlink
Steps to reproduce:
- Identify the latest build available (e.g., 9.6.20250717-0) and an older build (e.g., 9.6.20250716-0).
cosa buildfetchan artifact with an older build
cosa buildfetch --url URL -b 9.6.20250716-0 --arch ppc64le --artifact qemu
- Run
cosa decompress
Expected Behavior
The qemu file should be decompress by cosa decompress
Actual Behavior
The file is skipped since it is not the latest build in the builds/builds.json file
Targeting build: 9.6.20250717-0
Skipping missing arch: x86_64
Skipping missing arch: s390x
Skipping missing arch: aarch64
Skipping missing arch: ppc64le
cosa decompress --build=<target-build-id> should do this.
I'm not sure we should change the behavior here to iterate over all builds in a local builds dir.
even when one is explicitly fetched using cosa buildfetch and pointed to by the builds/latest symlink
I guess maybe there is an optimization we can make here to either consider the default to be the first build in builds.json OR the target of the symlink? I'm not really sure, though.
cosa decompress --build=<target-build-id>should do this.
Yes. But doing buildfetch --arch then decompress and have decompress do nothing because what was fetch was not the latest for this stream is odd UX imho.
The least we can do is have buildfetch return the the buildid that was fetched in a way easy to consume in a shell script somehow
cosa decompress --build=<target-build-id>should do this.Yes. But doing
buildfetch --archthendecompressand have decompress do nothing because what was fetch was not the latest for this stream is odd UX imho.
I agree. I think I'm happy with any solution that doesn't involve iterating over every local build to do the decompression if we can find one.
The least we can do is have buildfetch return the the buildid that was fetched in a way easy to consume in a shell script somehow
That might not be the best since we'd either have to not output any log messages from buildfetch OR we'd have to abuse STDERR to pick it up.
Maybe one option is to add a --decompress option to cosa buildfetch that would call out to cosa decompress somehow.