-
Notifications
You must be signed in to change notification settings - Fork 996
feat(cli): add support cmd #12328
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): add support cmd #12328
Conversation
8803550
to
778616b
Compare
9c76309
to
a6a89c9
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.
Looks good, mainly questions and suggestions.
func humanizeAgentLogs(ls []codersdk.WorkspaceAgentLog) string { | ||
var l log.Logger | ||
|
||
var buf bytes.Buffer |
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.
Why do we use an intermediary vs passing in the writer? Perhaps can be resolved by wrapping in funcs.
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.
Tried it, makes things more complicated than I'd like.
fwiw, my recent pushes may not show up due to https://www.githubstatus.com/incidents/wcl1sw4mzg60 |
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.
Only minor stuff left, but LGTM otherwise!
|
||
deps.AgentID = agt.ID | ||
|
||
if outputPath == "" { |
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.
Could do this even before we fetch the workspace from API since it's not used as part of the filename.
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 think it makes more sense to do the up-front checks first; if the workspace doesn't even exist then there's no point in writing the file.
cli/support.go
Outdated
|
||
func (r *RootCmd) support() *clibase.Cmd { | ||
supportCmd := &clibase.Cmd{ | ||
Use: "support { dump }", |
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.
Just spotted, what's the purpose of { dump }
here?
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.
Ah I forgot that clibase
will handle showing the subcommands.
Part of #12163
Adds a command
coder support bundle <workspace>
that generates a support bundle and writes it tocoder-support-$(date +%s).zip
.Note: this is hidden for the moment as there are still some missing pieces.