🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

feat(cli): server-side restart orchestration demo - #25761

Closed
geokat wants to merge 17 commits into
mainfrom
george/plat-143/5-server-side-restart-orchestration-demo
Closed

feat(cli): server-side restart orchestration demo#25761
geokat wants to merge 17 commits into
mainfrom
george/plat-143/5-server-side-restart-orchestration-demo

Conversation

@geokat

@geokat geokat commented May 27, 2026

Copy link
Copy Markdown
Contributor

This PR is a demo layer on top of the durable server-side workspace restart stack.
It is not intended to be merged.

Update coder restart to exercise the new API flow by posting a stop build with
an on_success start build instead of waiting for the stop to finish and then
posting the start build from the CLI.

This demonstrates the behavior enabled by the previous PRs: once the stop build
request is accepted, restart intent is persisted server-side, so the CLI no longer
needs to stay connected for the start build to be queued after the stop succeeds.


This PR is part of a stack that merges into main:

  1. feat: add workspace build orchestration storage #25757
  2. feat: add on_success workspace build request handling #25758
  3. feat(coderd): process on_success workspace build orchestration #25759
  4. chore(coderd/database): purge terminal workspace build orchestrations #25760
  5. feat(cli): server-side restart orchestration demo #25761 👈

Created with stakk

Add the workspace_build_orchestrations table, SQLC queries, generated
store wrappers, and dbauthz coverage for durable follow-up workspace
build intent.

This includes insert, claim, completion, failure, cancellation, and
retry update queries, plus authorization for creating orchestration
rows and template version pin handling for child builds.

Ref: https://linear.app/codercom/issue/PLAT-143/add-workspace-restart-functionality-to-api
Ref: #5800
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from 6604ffa to 711f3b7 Compare May 28, 2026 04:27
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 51c512a to 31ac08b Compare May 28, 2026 04:27
@github-actions github-actions Bot added the stale This issue is like stale bread. label Jun 10, 2026
@geokat geokat removed the stale This issue is like stale bread. label Jun 12, 2026
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from 711f3b7 to 7d48ade Compare June 16, 2026 23:57
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 31ac08b to 87cfc80 Compare June 16, 2026 23:57
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from 7d48ade to c976ecf Compare June 17, 2026 19:32
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 87cfc80 to 9ae84d9 Compare June 17, 2026 19:32
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from c976ecf to 7ab27d6 Compare June 17, 2026 20:56
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 9ae84d9 to e2584ed Compare June 17, 2026 20:56
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from 7ab27d6 to afd17c6 Compare June 17, 2026 23:23
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from e2584ed to 8398ba8 Compare June 17, 2026 23:24
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from afd17c6 to 3d602a6 Compare June 24, 2026 01:11
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 8398ba8 to fae9652 Compare June 24, 2026 01:11
@geokat
geokat force-pushed the george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations branch from 3d602a6 to 7c9d070 Compare June 30, 2026 21:58
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch 3 times, most recently from 0a855e8 to 7417b9e Compare July 6, 2026 20:12
Base automatically changed from george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations to george/plat-143/3-process-on-success-workspace-build-orchestration July 6, 2026 20:42
Base automatically changed from george/plat-143/3-process-on-success-workspace-build-orchestration to george/plat-143/2-on-success-workspace-build-request-handling July 6, 2026 20:45
Base automatically changed from george/plat-143/2-on-success-workspace-build-request-handling to george/plat-143/1-workspace-build-orchestration-storage July 6, 2026 20:48
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 7417b9e to 7347bac Compare July 6, 2026 23:28
geokat added 2 commits July 6, 2026 17:53
The orchestrator was constructed with api.Clock and starts an
always-on backup-poll clock.NewTicker on it. In tests that drive the
mock clock deterministically (the autobuild lifecycle tests), that
shared ticker makes TestWorkspaceAutobuild/NextStartAtIsValid fail
date-dependently:  NextStartAt fails to recompute past the current
tick.

The orchestrator is driven by pubsub wakes; the ticker is only a
backup poll, so a real clock is correct and keeps its ticker off the
mock clock. Empirically this resolves the failure; the wake-driven
path is unaffected (it fires in real time).
Queue CLI restart as a stop build with an on_success start build
instead of posting the start build from the client after the stop
completes.

This makes restart durable across client disconnects and coderd
restarts: once the stop build request is accepted, the persisted
orchestration row lets the server queue the start build after the stop
succeeds.
@geokat
geokat force-pushed the george/plat-143/5-server-side-restart-orchestration-demo branch from 7347bac to 8061c76 Compare July 7, 2026 01:14
Base automatically changed from george/plat-143/1-workspace-build-orchestration-storage to main July 7, 2026 16:18
@geokat geokat closed this Jul 7, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
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.

1 participant