coreos-assembler icon indicating copy to clipboard operation
coreos-assembler copied to clipboard

`cosa decompress` ignores build if it's not the latest in the builds/builds.json

Open Roshan-R opened this issue 5 months ago • 5 comments

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:

  1. Identify the latest build available (e.g., 9.6.20250717-0) and an older build (e.g., 9.6.20250716-0).
  2. cosa buildfetch an artifact with an older build
cosa buildfetch --url URL -b 9.6.20250716-0 --arch ppc64le --artifact qemu
  1. 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

Roshan-R avatar Jul 17 '25 18:07 Roshan-R

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.

dustymabe avatar Jul 17 '25 20:07 dustymabe

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.

dustymabe avatar Jul 17 '25 20:07 dustymabe

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

jbtrystram avatar Jul 17 '25 20:07 jbtrystram

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.

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.

dustymabe avatar Jul 18 '25 16:07 dustymabe

Maybe one option is to add a --decompress option to cosa buildfetch that would call out to cosa decompress somehow.

dustymabe avatar Jul 18 '25 16:07 dustymabe