Skip to content

feat(gc): add gc history subcommand#1030

Open
gcharpe1604 wants to merge 1 commit into
goharbor:mainfrom
gcharpe1604:feature/gc-history
Open

feat(gc): add gc history subcommand#1030
gcharpe1604 wants to merge 1 commit into
goharbor:mainfrom
gcharpe1604:feature/gc-history

Conversation

@gcharpe1604

@gcharpe1604 gcharpe1604 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Part of #1017

This PR adds the harbor gc history subcommand. The original GC implementation has been split into smaller PRs following maintainer feedback.


🛠️ File Changes Breakdown

1. Core Feature Implementation (Manual Changes)

  • cmd/harbor/root/cmd.go: Registered the new gc parent command under the "System" group (and sorted imports alphabetically to pass formatting checks).
  • cmd/harbor/root/gc/cmd.go: Defined the parent gc command skeleton, registering only the history subcommand.
  • cmd/harbor/root/gc/history.go: Implemented CLI execution logic, output rendering config, and pagination/filtering options for the history command.
  • cmd/harbor/root/gc/gc_test.go: Added command tests to validate pagination flags and error boundaries.
  • pkg/api/gc_handler.go: Added the ListGCHistory handler leveraging the existing Harbor Go SDK client.
  • pkg/views/gc/list/view.go: Implemented the Bubble Tea table view for GC history list output, sorting the parameter columns alphabetically to prevent nondeterministic rendering of Go maps.

2. Auto-Generated Documentation

These files were generated by running go run doc.go and go run man-docs/man_doc.go from the doc directory to keep reference materials in sync:

  • doc/cli-docs/harbor.md & doc/man-docs/man1/harbor.1 (updated with gc subcommand entries)
  • doc/cli-docs/harbor-gc.md & doc/cli-docs/harbor-gc-history.md
  • doc/man-docs/man1/harbor-gc.1 & doc/man-docs/man1/harbor-gc-history.1

Signed-off-by: Govind Charpe <govind.charpe16@gmail.com>
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 21.15385% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.42%. Comparing base (60ad0bd) to head (22df487).
⚠️ Report is 190 commits behind head on main.

Files with missing lines Patch % Lines
pkg/views/gc/list/view.go 0.00% 29 Missing ⚠️
cmd/harbor/root/gc/cmd.go 0.00% 23 Missing ⚠️
cmd/harbor/root/gc/history.go 52.77% 16 Missing and 1 partial ⚠️
pkg/api/gc_handler.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             main   #1030      +/-   ##
=========================================
- Coverage   10.99%   9.42%   -1.57%     
=========================================
  Files         173     325     +152     
  Lines        8671   16186    +7515     
=========================================
+ Hits          953    1525     +572     
- Misses       7612   14526    +6914     
- Partials      106     135      +29     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant