fix(user): harbor user elevate to handle empty responses#634
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #634 +/- ##
=========================================
- Coverage 10.99% 7.23% -3.76%
=========================================
Files 173 261 +88
Lines 8671 12923 +4252
=========================================
- Hits 953 935 -18
- Misses 7612 11880 +4268
- Partials 106 108 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@vg006 fix lint and let me know |
|
@bupd |
|
@vg006 curious what screenrecorder are you using here. to get the gifs. |
|
Btw I use Charm's Just record, test and repeat, until you get it correctly 😄 |
qcserestipy
left a comment
There was a problem hiding this comment.
@vg006 Thank you very much for taking up this issue! Could you explain why log.SetOutput(cmd.OutOrStderr()) is necessary here? This pattern isn't used anywhere else in the codebase, so I'm curious if there's a specific reason for it in this case.
|
@qcserestipy As you can see here, the logger is set with So this silences the logrus. I agree that it is logged in the verbose mode, but normally a command should provide a proper closure upon the exit right. So I set it explicitly using the Cobra's writers within the command itself, instead of tweaking the global configuration. |
|
@bupd How about this change?
|
|
@vg006 @bupd I think changing the styling and color for this command only is not really necessary. Since we return simple text in every other command it could be confusing that it is different here. Just returning the error message as text should be the simplest. I guess |
|
I thought of improving the UX and I have just used the styles that are already defined in the project. Just added a utility function that returns the given text, wrapped by ANSI sequences. Fine, then as per your suggestion, let me make this PR minimal. |
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
Signed-off-by: vg006 <devvg006@gmail.com>
|
@qcserestipy I just updated the view, so that a line stating that "No users found in the registry" is printed simply, without any fancy view and ANSI sequences. I have also update the command to return error (from Preview |
Signed-off-by: vg006 <devvg006@gmail.com>
|
@bupd @qcserestipy |




Overview
Fixes #633
The
elevatesub-command of theusercommand is updated to,cc: @bupd @NucleoFusion
Preview