#fix: improve replication policy config logging and credential error m…#649
Conversation
…essage Signed-off-by: krypton36 <srai325356@gmail.com>
9daa0a8 to
2f9313c
Compare
There was a problem hiding this comment.
Pull request overview
This pull request improves observability and user experience when creating replication policies via CLI by adding debug logging at key stages of the configuration loading process and improving the error message when Harbor credentials are missing.
Changes:
- Added debug logs to track replication policy config file reading, parsing (YAML/JSON), and validation stages
- Updated credential error message to be more actionable by instructing users to run
harbor login
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| pkg/utils/client.go | Improved error message to guide users to run harbor login when credentials are not configured |
| pkg/config/replication/policies.go | Added debug logging for config file reading, parsing, and validation to improve observability |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log.Debug("Replication policy config file read successfully") | ||
|
|
There was a problem hiding this comment.
There are extra blank lines after the log.Debug statement that are inconsistent with the codebase style. Similar log statements in the codebase (e.g., in cmd/harbor/root/replication/policies/list.go) typically have only one blank line after them, not two.
| log.Debugf("Parsed %s configuration successfully", fileType) | ||
|
|
There was a problem hiding this comment.
There are extra blank lines after the log.Debugf statement that are inconsistent with the codebase style. Similar log statements in the codebase typically have only one blank line after them, not two.
| log.Debugf("Parsed %s configuration successfully", fileType) | ||
|
|
There was a problem hiding this comment.
There are extra blank lines after the log.Debugf statement that are inconsistent with the codebase style. Similar log statements in the codebase typically have only one blank line after them, not two.
| log.Debug("Replication policy configuration validated successfully") | ||
|
|
There was a problem hiding this comment.
There are extra blank lines after the log.Debug statement that are inconsistent with the codebase style. Similar log statements in the codebase typically have only one blank line after them, not two.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
=========================================
- Coverage 10.99% 7.17% -3.82%
=========================================
Files 173 260 +87
Lines 8671 12851 +4180
=========================================
- Hits 953 922 -31
- Misses 7612 11821 +4209
- Partials 106 108 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
qcserestipy
left a comment
There was a problem hiding this comment.
Thank you for your contribution! :) Before merging this PR please make sure to fix the failing lint tasks in the pipeline. Please also make sure to remove compiled binaries.
Otherwise LGTM
Signed-off-by: krypton36 <srai325356@gmail.com>
|
Thanks for the review! I’ve fixed the lint issues, removed compiled binaries from the repository as suggested. Please let me know if anything else is needed. |
Signed-off-by: krypton36 <srai325356@gmail.com>
This PR improves observability and user experience when creating replication policies via CLI.
Changes:
harbor loginTesting: