-
Notifications
You must be signed in to change notification settings - Fork 348
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: Implement det cmd describe
#9500
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9500 +/- ##
==========================================
- Coverage 51.64% 51.64% -0.01%
==========================================
Files 1255 1255
Lines 152618 152631 +13
Branches 3092 3092
==========================================
+ Hits 78816 78820 +4
- Misses 73645 73654 +9
Partials 157 157
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.
lgtm
if c.taskType == cmdType && | ||
((len(users) == 0 && len(userIds) == 0) || users[username] || userIds[userID]) && | ||
(len(ids) == 0 || ids[id]) { |
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.
nit: this is kinda hard for me to understand
maybe we could split this up into seperate if statements, like workspaceID does
@@ -158,6 +158,7 @@ func (cs *CommandService) listByType( | |||
reqUserIDs []int32, | |||
cmdType model.TaskType, | |||
workspaceID int32, | |||
reqIDs *[]string, |
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.
nit: I think I prefer reqIDs being not a pointer, to match the style of reqUsers
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.
It would be nice to be consistent, but I wanted to make it optional and use nil
for non command task
i know the JIRA for this suggests supporting a list of IDs is a good idea, but i disagree. the use case for filtering a list of command tasks by a list of IDs seems really weak to me. commands aren't really objects that are intended to be created and processed in large numbers or batches. you run commands usually as one-off processes for debugging or other manual tasks. i really can't imagine someone a) having enough commands that the list is large enough that filtering is necessary, and b) wanting to take the time to copy and paste a batch of UUIDs just to filter that list. if we did want to support filtering on commands, we shouldn't do it by IDs. it'd be more sensible to accept a filter like workspace ID, or ordering parameters to sort by timestamps, etc. filtering by IDs might make sense for a batch operation on something like checkpoints, where you often want to delete/download a known batch of IDs. but here we're just filtering them to render, and i highly doubt anyone will have more than 1 or 2 active command tasks at any point in time. seems like a silly feature to me, we don't support this for any other object, doesn't make sense to support it for commands. my vote is that we just don't support passing multiple |
--ids
to det cmd list
det cmd describe
@azhou-determined Thanks for your comments, I agree with what you said and implement |
|
||
**New Features** | ||
|
||
- CLI: Add the ability to fetch metadata of a single command using ``det cmd describe COMMAND_ID``. |
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.
- CLI: Add the ability to fetch metadata of a single command using ``det cmd describe COMMAND_ID``. | |
- CLI: Add a new command, ``det cmd describe COMMAND_ID`` to allow users to fetch the metadata of a single command. | |
- ``` |
@@ -0,0 +1,5 @@ | |||
:orphan: |
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.
add a bug fix note about Fix an error related to det cmd ls --csv
e.g.,
Bug Fixes
- CLI: Fix a bug where....
item = sess.get(f"api/v1/{RemoteTaskNewAPIs[args._command]}/{task_id}").json()["command"] | ||
|
||
w_names = workspace.get_workspace_names(sess) | ||
if item["state"].startswith("STATE_"): |
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.
this logic could be item["state"].replace("STATE_", "")
not important, but i feel it's a tiny bit cleaner
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
Ticket
MD-139
Description
Implement
det cmd describe
so that user can use CLI to fetch metadata for a single command.Also fix an error related to
det cmd ls --csv
Test Plan
Start multiple commands using
det cmd run ...
det cmd list
would return the entire list of commandsSelect one of the commands and pass it's ids to
det cmd describe COMMAND_ID
You should only see selected command
Passing invalid id would display
Failed to display command metadata
Other arguments such as
--json/csv
work as expectedChecklist
docs/release-notes/
.See Release Note for details.