Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Display 'No SBOM' in multi-arch images in HarborUI #21459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bupd
Copy link
Contributor

@bupd bupd commented Jan 23, 2025

Thank you for contributing to Harbor!

Comprehensive Summary of your change

  • Previously, No SBOM label was displayed for multi-arch images.
  • Now, SBOM column is Empty for Multi-arch images. Since child artifacts may have their own SBOMs.

Changes made

  • Added the hasChild method to check for the presence of child images. aka. detecting multi-arch images.
  • If mulit-arch images present 'No SBOM' will not be displayed since child artifacts can contain their own SBOMs.
  • Added Tests.

Screenshots

childs will have no sbom disables

Issue being fixed

Fixes #21424

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/update,area-ui"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

* Updated the `hasChild` method to check for the presence of
`child_digest` in the `references` array.
* This ensures that SBOMs are correctly displayed for multi-arch images,
where child artifacts may contain their own SBOMs.
* Previously, No SBOM label was displayed for multi-arch images.

Signed-off-by: bupd <bupdprasanth@gmail.com>
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.26%. Comparing base (c8c11b4) to head (c0ffee2).
Report is 376 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #21459      +/-   ##
==========================================
+ Coverage   45.36%   46.26%   +0.89%     
==========================================
  Files         244      247       +3     
  Lines       13333    13886     +553     
  Branches     2719     2876     +157     
==========================================
+ Hits         6049     6424     +375     
- Misses       6983     7124     +141     
- Partials      301      338      +37     
Flag Coverage Δ
unittests 46.26% <ø> (+0.89%) ⬆️

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

see 491 files with indirect coverage changes

@MinerYang
Copy link
Contributor

Hi @bupd ,
Thanks for your contribution.
Could you provide a final demo of this PR changes, a screenshot is fine.

@Vad1mo Vad1mo added the release-note/update Update or Fix label Feb 3, 2025
@bupd
Copy link
Contributor Author

bupd commented Feb 3, 2025

@MinerYang Updated the PR description with screenshot.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/update Update or Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI displays 'No SBOM' for multi-architecture images despite SBOM availability
6 participants