Skip to content

feat: add auto-locking/deleting workspace based on template config #8240

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 10 commits into from
Jul 3, 2023

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Jun 28, 2023

This PR adds support for:

  • Automatically stopping and locking workspaces that breach a template's inactivity_ttl
  • Automatically deleting locked workspaces that breach a template's locked_ttl

It adds some additional build_reasons, naming subject to change.

It also fixes a couple of bugs:

  • Fixes an issue where updating the locked_ttl of a template would sometimes have no effect
  • Updates a workspaces last_used_at when locking/unlocking a workspace. This is to avoid immediately retriggering the inactivity threshold configured on the template.

fixes #8172

@sreya sreya marked this pull request as ready for review June 28, 2023 22:34
@sreya sreya requested a review from johnstcn June 29, 2023 04:58
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.

Change looks good to me - however I would much prefer to never depend on external time in the autobuild logic. This reduces the likelihood of test flakes and lets us have greater confidence of time-based logic.

@sreya sreya merged commit 4a9c8f4 into main Jul 3, 2023
@sreya sreya deleted the jon/autolock branch July 3, 2023 02:29
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2023
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.

workspace actions: support autolocking/deleting workspace based on template values
2 participants