Skip to content

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Feb 27, 2024

Part of #12163

Adds a command coder support bundle <workspace> that generates a support bundle and writes it to coder-support-$(date +%s).zip.

Note: this is hidden for the moment as there are still some missing pieces.

@johnstcn johnstcn self-assigned this Feb 27, 2024
Base automatically changed from cj/pkg-support to main February 29, 2024 11:58
@johnstcn johnstcn force-pushed the cj/cmd-support branch 3 times, most recently from 9c76309 to a6a89c9 Compare March 1, 2024 12:59
@johnstcn johnstcn marked this pull request as ready for review March 1, 2024 13:24
@johnstcn johnstcn requested review from mtojek and mafredri March 1, 2024 13:25
Copy link
Member

@mafredri mafredri left a 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
Copy link
Member

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.

Copy link
Member Author

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.

@johnstcn johnstcn requested review from mafredri and mtojek March 1, 2024 15:28
@johnstcn
Copy link
Member Author

johnstcn commented Mar 1, 2024

fwiw, my recent pushes may not show up due to https://www.githubstatus.com/incidents/wcl1sw4mzg60

Copy link
Member

@mafredri mafredri left a 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 == "" {
Copy link
Member

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.

Copy link
Member Author

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 }",
Copy link
Member

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?

Copy link
Member Author

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.

@johnstcn johnstcn merged commit b1c2fea into main Mar 1, 2024
@johnstcn johnstcn deleted the cj/cmd-support branch March 1, 2024 17:13
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants