-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add roles CLI #9211
Add roles CLI #9211
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #9211 +/- ##
============================================
- Coverage 38.58% 38.54% -0.05%
Complexity 2242 2242
============================================
Files 1285 1286 +1
Lines 97808 97911 +103
Branches 3254 3254
============================================
- Hits 37737 37735 -2
- Misses 58142 58247 +105
Partials 1929 1929
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d4b22b8
to
75dd801
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I came across two irritating little things while testing the CLI.
75dd801
to
fa10c41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and might be missing some information on the CLI. Here is an example (I removed all tracing
logs).
❯ export RUST_LOG=none
❯ editoast roles list 1
morane#1 (Bob Morane) has no roles assigned
❯ editoast roles add 1 SuperUser StdcmAdmin
❯ editoast roles list 1
Superuser
StdcmAdmin
❯ editoast roles remove 1 SuperUser StdcmAdmin
A few things to note that could be improved.
- When adding roles, there is no message confirming everything went fine.
- When removing roles, there is no message confirming everything went fine.
- When adding or removing roles of a user that doesn't exist, there is also no message.
- When listing roles and the user has no roles, the user and its ID are clearly identified... but not when the user has roles, only the roles are displayed: maybe having also the user printed would be nice
Another problem I see is that I would expect add
to append roles, but it actually overwrites the existing list. See for example.
❯ editoast roles add 1 SuperUser StdcmAdmin
❯ editoast roles list 1
Superuser
StdcmAdmin
❯ editoast roles add 1 OpsWrite
❯ editoast roles list 1
OpsWrite
I would expect the last command to output 3 values.
Would it make sense to add some tests about it?
fa10c41
to
fc60ff6
Compare
As discussed:
Can't reproduce.
My logic for choosing between logging and @woshilapin Wdyt? |
Can't reproduce either, I might have messed up somewhere, sorry.
I agree, that was a point of view I didn't have and a totally valid one. Fine with me. |
fc60ff6
to
79e3ff4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Let's merge that 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
79e3ff4
to
5e12ec7
Compare
closes #8744