Skip to content

feat(workspaces): restart up-to-date workspaces in one build on 2.36+ - #1242

Open
EhabY wants to merge 3 commits into
mainfrom
feat/vsc-63-one-build-restart
Open

EhabY wants to merge 3 commits into
mainfrom
feat/vsc-63-one-build-restart

Conversation

@EhabY

@EhabY EhabY commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • On Coder 2.36+, restartWorkspace queues one { transition: "stop", on_success: { transition: "start", ... } } build through runBuild when updating a running workspace or restarting an up-to-date workspace (!workspace.outdated).
  • Keeps the client-side stop-then-start fallback on servers before 2.36 and for plain restarts of outdated workspaces.
  • Why outdated workspaces keep the two-build path: in coder/coder, an unset on_success.template_version_id starts the follow-up build on the template's active version (Orchestrator.createBuild calls builder.ActiveVersion()), while pinning on_success.template_version_id requires template update permission (policy.ActionUpdate on the template). Gating on !workspace.outdated avoids silently updating outdated workspaces during a restart.
  • WorkspaceActionRunner fetches getBuildInfo only when onSuccessBuild can be used (running update and non-outdated restart), checking abort before and after the call.

Closes VSC-63

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
  • pnpm test:extension test/unit/api/workspace.test.ts test/unit/webviews/workspaces/workspaceActionRunner.test.ts (65/65 passed)

@linear-code

linear-code Bot commented Dec 3, 2026

Copy link
Copy Markdown

VSC-63

@EhabY EhabY self-assigned this Dec 3, 2026
EhabY added 3 commits December 4, 2026 17:33
Uses on_success on the stop build when the deployment supports it (2.36+) and the workspace is already on the active template version, keeping the two-build stop-then-start for older servers and outdated workspaces so restarts do not silently update.

Closes VSC-63
@EhabY
EhabY requested a review from aqandrew December 4, 2026 14:35
@EhabY
EhabY force-pushed the feat/vsc-63-one-build-restart branch from fbac35b to 904faf6 Compare December 4, 2026 14:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant