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 #18639

Conversation

chlins
Copy link
Member

@chlins chlins commented May 5, 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.

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #18639 (b925c55) into release-2.8.0 (a1e8914) will decrease coverage by 0.02%.
The diff coverage is 68.96%.

Impacted file tree graph

@@                Coverage Diff                @@
##           release-2.8.0   #18639      +/-   ##
=================================================
- Coverage          67.36%   67.35%   -0.02%     
=================================================
  Files                984      984              
  Lines             106987   107006      +19     
  Branches            2670     2670              
=================================================
+ Hits               72074    72076       +2     
- Misses             31033    31047      +14     
- Partials            3880     3883       +3     
Flag Coverage Δ
unittests 67.35% <68.96%> (-0.02%) ⬇️

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 62.42% <75.00%> (+0.98%) ⬆️
src/controller/scan/base_controller.go 60.07% <100.00%> (-0.40%) ⬇️

... and 7 files with indirect coverage changes

@chlins chlins added the release-note/update Update or Fix label May 5, 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: goharbor#18013

Signed-off-by: chlins <chenyuzh@vmware.com>
@chlins chlins force-pushed the release-2.8.0/perf/artifact-api-with-scan branch from 630f82a to b925c55 Compare May 5, 2023 03:29
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 4f6efeb into goharbor:release-2.8.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.

6 participants