Skip to content
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

Start workspaces by shelling out to CLI #518

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

aaronlehmann
Copy link
Contributor

Replace the REST-API-based start flow with one that shells out to the coder CLI.

This is the JetBrains extension equivalent to coder/vscode-coder#400.

Replace the REST-API-based start flow with one that shells out to the
coder CLI.

This is the JetBrains extension equivalent to
coder/vscode-coder#400.
@@ -659,7 +659,7 @@ class CoderWorkspacesStepView :
cs.launch(ModalityState.current().asContextElement()) {
while (isActive) {
loadWorkspaces()
delay(5000)
delay(1000)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this poll more frequently because so it picks up the "Starting" state faster while the CLI is starting the workspace. I'm not sure if there's a good way to switch to fast polling while the CLI is running and then switch back - feel free to make suggestions or commit to the branch!

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can redirect the output to somewhere (or nothing, since we are not using it) so we can return immediately from the exec and loadWorkspaces() will run right away to pick up the starting state as quickly as possible. Let me experiment for a bit and see. Code looks good to me though!

@@ -659,7 +659,7 @@ class CoderWorkspacesStepView :
cs.launch(ModalityState.current().asContextElement()) {
while (isActive) {
loadWorkspaces()
delay(5000)
delay(1000)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can redirect the output to somewhere (or nothing, since we are not using it) so we can return immediately from the exec and loadWorkspaces() will run right away to pick up the starting state as quickly as possible. Let me experiment for a bit and see. Code looks good to me though!

@code-asher
Copy link
Member

code-asher commented Jan 3, 2025

Going ahead with merge, I will experiment with what I mentioned in just a bit, but also a one second poll might be better anyway? Not sure if it will contribute meaningfully to backend load or anything.

@code-asher code-asher merged commit 8a896dd into coder:main Jan 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants