Skip to content

feat(RELEASE-2460): add disk-image support to artifact helpers#833

Open
swickersh wants to merge 1 commit into
konflux-ci:mainfrom
swickersh:release2460
Open

feat(RELEASE-2460): add disk-image support to artifact helpers#833
swickersh wants to merge 1 commit into
konflux-ci:mainfrom
swickersh:release2460

Conversation

@swickersh

@swickersh swickersh commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
- coincides with https://github.com/konflux-ci/release-service-catalog/pull/2334
- 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

@codecov-commenter

codecov-commenter commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.38554% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.66%. Comparing base (eb74eb6) to head (b761b1d).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
scripts/python/helpers/extract_artifacts.py 96.00% 2 Missing ⚠️
scripts/python/helpers/compress_artifacts.py 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unit-tests 95.66% <96.38%> (+0.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scripts/python/helpers/disk_image_utils.py 100.00% <100.00%> (ø)
scripts/python/helpers/push_artifacts.py 97.95% <100.00%> (+0.04%) ⬆️
scripts/python/helpers/push_unsigned.py 97.70% <100.00%> (+0.07%) ⬆️
scripts/python/helpers/compress_artifacts.py 98.55% <92.30%> (-0.69%) ⬇️
scripts/python/helpers/extract_artifacts.py 96.70% <96.00%> (+0.05%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@swickersh swickersh marked this pull request as ready for review June 22, 2026 18:45
@swickersh

Copy link
Copy Markdown
Contributor Author

/retest

@swickersh swickersh marked this pull request as draft June 22, 2026 18:46
@swickersh swickersh marked this pull request as ready for review June 23, 2026 13:09
@swickersh

Copy link
Copy Markdown
Contributor Author

Not actually ready for review, but my test images aren't building in draft mode.

@swickersh swickersh force-pushed the release2460 branch 3 times, most recently from ee12fc1 to 9aaa8eb Compare June 23, 2026 20:33
@swickersh

Copy link
Copy Markdown
Contributor Author

/retest

@swickersh swickersh force-pushed the release2460 branch 4 times, most recently from 73d2175 to 7b29601 Compare June 30, 2026 13:26
@swickersh swickersh changed the title WIP disk-image in patc feat(RELEASE-2460): add disk-image support to artifact helpers Jun 30, 2026
component.get("contentType") == "disk-image"
or cg.get("contentType") == "disk-image"
)
if is_disk_image and not component.get("files"):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be files not in component instead? Not component.get(files) would also match files: [] which would mean it could be empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Extracted to common helper. Thanks for suggestion

@swickersh swickersh force-pushed the release2460 branch 4 times, most recently from 4ac7a53 to 6742d08 Compare July 1, 2026 17:57
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants