Skip to content

Workspace termination warning in IDE

MR: Pending

Description

As a user I need to be notified that a workspace is nearing it's expiration.

The ability to extend the timeout will be tackled as part of [BACKEND] Allow `max_hours_before_termination` ... (#467418 - closed)

Proposed Solutions

Solution 1

  • During workspace reconciliation, we will inject a new file at location specified by GL_WORKSPACE_METADATA_FILE variable who value would be /projects/.gl-tools/gl_workspace_metadata.json (need to finalize the naming)
  • The structure of this JSON file will be -
    {
        "timeout": {
            "notify": boolean,
            "time_left": string,
            "help_msg": string,
        }
    }
  • Every time during reconciliation, these values would be dynamically calculated and sent. Whenever the time left is 1 hour, 30 minutes, 10 minutes, we will set notify to true; else it will be false. We'll have to use the timestamp of the last successful reconciliation for the workspace to keep track of whether we have sent the alert for 1 hour, 30 minutes, 10 minutes. But this is an implementation detail and doesn't change anything.
  • Sending this data as a file is necessary because it allows us to update that file without restarting the workspace pod because of Kubernetes in-built features.
  • We will build a new extension for every IDE we support(right now VS Code fork) which will watch this file specified by GL_WORKSPACE_METADATA_FILE. If there are any changes to this file, it will read it and parse it. If notify is true, it will create a popup in the IDE with the help_message as its content.
  • Once the users realize that their workspace is going to Terminate soon, they could extend their timeout once ttps://gitlab.com/gitlab-org/gitlab/-/issues/467418+ is complete.
  • Creating a new extension allows us to add more workspace specific behaviour in those extensions and customize our IDE in a generic manner.

Acceptance Criteria

Technical Requirements

Design Requirements

Impact Assessment

Users need to be aware of WS termination timelines, in order to prevent work from possibly being lost.

User Story

TODO: Fill out or delete [Provide a user story to illustrate the use case for this feature/enhancement. Include examples to help communicate the intended functionality.]

Edited by Vishal Tak