chore(coderd/database): purge terminal workspace build orchestrations - #25760
Conversation
096cb57 to
998848a
Compare
6604ffa to
711f3b7
Compare
998848a to
cfa75f9
Compare
711f3b7 to
7d48ade
Compare
cfa75f9 to
06af5be
Compare
7d48ade to
c976ecf
Compare
06af5be to
0ddfc81
Compare
c976ecf to
7ab27d6
Compare
0ddfc81 to
a1b168a
Compare
7ab27d6 to
afd17c6
Compare
a1b168a to
5c38677
Compare
afd17c6 to
3d602a6
Compare
Add dbpurge cleanup for completed, failed, and canceled workspace build orchestration rows after a short retention window. Keep pending rows and recent terminal rows, and delete in bounded batches. Ref: https://linear.app/codercom/issue/PLAT-143/add-workspace-restart-functionality-to-api Ref: #5800
3d602a6 to
7c9d070
Compare
|
/coder-agents-review |
|
Chat: Review posted | View chat Review history
deep-review v0.9.0 | Round 1 | Last posted: Round 1, 2 findings (1 P3, 1 Nit), COMMENT. Review Finding inventoryFindings
Contested and acknowledged(none) Round logRound 1Panel: 14 reviewers. 1 P3 (CRF-1), 1 Nit posted (CRF-2), 1 Nit dropped (CRF-3). Reviewed against b127602..7c9d070. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
Clean, focused purge addition. The SQL query correctly targets terminal statuses, preserves pending rows and recent terminal rows, uses bounded batches, and the RBAC wiring is correct. Test coverage is thorough: status filtering, batch limiting, retention window, and multi-pass cleanup all verified against real PostgreSQL. 14-reviewer panel found almost nothing wrong.
"I tried to build a case against this change and could not." (Pariston)
1 P3, 1 Nit.
🤖 This review was automatically generated with Coder Agents.
Emyrk
left a comment
There was a problem hiding this comment.
Reviewed the purge query, dbpurge integration, RBAC grant, concurrency interplay with the orchestrator, tests, and generated code. One blocking issue: the dbauthz test mocks DeleteOldWorkspaceBuildOrchestrations with the wrong Return arity and will fail the Linux PG jobs. One non-blocking note on indexing inline. Everything else looks good.
🤖 Drafted by Coder Agents on behalf of @Emyrk.
Emyrk
left a comment
There was a problem hiding this comment.
Only a comment. Approving
LGTM 👍
4ecf457
into
george/plat-143/3-process-on-success-workspace-build-orchestration
This PR is part of a stack that adds durable server-side workspace restart support
to the API.
Add dbpurge cleanup for terminal workspace build orchestration rows. Completed,
failed, and canceled rows are retained briefly for observability, then deleted in
bounded batches.
Pending rows and recent terminal rows are preserved so active orchestration state
is not removed.
Ref: https://linear.app/codercom/issue/PLAT-143/add-workspace-restart-functionality-to-api
Ref: #5800
This PR is part of a stack that merges into
main:Created with stakk