feat(RELEASE-2460): add disk-image support to artifact helpers#833
feat(RELEASE-2460): add disk-image support to artifact helpers#833swickersh wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #833 +/- ##
==========================================
+ Coverage 94.67% 95.66% +0.98%
==========================================
Files 57 73 +16
Lines 5319 7166 +1847
==========================================
+ Hits 5036 6855 +1819
- Misses 283 311 +28
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
Not actually ready for review, but my test images aren't building in draft mode. |
ee12fc1 to
9aaa8eb
Compare
|
/retest |
73d2175 to
7b29601
Compare
| component.get("contentType") == "disk-image" | ||
| or cg.get("contentType") == "disk-image" | ||
| ) | ||
| if is_disk_image and not component.get("files"): |
There was a problem hiding this comment.
Should this be files not in component instead? Not component.get(files) would also match files: [] which would mean it could be empty.
There was a problem hiding this comment.
the comment I had before was wrong/misleading. Updated. And we actually want this behavior. If shipping to contentGateway, then we need to copy staged.files[] into files[] for downstream events.
| # Disk images must always be os: linux. Fail immediately if the RPA declares a | ||
| # disk-image component with macOS or Windows entries — those would route into | ||
| # the signing workflow and produce failures deep in the pipeline. | ||
| if is_disk_image_component: |
There was a problem hiding this comment.
Could we move this validation to the top of run() before the ThreadPoolExecutor? It only reads the snapshot, but right now it runs after all images are pulled and extracted, so it would be an invalid RPA and it would pull all the images and then fail.
I think this could also be done in the schema in check-data-keys, so both checks would fail much earlier.
There was a problem hiding this comment.
good idea. Done, thanks
| # NOTE: .tar.gz is intentionally excluded — it is ambiguous between binary | ||
| # archives and disk images (e.g. GCP images packaged as tarballs). Use | ||
| # contentType: disk-image on the component to handle those cases. | ||
| _DISK_IMAGE_SUFFIXES: frozenset[str] = frozenset( |
There was a problem hiding this comment.
Is this not the same as push_unsigned.py? Would it make sense to be its own helper so we only need to update one place.
There was a problem hiding this comment.
Good idea. Extracted to common helper. Thanks for suggestion
4ac7a53 to
6742d08
Compare
- compress_artifacts: copy disk images as-is; fix multi-file per-arch scenario (e.g. ISO + QCOW2 sharing one os+arch) - push_unsigned: pass disk images through without unpacking, handling both files[] and staged.files[] sources - push_artifacts: inject staged.files[] into files[] for CGW when disk-image component has no files[] entries - extract_artifacts: fail early when disk-image component declares a non-linux OS entry, preventing signing failures - all helpers: detect disk-image via contentType at both component level and contentGateway.contentType Assisted-by: Cursor AI Signed-off-by: Scott Wickersham <swickers@redhat.com>
Assisted-by: Cursor AI