feat(cli): server-side restart orchestration demo - #25761
Closed
geokat wants to merge 17 commits into
Closed
Conversation
This was referenced May 27, 2026
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
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
May 28, 2026 04:27
6604ffa to
711f3b7
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
May 28, 2026 04:27
51c512a to
31ac08b
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 16, 2026 23:57
711f3b7 to
7d48ade
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
June 16, 2026 23:57
31ac08b to
87cfc80
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 17, 2026 19:32
7d48ade to
c976ecf
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
June 17, 2026 19:32
87cfc80 to
9ae84d9
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 17, 2026 20:56
c976ecf to
7ab27d6
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
June 17, 2026 20:56
9ae84d9 to
e2584ed
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 17, 2026 23:23
7ab27d6 to
afd17c6
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
June 17, 2026 23:24
e2584ed to
8398ba8
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 24, 2026 01:11
afd17c6 to
3d602a6
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
June 24, 2026 01:11
8398ba8 to
fae9652
Compare
geokat
force-pushed
the
george/plat-143/4-dbpurge-terminal-workspace-build-orchestrations
branch
from
June 30, 2026 21:58
3d602a6 to
7c9d070
Compare
geokat
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
3 times, most recently
from
July 6, 2026 20:12
0a855e8 to
7417b9e
Compare
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
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
July 6, 2026 23:28
7417b9e to
7347bac
Compare
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
force-pushed
the
george/plat-143/5-server-side-restart-orchestration-demo
branch
from
July 7, 2026 01:14
7347bac to
8061c76
Compare
Base automatically changed from
george/plat-143/1-workspace-build-orchestration-storage
to
main
July 7, 2026 16:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 restartto exercise the new API flow by posting a stop build withan
on_successstart build instead of waiting for the stop to finish and thenposting 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:Created with stakk