fix: reject invalid page values in selected list commands#779
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #779 +/- ##
=========================================
- Coverage 10.99% 9.13% -1.86%
=========================================
Files 173 270 +97
Lines 8671 13195 +4524
=========================================
+ Hits 953 1206 +253
- Misses 7612 11876 +4264
- Partials 106 113 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, I’ll expand the validation to all commands that accept |
Signed-off-by: PrasunaEnumarthy <eswari.prasuna@gmail.com>
Signed-off-by: PrasunaEnumarthy <eswari.prasuna@gmail.com>
2a70a76 to
4766d04
Compare
|
Thanks, I’ve updated the PR to add the '--page >= 1' validation to all commands that define go test ./cmd/harbor/root/artifact ./cmd/harbor/root/project ./cmd/harbor/root/registry |
|
@qcserestipy can you please review when you have time... |
|
@PrasunaEnumarthy Thank you for taking that up, please fix the lint pipeline. If possible also please add more tests for the other list commands. |
Signed-off-by: PrasunaEnumarthy <eswari.prasuna@gmail.com>
d17759c to
8713d11
Compare
Signed-off-by: PrasunaEnumarthy <eswari.prasuna@gmail.com>
|
@qcserestipy |
qcserestipy
left a comment
There was a problem hiding this comment.
LGTM, thank you for your contribution!

Description
This pull request adds early validation for invalid
--pagevalues in selected list commands.Previously, some commands accepted invalid values such as
--page 0or negative page numbers and passed them to the API, which could lead to inconsistent behavior.This change ensures that invalid page values are rejected before making API calls, improving CLI reliability and consistency.
Type of Change
Please select the relevant type.
Changes
--page < 1in:harbor artifact listharbor project listharbor registry listharbor project logsfor consistency