Skip to content

ci(.github/workflows): stop doc-check workspaces after each review - #29851

Merged
nickvigilante merged 1 commit into
mainfrom
vigilante/docs-1007-doc-check-stop-review-workspace-after-each-run-and-delete-it
Sep 24, 2026
Merged

nickvigilante merged 1 commit into
mainfrom
vigilante/docs-1007-doc-check-stop-review-workspace-after-each-run-and-delete-it

Conversation

@nickvigilante

Copy link
Copy Markdown
Contributor

doc-check creates one doc-check-pr-<N> workspace per PR and never stops or deletes it. On docfood.cdr.dev, 54 of them ran at once, and the host's load average reached about 2900, mostly from processes blocked on I/O.

This stops the review workspace once the chat reaches a terminal status, starts it again before the next review, and deletes it when the PR merges. A PR closed without merging keeps its workspace, because stale PRs get closed and reopened and the review needs its context back. Runs for the same PR share a concurrency group, so one run cannot stop or delete the workspace while another is reviewing in it.

The workspace lookup also now matches the name exactly. The name: filter matches substrings (coderd/database/queries/workspaces.sql), so doc-check-pr-12 also matched doc-check-pr-123.

Depends on #29849, which fixes the pre-push hook crash that blocked pushing this branch. Retarget to main after it merges.

Refs DOCS-1007, CODAGT-1025

Decision log

Choices

  • Stop only on a terminal chat status (waiting, completed, error). When the 40-minute wait times out, the chat is still working in the workspace, so the step leaves it running.
  • Start in the workflow, not the model. The next run finds the workspace stopped. The workflow starts it through the REST API and waits up to 3 minutes, rather than relying on the agent to call start_workspace. The job timeout goes from 45 to 50 minutes to make room. A failed start only warns, so the agent's existing recovery path still applies.
  • Delete on merge only. Per review feedback, closed without merged keeps the workspace. Workspaces for PRs that close and never reopen will pile up (stopped, then dormant) until a sweep removes them.
  • Serialize per PR with cancel-in-progress: false. Canceling a job does not cancel the Coder chat, so cancellation would not stop the review it interrupts.

Follow-up

Replace per-PR workspaces with one persistent doc-check workspace and a git worktree per PR, pinned through the action's workspace-id input.

Verification

  • actionlint and zizmor --persona=regular pass.
  • The exact-name jq filter picks the right workspace from sample responses, including an empty or null workspaces field.
  • Not exercised end to end against docfood.

🤖 Generated by Coder Agents on behalf of @nickvigilante.

@linear-code

linear-code Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

CODAGT-1025

DOCS-1007

@nickvigilante
nickvigilante marked this pull request as ready for review September 24, 2026 15:02
@nickvigilante
nickvigilante changed the base branch from vigilante/dog-55-pre-push-hook-never-runs-go-tests-and-segfaults-make-in-some to main September 24, 2026 15:03
Each PR's doc-check-pr-<N> workspace kept running until autostop, and
nothing deleted it afterward. On docfood.cdr.dev, 54 of them ran at once
and drove the host's load average to about 2900.

Stop the workspace once the chat reaches a terminal status, start it
again before the next review, and delete it when the PR merges. PRs
closed without merging keep their workspace, because stale PRs get
closed and reopened and the review context has to survive.

Runs for the same PR now share a concurrency group, so one run cannot
stop or delete the workspace while another run is reviewing in it.

Refs DOCS-1007, CODAGT-1025.
@nickvigilante
nickvigilante force-pushed the vigilante/docs-1007-doc-check-stop-review-workspace-after-each-run-and-delete-it branch from d95e332 to 49a5f06 Compare September 24, 2026 15:57
@nickvigilante
nickvigilante enabled auto-merge (squash) September 24, 2026 15:58
@nickvigilante
nickvigilante merged commit dd3963a into main Sep 24, 2026
48 of 51 checks passed
@nickvigilante
nickvigilante deleted the vigilante/docs-1007-doc-check-stop-review-workspace-after-each-run-and-delete-it branch September 24, 2026 16:50
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 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.

2 participants