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

[cherry-pick] fix: improve the performance of list artifacts #18632

Conversation

chlins
Copy link
Member

@chlins chlins commented May 4, 2023

  1. Change the query for listing tasks of scan which can use the db index.
  2. Add the gin index for task.extra_attrs.report_uuids

Fixes: #18013

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.

@chlins chlins requested a review from a team as a code owner May 4, 2023 04:01
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #18632 (3cb433f) into release-2.7.0 (a051373) will decrease coverage by 0.01%.
The diff coverage is 68.96%.

Impacted file tree graph

@@                Coverage Diff                @@
##           release-2.7.0   #18632      +/-   ##
=================================================
- Coverage          66.44%   66.43%   -0.01%     
=================================================
  Files               1012     1012              
  Lines             108614   108633      +19     
  Branches            2677     2677              
=================================================
+ Hits               72164    72167       +3     
- Misses             32487    32501      +14     
- Partials            3963     3965       +2     
Flag Coverage Δ
unittests 66.43% <68.96%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
src/pkg/task/dao/task.go 64.21% <60.00%> (-0.34%) ⬇️
src/pkg/task/task.go 63.19% <75.00%> (+0.93%) ⬆️
src/controller/scan/base_controller.go 60.17% <100.00%> (-0.40%) ⬇️

... and 6 files with indirect coverage changes

1. Change the query for listing tasks of scan which can use the db
   index.
2. Add the gin index for task.extra_attrs.report_uuids

Fixes: goharbor#18013

Signed-off-by: chlins <chenyuzh@vmware.com>
@chlins chlins force-pushed the release-2.7.0/perf/artifact-api-with-scan branch from 9d5ad5d to 3cb433f Compare May 5, 2023 03:01
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

@chlins chlins merged commit e180723 into goharbor:release-2.7.0 May 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants