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

add stop sbom scanning API #20200

Merged
merged 30 commits into from
Apr 9, 2024
Merged

add stop sbom scanning API #20200

merged 30 commits into from
Apr 9, 2024

Conversation

wy65701436
Copy link
Contributor

@wy65701436 wy65701436 commented Apr 1, 2024

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.

@wy65701436 wy65701436 requested a review from a team as a code owner April 1, 2024 08:59
@wy65701436 wy65701436 added the release-note/update Update or Fix label Apr 1, 2024
xuelichao added a commit to wy65701436/harbor that referenced this pull request Apr 2, 2024
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 82.14286% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 67.56%. Comparing base (b7b8847) to head (4b2e006).
Report is 118 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             main   #20200     +/-   ##
=========================================
  Coverage   67.56%   67.56%             
=========================================
  Files         991     1000      +9     
  Lines      109181   110384   +1203     
  Branches     2719     2781     +62     
=========================================
+ Hits        73768    74584    +816     
- Misses      31449    31798    +349     
- Partials     3964     4002     +38     
Flag Coverage Δ
unittests 67.56% <82.14%> (+<0.01%) ⬆️

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

Files Coverage Δ
src/controller/scan/base_controller.go 59.38% <100.00%> (-0.17%) ⬇️
src/controller/scan/controller.go 100.00% <ø> (ø)
src/server/v2.0/handler/scan.go 17.74% <100.00%> (-1.56%) ⬇️
src/pkg/task/dao/execution.go 61.82% <81.13%> (+0.47%) ⬆️

... and 512 files with indirect coverage changes

xuelichao added a commit to wy65701436/harbor that referenced this pull request Apr 2, 2024
Vad1mo
Vad1mo previously requested changes Apr 2, 2024
Copy link
Member

@Vad1mo Vad1mo left a comment

Choose a reason for hiding this comment

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

Furthermore, please be clear and concise in the wording Scan, Create or generate. They all mean different things.

IMO generate is the wrong term here. We either scan the image for libs and create the SBOM. See. https://diffsense.com/diff/create/generate

So to summarize, Harbor scans images from SBOM material and creates a SBOM.

@@ -1028,6 +1029,41 @@
"IN_PROGRESS": "Search...",
"BACK": "Back"
},
"SBOM": {
"CHART": {
"SCANNING_TIME": "Scan completed time:",
Copy link
Member

Choose a reason for hiding this comment

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

This is not clear: It is the time it took to complete the scan or is it the time when the scan terminated?

"SBOM": {
"CHART": {
"SCANNING_TIME": "Scan completed time:",
"SCANNING_PERCENT": "Scan completed percent:",
Copy link
Member

Choose a reason for hiding this comment

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

Percentage of completed scan.
or
Scan Completion in percent
or
Scan progress

"CHART": {
"SCANNING_TIME": "Scan completed time:",
"SCANNING_PERCENT": "Scan completed percent:",
"SCANNING_PERCENT_EXPLAIN": "Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index.",
Copy link
Member

Choose a reason for hiding this comment

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

The scan completion progress is calculated as # of successfully scanned images / total number of images referenced within the image index.

"SCANNING_PERCENT_EXPLAIN": "Scan completed percentage is calculated as # of successfully scanned images / total number of images referenced within the image index.",
"TOOLTIPS_TITLE": "{{totalSbom}} of {{totalPackages}} {{package}} have known {{sbom}}.",
"TOOLTIPS_TITLE_SINGULAR": "{{totalSbom}} of {{totalPackages}} {{package}} has known {{sbom}}.",
"TOOLTIPS_TITLE_ZERO": "No recognizable SBOM detected"
Copy link
Member

Choose a reason for hiding this comment

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

This is not clear, and I don't think it should mean what this means.

"TOOLTIPS_TITLE_ZERO": "No recognizable SBOM detected"
},
"GRID": {
"PLACEHOLDER": "We couldn't find any scanning results!",
Copy link
Member

Choose a reason for hiding this comment

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

No scan results found.

This is not clear where not able to find any results or have there been no scan results.
In the first case, as a user I would like to know what Harbor could not find anything.

"FOOT_OF": "of"
},
"STATE": {
"OTHER_STATUS": "Not Generated",
Copy link
Member

Choose a reason for hiding this comment

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

The term generated means, here, that the process of writing/creating the SBOM after the SBOM scanning and discovering completed. Am I correct in my assumption?

"QUEUED": "Queued",
"ERROR": "View Log",
"SCANNING": "Generating",
"STOPPED": "Generating SBOM stopped"
Copy link
Member

Choose a reason for hiding this comment

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

SBOM creation stopped
of
SBOM scan stopped

"NO_SBOM": "No SBOM",
"PACKAGES": "SBOM",
"REPORTED_BY": "Reported by {{scanner}}",
"GENERATE": "Start SBOM",
Copy link
Member

Choose a reason for hiding this comment

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

Create SBOM

"GENERATE": "Start SBOM",
"DOWNLOAD": "Download SBOM",
"Details": "SBOM details",
"STOP": "Stop SBOM",
Copy link
Member

Choose a reason for hiding this comment

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

Stop SBOM creation/scan

"DOWNLOAD": "Download SBOM",
"Details": "SBOM details",
"STOP": "Stop SBOM",
"TRIGGER_STOP_SUCCESS": "Trigger stopping SBOM generation successfully"
Copy link
Member

Choose a reason for hiding this comment

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

This is not understandable, can you explain what this TRIGGER_STOP_SUCCESS does or should tell the user?

xuelichao added a commit to wy65701436/harbor that referenced this pull request Apr 3, 2024
xuelichao added a commit to wy65701436/harbor that referenced this pull request Apr 3, 2024
wy65701436 pushed a commit to wy65701436/harbor that referenced this pull request Apr 8, 2024
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
add the missiong parameter when to call the stop method

Signed-off-by: wang yan <[email protected]>
xuelichao and others added 19 commits April 9, 2024 14:06
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: xuelichao <[email protected]>
Signed-off-by: wang yan <[email protected]>
bump golang 1.21.8

Signed-off-by: yminer <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: stonezdj <[email protected]>
Co-authored-by: stonezdj <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: guoguangwu <[email protected]>
Co-authored-by: Wang Yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
Update swagger API for generate SBOM

Signed-off-by: stonezdj <[email protected]>
Co-authored-by: stonezdj <[email protected]>
Signed-off-by: wang yan <[email protected]>
delete membership=0 in getProjectsByName but lets getProjects still using membership=1 for reserve if getProjectsByName not found any

Signed-off-by: prima <[email protected]>
Signed-off-by: wang yan <[email protected]>
update column if is null

Signed-off-by: yminer <[email protected]>
Co-authored-by: Wang Yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
fixes goharbor#20226

Signed-off-by: stonezdj <[email protected]>
Co-authored-by: stonezdj <[email protected]>
Signed-off-by: wang yan <[email protected]>
Signed-off-by: wang yan <[email protected]>
@wy65701436 wy65701436 dismissed Vad1mo’s stale review April 9, 2024 07:15

Will raise another PR to resolve the UI issues

Signed-off-by: xuelichao <[email protected]>
@wy65701436 wy65701436 merged commit 461a5fa into goharbor:main Apr 9, 2024
12 checks passed
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.

9 participants