Skip to content

Support Prebuild Invalidation via API #17917

Open
@ssncferreira

Description

@ssncferreira

Problem

Prebuilt workspaces can become stale over time due to factors such as:

  • The monorepo cloned during the prebuild falling behind its origin.
  • New VM AMIs or container images being released after the prebuild was created.

Currently, there is no API endpoint to invalidate prebuilt workspaces. Internally, invalidation is equivalent to deleting a workspace. Therefore, the new functionality should reuse the same mechanics as the existing delete workspace operation, which is performed via the API endpoint POST /workspaces/{workspace}/builds.

While it will be possible to manually delete (both single and bulk) prebuilt workspaces from the UI once template admins are allowed to delete prebuilds (issue #18191), this can be a tedious and error-prone process for templates with many presets or a high number of prebuilds.

Proposed solution

  • Add a new API endpoint to invalidate all prebuilt workspaces associated with the active version of a given template.
  • The action should be triggered via a single click in the UI by a user with the appropriate role (e.g., TemplateAdmin).
  • Internally, this endpoint can perform a bulk delete of the associated prebuilt workspaces.
  • Update the documentation if needed

Depends on #18191

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions