-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat: CLI command to list the members of a Workspace [RM-388] #9686
Conversation
✅ Deploy Preview for determined-ui canceled.
|
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.
mostly lgtm thanks for working on this. i added some quick comments + a question in the slack thread.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9686 +/- ##
==========================================
- Coverage 53.44% 53.43% -0.01%
==========================================
Files 1257 1257
Lines 154350 154378 +28
Branches 3298 3298
==========================================
+ Hits 82494 82495 +1
- Misses 71706 71733 +27
Partials 150 150
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
I'd check the way we mark users and groups with product in case they have a preference otherwise the functionality lgtm. maybe the header could be full User/Group
to make it more clear.
Also, would we want to trim the user
and permission
objects from the json/yaml outputs? Is that something we do with any of our other CLIs? Let's skip this unless we get confirmation we want this.
.usersAssignedDirectly[]
.groups[].users[]
.assignments[].role.permissions[]
role:
name: WorkspaceAdmin
permissions:
# just keep the ids?
- id: PERMISSION_TYPE_VIEW_TEMPLATES
name: view templates
scopeTypeMask:
cluster: true
workspace: true
roleId: 2
scopeTypeMask:
cluster: true
workspace: true
- active: true
admin: false
agentUserGroup: null
displayName: ''
id: 2
lastAuthAt: null
modifiedAt: '2024-07-22T16:02:07.363788Z'
remote: false
# just keep the username?
username: determined
detproc.check_call(admin_sess, create_workspace_cmd) | ||
|
||
# Create test users (3) and groups (2) and assign to workspace. | ||
roles = ["Editor", "Viewer", "WorkspaceAdmin", "EditorRestricted", "ModelRegistryViewer"] |
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.
Do we have some enum
defined or a better way to access them? I couldn't find.
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.
not that I know of. but another suggestion around here would be to use this utility instead which directly uses our apis to set up (i think) what you're tying to set up
def create_workspaces_with_users( |
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.
I would prefer keeping the code same to maintain the consistency while creating the group, their roles and assigning to the workspace.
Thanks for suggesting though.
detproc.check_call(admin_sess, create_workspace_cmd) | ||
|
||
# Create test users (3) and groups (2) and assign to workspace. | ||
roles = ["Editor", "Viewer", "WorkspaceAdmin", "EditorRestricted", "ModelRegistryViewer"] |
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.
not that I know of. but another suggestion around here would be to use this utility instead which directly uses our apis to set up (i think) what you're tying to set up
def create_workspaces_with_users( |
harness/determined/cli/workspace.py
Outdated
cli.Group( | ||
cli.output_format_args["json"], | ||
cli.output_format_args["yaml"], | ||
cli.output_format_args["table"], |
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.
let's not include "--table", it's the default and not a "real" format
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.
one comment that's not necessarily blocking, but otherwise LGTM!
Ticket
RM-388
Description
We don't have a command that lists users/user-groups members of a Workspace and their permissions).
For details, visit original ask- DFR-462
Created a new CLI command to list user/group members of a Workspace
New CLI command:
Test Plan
No more tests needed
Test Done
Manually Tested
E2E Test completed
Created Workspace, UserGroup, User and given Roles (though CLI/WebUI)
Similar to the Members tab in WebUI
Output in PGAdmin:
data-1721352684733.csv
Checklist
docs/release-notes/
See Release Note for details.