-
Notifications
You must be signed in to change notification settings - Fork 35
Show Remote SSH Output panel on workspace start #627
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
5e0f0ce
6e86cfe
d545ba5
9bf0cd7
e4bd57f
2bc26f9
b18dd33
bc4ba72
b342a11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,8 @@ export class WorkspaceStateMachine implements vscode.Disposable { | |
| case "pending": | ||
| case "starting": | ||
| case "stopping": | ||
| // Clear the agent ID since it could change after a restart | ||
| this.agentId = undefined; | ||
| progress?.report({ message: "Waiting for workspace build..." }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about putting the build state in here? |
||
| this.logger.info(`Waiting for ${workspaceName}...`); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,7 @@ export class WorkspaceMonitor implements vscode.Disposable { | |
| private notifiedDeletion = false; | ||
| private notifiedOutdated = false; | ||
| private notifiedNotRunning = false; | ||
| private isReady = false; | ||
| private completedInitialSetup = false; | ||
|
|
||
| readonly onChange = new vscode.EventEmitter<Workspace>(); | ||
| private readonly statusBarItem: vscode.StatusBarItem; | ||
|
|
@@ -111,6 +111,10 @@ export class WorkspaceMonitor implements vscode.Disposable { | |
| return monitor; | ||
| } | ||
|
|
||
| public markInitialSetupComplete(): void { | ||
| this.completedInitialSetup = true; | ||
| } | ||
|
|
||
| /** | ||
| * Permanently close the websocket. | ||
| */ | ||
|
|
@@ -124,7 +128,6 @@ export class WorkspaceMonitor implements vscode.Disposable { | |
| } | ||
|
|
||
| private update(workspace: Workspace) { | ||
| this.updateReadyState(workspace); | ||
| this.updateContext(workspace); | ||
| this.updateStatusBar(workspace); | ||
| } | ||
|
|
@@ -133,7 +136,7 @@ export class WorkspaceMonitor implements vscode.Disposable { | |
| this.maybeNotifyOutdated(workspace); | ||
| this.maybeNotifyAutostop(workspace); | ||
| this.maybeNotifyDeletion(workspace); | ||
|
Comment on lines
136
to
138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was thinking about this some more, and we probably want to skip the deletion notification while in the setup phase too, otherwise I think we would get one notification here, and then another from the error thrown during setup. Autostop and outdated I think are OK to show even during setup. |
||
| if (this.isReady) { | ||
| if (this.completedInitialSetup) { | ||
| // This instance might be created before the workspace is running | ||
| this.maybeNotifyNotRunning(workspace); | ||
| } | ||
|
|
@@ -249,12 +252,6 @@ export class WorkspaceMonitor implements vscode.Disposable { | |
| this.logger.error(message); | ||
| } | ||
|
|
||
| private updateReadyState(workspace: Workspace): void { | ||
| if (workspace.latest_build.status === "running") { | ||
| this.isReady = true; | ||
| } | ||
| } | ||
|
|
||
| private updateContext(workspace: Workspace) { | ||
| this.contextManager.set("coder.workspace.updatable", workspace.outdated); | ||
| } | ||
|
|
||
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 we need to clear the agent socket here as well or something, when I stop my workspace and it starts again, I do not see the agent script logs the second time.
Or, maybe we clear the socket when the agent closes, or both.