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 list project arifacts API #20803

Merged
merged 3 commits into from
Aug 6, 2024
Merged

Conversation

wy65701436
Copy link
Contributor

@wy65701436 wy65701436 commented Aug 2, 2024

This API supports listing all artifacts belonging to a specified project. It also allows fetching the latest artifact in each repositry, with the option to filter by either media_type or artifact_type.

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #20756

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.

This API supports listing all artifacts belonging to a specified project. It also allows fetching the latest artifact
in each repositry, with the option to filter by either media_type or artifact_type.

Signed-off-by: wang yan <wangyan@vmware.com>
@wy65701436 wy65701436 requested a review from a team as a code owner August 2, 2024 09:47
@wy65701436 wy65701436 added release-note/enhancement Label to mark PR to be added under release notes as enhancement and removed release-note/new-feature New Harbor Feature labels Aug 2, 2024
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 26.71233% with 107 lines in your changes missing coverage. Please review.

Project coverage is 66.28%. Comparing base (c8c11b4) to head (4d409a6).
Report is 249 commits behind head on main.

Files Patch % Lines
src/server/v2.0/handler/project.go 0.00% 70 Missing ⚠️
src/pkg/artifact/dao/dao.go 59.52% 12 Missing and 5 partials ⚠️
src/server/v2.0/handler/artifact.go 0.00% 7 Missing ⚠️
src/pkg/artifact/manager.go 53.84% 4 Missing and 2 partials ⚠️
src/controller/artifact/controller.go 70.00% 2 Missing and 1 partial ⚠️
src/pkg/cached/artifact/redis/manager.go 0.00% 2 Missing ⚠️
src/server/v2.0/handler/model/artifact.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #20803       +/-   ##
===========================================
+ Coverage   45.36%   66.28%   +20.91%     
===========================================
  Files         244     1045      +801     
  Lines       13333   113988   +100655     
  Branches     2719     2845      +126     
===========================================
+ Hits         6049    75557    +69508     
- Misses       6983    34311    +27328     
- Partials      301     4120     +3819     
Flag Coverage Δ
unittests 66.28% <26.71%> (+20.91%) ⬆️

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

Files Coverage Δ
src/controller/artifact/model.go 40.00% <ø> (ø)
src/pkg/cached/artifact/redis/manager.go 60.65% <0.00%> (ø)
src/server/v2.0/handler/model/artifact.go 0.00% <0.00%> (ø)
src/controller/artifact/controller.go 62.15% <70.00%> (ø)
src/pkg/artifact/manager.go 64.13% <53.84%> (ø)
src/server/v2.0/handler/artifact.go 8.66% <0.00%> (ø)
src/pkg/artifact/dao/dao.go 57.63% <59.52%> (ø)
src/server/v2.0/handler/project.go 5.23% <0.00%> (ø)

... and 1279 files with indirect coverage changes

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

Signed-off-by: wang yan <wangyan@vmware.com>
@@ -501,11 +501,12 @@ func (a *artifactAPI) RequireLabelInProject(ctx context.Context, projectID, labe
return nil
}

func option(withTag, withImmutableStatus, withLabel, withAccessory *bool) *artifact.Option {
func option(withTag, withImmutableStatus, withLabel, withAccessory *bool, latestInRepository *bool) *artifact.Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

@wy65701436 wy65701436 merged commit b7f1b59 into goharbor:main Aug 6, 2024
11 of 12 checks passed
kunal-511 pushed a commit to kunal-511/harbor_local that referenced this pull request Aug 22, 2024
* add list project arifacts API

This API supports listing all artifacts belonging to a specified project. It also allows fetching the latest artifact
in each repositry, with the option to filter by either media_type or artifact_type.

Signed-off-by: wang yan <wangyan@vmware.com>

* resolve the comments

Signed-off-by: wang yan <wangyan@vmware.com>

---------

Signed-off-by: wang yan <wangyan@vmware.com>
Signed-off-by: kunal-511 <yoyokvunal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/enhancement Label to mark PR to be added under release notes as enhancement target/2.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List artifacts response do not including artifact_type field
4 participants