Skip to content

feat(cli): show queue position during workspace builds #12606

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

Merged
merged 6 commits into from
Mar 18, 2024

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Mar 15, 2024

Fixes #9434

Note for the reviewer:

  • some drive-by refactoring to move regularly-referenced strings to consts
  • added the ability to use a regex match in PTTY output instead of a simple string match because I needed to prove the absence of any extra text
  • this works for both workspace stop and start
  • ensuring tests don't run indefinitely (added in 4367e65 in response to a review comment)

image

Each time the position in the queue changes, an update will be printed

image

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
e.t.Helper()

timeout, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
defer cancel()

return e.ExpectMatchContext(timeout, str)
return impl(timeout, str)
}

// TODO(mafredri): Rename this to ExpectMatch when refactoring.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mafredri not really sure what this TODO is about since both this and the ExpectMatch functions have lots of usage. Could you elaborate please?

Copy link
Member

@mafredri mafredri Mar 15, 2024

Choose a reason for hiding this comment

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

Essentially the non-context variant should be marked deprecated. All usage switched to context. Then delete the non-context one and rename this to not have context in the name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, is it because we need to be able to control the deadline?
I think I'll do that in a separate PR.

@dannykopping dannykopping marked this pull request as ready for review March 15, 2024 14:06
@dannykopping dannykopping requested review from johnstcn and mtojek March 15, 2024 14:53
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Some suggestions below.

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Nice! Feel free to ignore these nit picks. Happy weekend!

@matifali
Copy link
Member

We are now showing queue position in the workspace list page, and also on the CI.
How hard it would be to show the queue size on the /health page for each provisioner.

A nice to have would be to add an expandable table that lists the jobs/workspaces currently in queue for each of them.

@dannykopping
Copy link
Contributor Author

We are now showing queue position in the workspace list page, and also on the CI. How hard it would be to show the queue size on the /health page for each provisioner.

A nice to have would be to add an expandable table that lists the jobs/workspaces currently in queue for each of them.

Should be doable, but is out of scope for this issue.
I see you added a new issue #12627 👍 thanks; we'll address it separately.

@dannykopping dannykopping merged commit 93933d7 into coder:main Mar 18, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
@dannykopping dannykopping deleted the dk/cliq branch March 18, 2024 10:05
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.

Show place in queue in CLI (e.g. coder start [workspace])
5 participants