Conversation
qcserestipy
left a comment
There was a problem hiding this comment.
Thank you for this contribution! The code already looks good. Before merging please add the additional validation of input flags.
|
@qcserestipy done! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
=========================================
- Coverage 10.99% 7.46% -3.53%
=========================================
Files 173 261 +88
Lines 8671 13021 +4350
=========================================
+ Hits 953 972 +19
- Misses 7612 11940 +4328
- Partials 106 109 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #702 by enabling the --page, --page-size, --query, and --sort flags for the project logs command. Previously, these flags were defined but not actually passed to the API handler, rendering them ineffective.
Changes:
- Modified
LogsProject()function inpkg/api/project_handler.goto accept variadicListFlagsparameter and pass pagination/filtering options to the Harbor API - Updated
project logscommand to pass theoptstoLogsProject()and added validation for the page number
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/api/project_handler.go | Added variadic opts ...ListFlags parameter to LogsProject() function and passed Page, PageSize, Q, and Sort fields to the GetLogExts API call |
| cmd/harbor/root/project/logs.go | Added page number validation and passed opts to the LogsProject() API call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
484a344 to
60bfc3a
Compare
Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
Signed-off-by: Sypher845 <suyashpatil845@gmail.com>
8c3369f to
f33b22f
Compare
Fixes #702
--page,--page-size,--query,--sortflags now work as expected.In
cmd/harbor/root/project/logs.go, now the listFlag (opts) is passed.resp, err = api.LogsProject(projectName, opts)Also the
LogsProject()now handles the logic of sending the required params