Skip to content

fix(task-board): a repo-backed task reaches In Review only with a PR - #5989

Merged
pedrofrxncx merged 1 commit into
mainfrom
guitavano/task-review-gate
Aug 12, 2026
Merged

fix(task-board): a repo-backed task reaches In Review only with a PR#5989
pedrofrxncx merged 1 commit into
mainfrom
guitavano/task-review-gate

Conversation

@guitavano

@guitavano guitavano commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #5970, which shipped the repo task property but intentionally kept the plain thread-finish backstop (its refactor commit dropped the gate). That leaves a repo-backed task dead-ending In Review with no PR: it finished but opened no PR, so there's nothing to review.

The rule

A repo-backed task reaches In Review only when a PR exists:

  • The agent's PR-open hook moves it mid-run (unchanged).
  • On thread-finish, the backstop advances it only once a PR is linked — otherwise it stays In Progress (the CMS submit-for-review flow opens the PR later).
  • Non-repo tasks advance on finish exactly as before.

Changes

  • shouldAdvanceToReview gains a hasPr arg; a repo-named item stays In Progress on finish unless a PR is linked. Pure, unit-tested.
  • Both callers — the thread-finish hook (advanceLinkedTasksToReviewOnThreadFinish) and the stall sweep (recoverStalledTasks) — compute hasPr via listPrs, querying only for repo-backed items (non-repo path stays query-free).

Testing

  • Unit: repo-backed + no PR → stays; repo-backed + PR → advances; non-repo unchanged.
  • Real-Postgres: a repo task holds In Progress on finish with no PR, then advances once a PR is linked.
  • tsc clean (apps/api); 37 unit tests pass; lint clean.

🤖 Generated with Claude Code


Summary by cubic

Prevents repo-backed tasks from entering In Review without a PR. Previously, thread-finish could advance a repo-backed task to In Review with no PR; now it stays In Progress until a PR is linked. Non-repo tasks are unchanged, and the agent’s PR-open hook still moves tasks mid-run.

  • shouldAdvanceToReview now accepts hasPr; repo-backed tasks require a linked PR to advance on finish.
  • advanceLinkedTasksToReviewOnThreadFinish and recoverStalledTasks compute hasPr via listPrs only for repo-backed tasks (no added queries for non-repo).
  • Tests cover: repo-backed + no PR → stays; repo-backed + PR → advances; non-repo unchanged; Postgres integration verifies hold-then-advance after linking a PR.

Written for commit 2eafa41. Summary will update on new commits.

Review in cubic

A repo-backed task advanced to In Review on thread-finish even when no PR was
opened — dead-ending it In Review with nothing to review (the CMS submit path
opens the PR later). Now the thread-finish backstop advances a repo-backed task
only once a PR is linked; the agent's PR-open hook still moves it mid-run, and
non-repo tasks advance on finish unchanged.

- `shouldAdvanceToReview` gains a `hasPr` arg; a `repo`-named item stays In
  Progress on finish unless a PR is linked.
- Both callers (thread-finish hook + stall sweep) compute `hasPr` via `listPrs`,
  querying only for repo-backed items.

Tests: unit for the gate; real-Postgres that a repo task holds In Progress with
no PR, then advances once a PR is linked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the claude PR authored by a coding agent label Aug 12, 2026
@pedrofrxncx
pedrofrxncx merged commit 5c026a1 into main Aug 12, 2026
25 checks passed
@pedrofrxncx
pedrofrxncx deleted the guitavano/task-review-gate branch August 12, 2026 17:24
decocms Bot pushed a commit that referenced this pull request Aug 12, 2026
PR: #5989 fix(task-board): a repo-backed task reaches In Review only with a PR
Bump type: patch

- decocms (apps/api/package.json): 4.205.2 -> 4.205.3
- @decocms/native (apps/native/package.json): 4.205.2 -> 4.205.3

Deploy-Scope: server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude PR authored by a coding agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants