Skip to content

feat: add activity status and autostop reason to workspace overview #11987

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 17 commits into from
Feb 13, 2024

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Feb 1, 2024

Closes #11710
Closes #11694
Closes #12064

Screenshot 2024-02-07 at 5 01 49 PM
  • Adds a "Connected" badge next to the autostop timer to help clarify if anything has recently counted as "activity" in the workspace.
    • better indication when a workspace is "active" #11710 originally proposed that we expose what type of connection is "active", but we don't actually store that information on the backend on a per-workspace level (or there at least isn't an existing end point to get it). Given the complexity of obtaining that information, this pull request considers that out of scope.
  • Adds some language to the tooltips to describe where the deadline has come from (either template settings or workspace settings)
  • I also haven't really added any wording to explain how the "deadline bump" works because frankly it's super confusing and hard to explain without using a bunch of internal technical jargon. I've really been trying to come up with a way to explain it/display it that makes everything "clear" but I'm just totally stuck.

How deadline bumping works, for posterity

Whenever the agent reports to the backend with an active connection we set the "workspaces"."last_used_at" column to now() and the "workspace_builds"."deadline" column to now() + "1 hour"::interval, if it is not already at least 1 hour away, or to "workspace_builds"."max_deadline" if that would be sooner. I still don't get where max_deadline comes from.

So basically, the deadline will decrease continuously until it gets to less than 1 hour, at which point it will essentially stay pinned at 1 hour as long as a connection remains active, or until the max deadline is less than an hour away.

Options for communicating this

  • Hide the deadline while there is an active connection until deadline == max_deadline
    • Leaves potential for the deadline to sneak right up to the max_deadline without quite hitting it, and then the workspace just shuts off
    • If the deadline is already close to the max_deadline, and a user connects, they might go check the dashboard, see that it says "your activity is keeping your workspace alive", and then be caught off guard when it disconnects an hour and a half later.
    • Maybe we do this, but start to warn when deadline is within a few hours of max_deadline?
  • Show the max_deadline while there is an active connection
    • But this is lying, and it would suddenly jump way back when there is no longer a connection, which is confusing and feels bad
  • Say something like "this workspace will stop at {max_deadline} regardless of active connections" I guess?
    • Feels scary, but at least isn't lying

Update: We've decided to go with a variation on the first one: only show the warning while there is activity if the max_deadline is within two hours. This will supplemented by notifications from the VSCode and JetBrains extensions in the future.

@aslilac aslilac force-pushed the clarify-stop-warning branch from e68fbc6 to cdc0ea2 Compare February 7, 2024 00:15
@aslilac aslilac marked this pull request as ready for review February 8, 2024 00:44
@aslilac aslilac changed the title fix: clarify autostop warning feat: add activity status and autostop reason to workspace overview Feb 8, 2024
@aslilac
Copy link
Member Author

aslilac commented Feb 8, 2024

(seriously, where does max_deadline come from?)

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

FE code looks good! Regarding the considerations, I think they make sense, but I also don't know what are the best choices. Something @bpmct and @matifali could help

@aslilac aslilac requested a review from coadler February 9, 2024 20:38
@aslilac aslilac merged commit d37b131 into main Feb 13, 2024
@aslilac aslilac deleted the clarify-stop-warning branch February 13, 2024 17:50
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants