PBI-46: Sprint-niveau jobflow met cascade-FAIL (F1/F2/F4 Scrum4Me) (#136)
* ST-1243: F1 schema + propagateStatusUpwards-helper voor sprint-flow Schema-uitbreidingen voor de sprint-niveau jobflow (PBI-46): - TaskStatus, StoryStatus, PbiStatus, SprintStatus krijgen FAILED - Nieuwe enums: SprintRunStatus, PrStrategy - Nieuw SprintRun-model dat per-task ClaudeJobs groepeert - ClaudeJob.sprint_run_id koppeling + index - Product.pr_strategy (default SPRINT) - Bijhorende Prisma-migratie propagateStatusUpwards vervangt updateTaskStatusWithStoryPromotion en herevalueert de keten Task → Story → PBI → Sprint → SprintRun bij elke task-statuswijziging. Bij FAILED cancelt het sibling-jobs in dezelfde SprintRun. PBI-status BLOCKED blijft handmatig en wordt niet overschreven. Status-mappers + theme krijgen failed-token + label-uitbreidingen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ST-1244: F2 sprint-runs actions + deprecate per-task enqueues actions/sprint-runs.ts (nieuw): - startSprintRunAction met pre-flight (impl_plan / open ClaudeQuestion / PBI BLOCKED|FAILED) - Maakt SprintRun + ClaudeJobs in PBI→Story→Task volgorde - resumeSprintAction zet FAILED tasks/stories/PBIs terug en start nieuwe SprintRun - cancelSprintRunAction breekt lopende SprintRun af zonder cascade actions/claude-jobs.ts: - enqueueClaudeJobAction, enqueueAllTodoJobsAction, previewEnqueueAllAction, enqueueClaudeJobsBatchAction nu deprecation-stubs (UI-cleanup volgt in F4) - cancelClaudeJobAction blijft beschikbaar voor losse jobs Tests bijgewerkt: 11 nieuwe sprint-runs tests, claude-jobs(-batch) tests herzien naar deprecation-asserties. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ST-1246: F4 UI Start/Resume/Cancel sprint + pr_strategy dropdown - components/sprint/sprint-run-controls.tsx: knoppen Start Sprint (sprintStatus=ACTIVE), Hervat sprint (sprintStatus=FAILED) en Annuleer sprint-run (lopende run). Pre-flight blocker-modal toont blockers met directe links naar de relevante pagina's. - components/products/pr-strategy-select.tsx: dropdown SPRINT|STORY in product-settings, met optimistic update + sonner-toast op fail. - actions/products.ts: updatePrStrategyAction (eigenaar-only, demo-block). - Sprint-page: query op actieve SprintRun + tonen van controls-balk. Live cascade-visualisatie (T-634) staat als follow-up genoteerd — huidige sprint-board statusbadges volstaan voor MVP. De Solo-board "Voer uit"-knoppen zijn niet expliciet verwijderd; ze tonen nu de deprecation-error van de gestubde actions tot de Solo-flow opnieuw ontworpen wordt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ab8c3dca3f
commit
77617e89ac
25 changed files with 1798 additions and 1014 deletions
|
|
@ -8,6 +8,7 @@ import { ArchiveProductButton } from '@/components/products/archive-product-butt
|
|||
import { TeamManager } from '@/components/products/team-manager'
|
||||
import { updateProductFormAction } from '@/actions/products'
|
||||
import { AutoPrToggle } from '@/components/products/auto-pr-toggle'
|
||||
import { PrStrategySelect } from '@/components/products/pr-strategy-select'
|
||||
import Link from 'next/link'
|
||||
|
||||
interface Props {
|
||||
|
|
@ -66,6 +67,17 @@ export default async function ProductSettingsPage({ params }: Props) {
|
|||
<AutoPrToggle productId={id} initialValue={product.auto_pr} />
|
||||
</div>
|
||||
|
||||
<div className="mt-8 pt-6 border-t border-border space-y-3">
|
||||
<div>
|
||||
<h2 className="text-sm font-medium text-foreground">PR-strategie</h2>
|
||||
<p className="text-xs text-muted-foreground mt-0.5">
|
||||
Bepaalt hoe de sprint zijn werk oplevert: één PR voor de hele sprint
|
||||
of een PR per story die automatisch wordt gemerged na groene CI.
|
||||
</p>
|
||||
</div>
|
||||
<PrStrategySelect productId={id} initialValue={product.pr_strategy} />
|
||||
</div>
|
||||
|
||||
<div className="mt-8 pt-6 border-t border-border space-y-3">
|
||||
<div>
|
||||
<h2 className="text-sm font-medium text-foreground">Team</h2>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { prisma } from '@/lib/prisma'
|
|||
import { pbiStatusToApi } from '@/lib/task-status'
|
||||
import { SprintBoardClient } from '@/components/sprint/sprint-board-client'
|
||||
import { SprintHeader } from '@/components/sprint/sprint-header'
|
||||
import { SprintRunControls } from '@/components/sprint/sprint-run-controls'
|
||||
import type { SprintStory, PbiWithStories, ProductMember } from '@/components/sprint/sprint-backlog'
|
||||
import type { Task } from '@/components/sprint/task-list'
|
||||
import { TaskDialog } from '@/app/_components/tasks/task-dialog'
|
||||
|
|
@ -33,7 +34,7 @@ export default async function SprintBoardPage({ params, searchParams }: Props) {
|
|||
if (!product) notFound()
|
||||
|
||||
const sprint = await prisma.sprint.findFirst({
|
||||
where: { product_id: id, status: 'ACTIVE' },
|
||||
where: { product_id: id, status: { in: ['ACTIVE', 'FAILED'] } },
|
||||
select: {
|
||||
id: true,
|
||||
sprint_goal: true,
|
||||
|
|
@ -44,6 +45,14 @@ export default async function SprintBoardPage({ params, searchParams }: Props) {
|
|||
})
|
||||
if (!sprint) redirect(`/products/${id}`)
|
||||
|
||||
const activeSprintRun = await prisma.sprintRun.findFirst({
|
||||
where: {
|
||||
sprint_id: sprint.id,
|
||||
status: { in: ['QUEUED', 'RUNNING', 'PAUSED'] },
|
||||
},
|
||||
select: { id: true, status: true },
|
||||
})
|
||||
|
||||
// Sprint stories with full task data and assignee
|
||||
const [sprintStories, productMembers] = await Promise.all([
|
||||
prisma.story.findMany({
|
||||
|
|
@ -147,6 +156,17 @@ export default async function SprintBoardPage({ params, searchParams }: Props) {
|
|||
sprintStories={sprintStoryItems}
|
||||
/>
|
||||
|
||||
<div className="border-b border-border bg-surface-container-low px-4 py-2 shrink-0">
|
||||
<SprintRunControls
|
||||
sprintId={sprint.id}
|
||||
productId={id}
|
||||
sprintStatus={sprint.status}
|
||||
activeSprintRunId={activeSprintRun?.id ?? null}
|
||||
activeSprintRunStatus={activeSprintRun?.status ?? null}
|
||||
isDemo={isDemo}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<SprintBoardClient
|
||||
productId={id}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,10 @@ const STATUS_CONFIG: Record<TaskStatus, { label: string; dot: string }> = {
|
|||
IN_PROGRESS: { label: 'Bezig', dot: 'bg-status-in-progress' },
|
||||
REVIEW: { label: 'Review', dot: 'bg-status-review' },
|
||||
DONE: { label: 'Klaar', dot: 'bg-status-done' },
|
||||
FAILED: { label: 'Gefaald', dot: 'bg-status-failed' },
|
||||
}
|
||||
|
||||
// FAILED ontbreekt bewust: alleen via sprint-cascade gezet, niet handmatig kiesbaar.
|
||||
const STATUS_ORDER: TaskStatus[] = ['TO_DO', 'IN_PROGRESS', 'REVIEW', 'DONE']
|
||||
|
||||
function StatusIndicator({ status }: { status: TaskStatus }) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { authenticateApiRequest } from '@/lib/api-auth'
|
|||
import { prisma } from '@/lib/prisma'
|
||||
import { z } from 'zod'
|
||||
import { TASK_STATUS_API_VALUES, taskStatusFromApi, taskStatusToApi } from '@/lib/task-status'
|
||||
import { updateTaskStatusWithStoryPromotion } from '@/lib/tasks-status-update'
|
||||
import { propagateStatusUpwards } from '@/lib/tasks-status-update'
|
||||
|
||||
// `review` is a valid TaskStatus in the DB and the kanban-board UI, but the
|
||||
// sprint task list (components/sprint/task-list.tsx) does not yet render it.
|
||||
|
|
@ -111,7 +111,7 @@ export async function PATCH(
|
|||
: null
|
||||
|
||||
if (dbStatus !== undefined && dbStatus !== null) {
|
||||
const result = await updateTaskStatusWithStoryPromotion(id, dbStatus, tx)
|
||||
const result = await propagateStatusUpwards(id, dbStatus, tx)
|
||||
return {
|
||||
id: result.task.id,
|
||||
status: result.task.status,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@
|
|||
--status-review: #7b5ea7;
|
||||
--status-done: #006e1c;
|
||||
--status-blocked: #ba1a1a;
|
||||
--status-failed: #93000a;
|
||||
|
||||
--priority-critical: #ba1a1a;
|
||||
--priority-high: #c75300;
|
||||
|
|
@ -196,6 +197,7 @@
|
|||
--status-review: #c9b6ef;
|
||||
--status-done: #77db77;
|
||||
--status-blocked: #ffb4ab;
|
||||
--status-failed: #ff8a80;
|
||||
|
||||
--priority-critical: #ffb4ab;
|
||||
--priority-high: #ffb68d;
|
||||
|
|
@ -301,6 +303,7 @@
|
|||
--color-status-review: var(--status-review);
|
||||
--color-status-done: var(--status-done);
|
||||
--color-status-blocked: var(--status-blocked);
|
||||
--color-status-failed: var(--status-failed);
|
||||
|
||||
--color-priority-critical: var(--priority-critical);
|
||||
--color-priority-high: var(--priority-high);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue