Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Add coder envs rebuild and watch-build commands#146

Merged
cmoog merged 1 commit intomasterfromenvs-rebuild
Oct 20, 2020
Merged

Conversation

cmoog
Copy link
Contributor

@cmoogcmoog commentedOct 20, 2020
edited
Loading

$ coder envs rebuild entdev --followRebuild environment "entdev"? (will destroy any work outside of /home): y█✅ -- 2020-10-20T00:43:06Z Ensuring private SSH key✅ -- 2020-10-20T00:43:06Z Deleting old environment✅ -- 2020-10-20T00:43:50Z Deleting old network isolation policy✅ -- 2020-10-20T00:43:50Z Deleting old service✅ -- 2020-10-20T00:43:51Z Getting default user from image✅ -- 2020-10-20T00:43:56Z Ensuring environment has a home volume✅ -- 2020-10-20T00:43:56Z Creating network isolation policy✅ -- 2020-10-20T00:43:56Z Ensuring environment service

Comment on lines +175 to +185
// BuildLogFollowMsg wraps the base BuildLog and adds a field for collecting
// errors that may occur when follow or parsing.
type BuildLogFollowMsg struct {
BuildLog
Err error
}

// FollowEnvironmentBuildLog trails the build log of a Coder environment.
func (c Client) FollowEnvironmentBuildLog(ctx context.Context, envID string) (<-chan BuildLogFollowMsg, error) {
ch := make(chan BuildLogFollowMsg)
ws, err := c.DialEnvironmentBuildLog(ctx, envID)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@f0ssel@coadler Any thoughts on this pattern? Seems better to me than having aBuildLogWatcher type with methods for iterating when channels are designed for that.

@cmoogcmoog marked this pull request as ready for reviewOctober 20, 2020 00:58
@cmoogcmoog requested a review fromfuskovicOctober 20, 2020 02:49
return l.Err
}
switch l.BuildLog.Type {
case coder.BuildLogTypeStart:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we need to do anything for this case?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The FE uses this to reset the UI logs, but since we're just trailing I don't think it makes sense to do anything. Plus we exit after the Done message is sent anyway.

fuskovic reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That makes sense.

I think that explanation should be plugged in as a comment.

cmoog reacted with thumbs up emoji
fmt.Print(color.RedString("\t%s", l.BuildLog.Msg))
s = newSpinner()
case coder.BuildLogTypeDone:
s.Stop()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is it possible thats could be nil here or is it safe to assume we'll always have assigned the return value ofnewSpinner tos before we get here?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah good catch. Assuming the build log records are properly formed, thisshouldn't be an issue. That said, I'll push a change that better handles the nil case to avoid panics.

@cmoogcmoogforce-pushed theenvs-rebuild branch 3 times, most recently from077cfa8 toa14543aCompareOctober 20, 2020 15:11
@cmoogcmoog merged commit70615c4 intomasterOct 20, 2020
@cmoogcmoog deleted the envs-rebuild branchOctober 20, 2020 16:04
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@fuskovicfuskovicfuskovic approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@cmoog@fuskovic

[8]ページ先頭

©2009-2025 Movatter.jp