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

exporter: add field alias for count(*) func #18840

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

liubin
Copy link
Contributor

@liubin liubin commented Jun 21, 2023

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Add an alias so that orm can parse the column name regardless of
the type and version of the database.

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.

@liubin liubin requested a review from a team as a code owner June 21, 2023 11:25
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #18840 (35f4caa) into main (7ed1920) will decrease coverage by 0.02%.
Report is 2 commits behind head on main.
The diff coverage is n/a.

❗ Current head 35f4caa differs from pull request most recent head 970cf54. Consider uploading reports for the commit 970cf54 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18840      +/-   ##
==========================================
- Coverage   67.38%   67.37%   -0.02%     
==========================================
  Files         993      993              
  Lines      108894   108894              
  Branches     2751     2751              
==========================================
- Hits        73381    73370      -11     
- Misses      31566    31582      +16     
+ Partials     3947     3942       -5     
Flag Coverage Δ
unittests 67.37% <ø> (-0.02%) ⬇️

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

Files Changed Coverage Δ
src/pkg/exporter/project_collector.go 28.43% <ø> (ø)

... and 7 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

@wy65701436 wy65701436 added the release-note/update Update or Fix label Aug 25, 2023
@chlins
Copy link
Member

chlins commented Aug 25, 2023

@liubin Hi, the output of the original and new SQL is same in my environment, you mentioned that the original SQL will always got 0 count, how did you reproduce that?

image

@liubin liubin force-pushed the fix-exporter-project-total-count branch 3 times, most recently from aefea57 to 67f1790 Compare August 28, 2023 06:19
@liubin
Copy link
Contributor Author

liubin commented Aug 28, 2023

@chlins Sorry I'm using oceanbase, it needs alias to let the beego orm to parse the filed name correctly.

I updated the commit message and description of this PR.

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@liubin liubin force-pushed the fix-exporter-project-total-count branch from 67f1790 to 35f4caa Compare August 30, 2023 00:00
Add an alias so that orm can parse the column name regardless of
the type and version of the database.

Signed-off-by: bin liu <liubin0329@gmail.com>
@liubin liubin force-pushed the fix-exporter-project-total-count branch from 35f4caa to 970cf54 Compare August 30, 2023 00:01
@chlins chlins merged commit 0e039b2 into goharbor:main Aug 30, 2023
# 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