Skip to content

feat(task-board): repo as a task property + repo-backed review gate - #5970

Merged
pedrofrxncx merged 3 commits into
mainfrom
guitavano/task-github-prop
Aug 12, 2026
Merged

feat(task-board): repo as a task property + repo-backed review gate#5970
pedrofrxncx merged 3 commits into
mainfrom
guitavano/task-github-prop

Conversation

@guitavano

@guitavano guitavano commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Small, standalone slice split out of #5938 (task-based flow) so it can merge on its own — no feature flag, no UI mode.

Summary

  • Repo as a task property. task_board_items gains nullable repo_owner/repo_name (migration 170), threaded through storage, the create/update tools, schemas, and the shared entity type. A repo selector in the task dialog's Properties lets you pick from the org's repo-scoped GitHub connections.
  • Repo-backed review gate. shouldAdvanceToReview: a repoOwner-named task advances to In Review only via the PR-open hook, never on thread-finish — a finished edit may have opened no PR, and In Review with no PR is the wrong state. Agent-run tasks keep the thread-finish backstop (their run opens the PR, so finishing means there is one to review).

Testing

  • Unit: the advance gate (repo-named waits vs repo-less advances).
  • Real-Postgres (CI): repo round-trip through create/update; repo-named no-advance-on-finish.
  • bun run fmt clean; tsc clean in apps/api, apps/web, packages/shared; lint clean on touched files. 57 unit tests pass.

Notes

  • packages/shared/src/tools/tool-io.ts was hand-patched (the contract generator is degraded in this dev env). Re-run bun run --cwd=apps/api generate:tool-contracts in a full env to confirm.
  • Migration 170 needs running on the target env.

🤖 Generated with Claude Code


Summary by cubic

Adds a nullable repository field to tasks and a Repository picker in the task dialog. It stores owner/name in a single repo column and does not change review gating (the thread‑finish backstop remains; repo has no effect on advancement).

  • Wires repo through storage, TASK_BOARD_ITEM_CREATE/TASK_BOARD_ITEM_UPDATE, schemas, and packages/shared types; repo‑only updates now persist.

Migration

  • Run migration 170-task-board-item-repo.
  • Re-generate tool contracts: bun run --cwd=apps/api generate:tool-contracts.

Written for commit 22e451d. Summary will update on new commits.

Review in cubic

Task board items can name the repo (site) they pertain to, and repo-backed
tasks advance to In Review only via the PR-open hook — not on thread-finish.

- `task_board_items` gains nullable `repo_owner`/`repo_name` (migration 170);
  threaded through storage, create/update tools, schemas, and the shared
  entity type.
- Repo selector in the task dialog's Properties (pick from the org's
  repo-scoped GitHub connections).
- `shouldAdvanceToReview`: a repoOwner-named task waits for its PR — a finished
  edit may have opened none, and In Review with no PR is the wrong state.
  Agent-run tasks keep the thread-finish backstop.

Tests: unit for the advance gate; real-Postgres for the repo round-trip and the
repo-named no-advance-on-finish.

Note: tool-io.ts hand-patched (contract generator degraded in this env) —
re-run generate:tool-contracts in a full env to confirm.

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
guitavano and others added 2 commits August 12, 2026 11:13
hasFieldUpdate omitted repoOwner/repoName, so an update touching only the
repo skipped storage.update() entirely and re-read the stale row. The
create/update round-trip integration test caught it (storage-integration CI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`repo_owner`/`repo_name` become a single nullable `repo` holding `owner/name`.
The value is only ever written whole (from a repo-scoped connection's scope),
and two independently-updatable nullable columns let a partial update leave a
half-named repo behind — `{ repoName: "x" }` wrote a row with a name and no
owner, which the review gate then read as "not repo-backed".

Also drops the gate change. Keying `shouldAdvanceToReview` on the repo field
made a user-editable dropdown silently disable a card's lifecycle: the picker
is on every task, so selecting a repo on an agent-run card stopped both the
thread-finish hook AND the stall sweeper (`stall-recovery.ts` gates on the
same function) from ever advancing it — a completed run whose PR detection
missed would sit In Progress forever, which is the mirror of the dead-end the
backstop exists to prevent. The repo ships as metadata for the task-based flow
to read; whatever gates that flow's review should key on the flow, not on a
property anyone can set.

And removes the stray `taskBasedFlow` org flag from the hand-patched
`tool-io.ts` — that flag exists nowhere else on this branch (it leaked from
the task-based-flow PR) and regeneration would strip it.
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) August 12, 2026 16:29
@pedrofrxncx
pedrofrxncx merged commit a6bb408 into main Aug 12, 2026
24 checks passed
@pedrofrxncx
pedrofrxncx deleted the guitavano/task-github-prop branch August 12, 2026 16:33
decocms Bot pushed a commit that referenced this pull request Aug 12, 2026
PR: #5970 feat(task-board): repo as a task property + repo-backed review gate
Bump type: minor

- decocms (apps/api/package.json): 4.204.29 -> 4.205.0
- @decocms/native (apps/native/package.json): 4.204.29 -> 4.205.0
- @decocms/shared (packages/shared/package.json): 0.32.1 -> 0.33.0

Deploy-Scope: both
guitavano added a commit that referenced this pull request Aug 12, 2026
Sync after #5970 merged (repo-as-task-property + selector). Reconciled to
main's convention:
- Task's repo scope is a single `repo` column ("owner/name"), not the
  repoOwner/repoName pair — adopted main's version everywhere, incl. the task
  pill (filter + create now use the `owner/name` slug).
- Kept #5938's `linkPr` on TASK_BOARD_ITEM_UPDATE (CMS submit-for-review) —
  its repoOwner/repoName is the PR's identity (task_board_item_prs), untouched
  by the `repo` change.
- Dropped the orphaned shouldAdvanceToReview repo-gate tests: main's merge of
  #5970 did NOT include the review-gate change, so #5938 no longer carries it
  (see PR note — needs a decision).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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