Cleanup: Extend CLI error wrapping to subscribe and config commands#3837
Cleanup: Extend CLI error wrapping to subscribe and config commands#3837cubaseuser123 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: cubaseuser123 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @cubaseuser123. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
006c3a9 to
798d197
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3837 +/- ##
==========================================
+ Coverage 54.03% 54.05% +0.02%
==========================================
Files 200 200
Lines 23567 23709 +142
==========================================
+ Hits 12734 12817 +83
- Misses 9604 9664 +60
+ Partials 1229 1228 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
798d197 to
9f3c2aa
Compare
This continues my error wrapping work from #3773. I checked the remaining CLI commands and found
subscribeand theconfigsubcommands still bypass the error wrapping layer incmd/errors.gowhen run in an uninitialized directory.subscriberelied on a hardcoded inlinefmt.Errorf.configignored load errors.This PR standardizes CLI error wrapping across the codebase.
It covers:
fmt.ErrorfinsubscribewithNewErrNotInitializedFromPathwrapConfigErrorininitConfigCommandso config subcommands (labels,envs,volumes,git) get the standard help text"subscribe"and"config"cases to theErrNotInitialized.Error()switch(Side note: I added
cmd/errors_test.go. In the previous PR, we hit a Codecov block because we missed testing the wrapper functions directly, leaving patch coverage around 40%. This time, I added tests forwrapSubscribeError,wrapConfigError, and the other wrappers to guarantee 100% patch coverage.)all other tests pass locally, let me know if any further changes are required!