Skip to content

Fix harbor-cli project logs returning no output#587

Merged
bupd merged 2 commits into
goharbor:mainfrom
DrowsyWings:fix/project-logs-no-output
Feb 3, 2026
Merged

Fix harbor-cli project logs returning no output#587
bupd merged 2 commits into
goharbor:mainfrom
DrowsyWings:fix/project-logs-no-output

Conversation

@DrowsyWings

Copy link
Copy Markdown
Contributor

Fixes the harbor project logs subcommand so that it displays project-specific audit logs.

Problem

The harbor project logs subcommand returned empty output even when audit logs existed for the project.

Solution

Previously it was using the v1 version of log functions
This change updates the logic to use v2 functions and corresponding types to v2 (similar to harbor logs command )

Tested it against demo.goharbor.io instance which have existing audit logs

Fixes #586

Signed-off-by: Anish Tak <anishtak282@outlook.com>
@DrowsyWings DrowsyWings force-pushed the fix/project-logs-no-output branch from 8a5e2dc to 9102a6b Compare December 25, 2025 05:24
@bupd bupd self-assigned this Jan 22, 2026
@bupd bupd added bug Something isn't working go Pull requests that update go code labels Jan 22, 2026
@bupd bupd self-requested a review January 22, 2026 17:41
@codecov

codecov Bot commented Jan 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.17%. Comparing base (60ad0bd) to head (f95f531).
⚠️ Report is 83 commits behind head on main.

Files with missing lines Patch % Lines
cmd/harbor/root/project/logs.go 0.00% 2 Missing ⚠️
pkg/api/project_handler.go 0.00% 2 Missing ⚠️
pkg/views/project/logs/view.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main    #587      +/-   ##
=========================================
- Coverage   10.99%   7.17%   -3.82%     
=========================================
  Files         173     260      +87     
  Lines        8671   12847    +4176     
=========================================
- Hits          953     922      -31     
- Misses       7612   11817    +4205     
- Partials      106     108       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NucleoFusion NucleoFusion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!
Works as intended.

@bupd bupd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@bupd bupd merged commit 58a7157 into goharbor:main Feb 3, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

harbor-cli project logs returns no output

3 participants