Skip to content
New issue

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

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

Already on GitHub? # to your account

Set default capability for old scanners #20306

Merged
merged 2 commits into from
Apr 20, 2024

Conversation

stonezdj
Copy link
Contributor

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • 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.

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
@stonezdj stonezdj requested a review from a team as a code owner April 19, 2024 08:07
@stonezdj stonezdj added the release-note/update Update or Fix label Apr 19, 2024
@stonezdj stonezdj requested review from zyyw and wy65701436 April 19, 2024 08:07
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.34%. Comparing base (b7b8847) to head (d365a02).
Report is 148 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #20306      +/-   ##
==========================================
- Coverage   67.56%   66.34%   -1.22%     
==========================================
  Files         991     1042      +51     
  Lines      109181   112941    +3760     
  Branches     2719     2827     +108     
==========================================
+ Hits        73768    74932    +1164     
- Misses      31449    33954    +2505     
- Partials     3964     4055      +91     
Flag Coverage Δ
unittests 66.34% <100.00%> (-1.22%) ⬇️

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

Files Coverage Δ
src/pkg/scan/rest/v1/models.go 58.16% <100.00%> (+13.56%) ⬆️

... and 565 files with indirect coverage changes

Copy link
Contributor

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 169 to 173
if c.Type == ScanTypeVulnerability {
capabilities[supportVulnerability] = true
}
if c.Type == ScanTypeSbom {
} else if c.Type == ScanTypeSbom {
capabilities[supportSBOM] = true
}
Copy link
Contributor

@zyyw zyyw Apr 19, 2024

Choose a reason for hiding this comment

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

switch ... case instead of if ... else if?

@stonezdj stonezdj merged commit d759429 into goharbor:main Apr 20, 2024
11 of 12 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
release-note/update Update or Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants