fix(attachWorktreeToJob): schrijf branch naar claudeJob.branch in DB
Symptoom: TASK_IMPLEMENTATION jobs in een sprint-run met pr_strategy= SPRINT kregen branch=null in claudeJob.branch, ook al maakte attachWorktreeToJob de juiste worktree-branch (feat/sprint-<id>) aan en returnde die in de payload-response. Gevolg: update_job_status (na PR #43-fix) leest claudeJob.branch uit de DB → null → valt terug op legacy `feat/job-<8>` → `git push` faalt met "src refspec feat/job-xxx does not match any" → job FAILED → cascade- cancel van sibling-tasks in dezelfde sprint-run. Live waargenomen voor sprint-run cmoy9irr8000ci017fvy30lvv (T-806 FAILED, T-807-T-811 CANCELLED) ondanks dat Claude PR #174 op feat/sprint-fvy30lvv had gemaakt. Root cause: attachWorktreeToJob (wait-for-job.ts:205-209) update'de alleen base_sha. Voor SPRINT_IMPLEMENTATION-kind wordt branch wel naar DB geschreven (regel 655) maar voor TASK_IMPLEMENTATION-pad zat dat gat. Fix: altijd branch + (indien aanwezig) base_sha schrijven naar claudeJob in de update aan het eind van attachWorktreeToJob. Tests: __tests__/wait-for-job-worktree.test.ts mock-prisma uitgebreid met `claudeJob.update`. 341 tests in 38 files passed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ed94d5b7e1
commit
51533cf48e
2 changed files with 14 additions and 8 deletions
|
|
@ -6,7 +6,7 @@ import * as fs from 'node:fs/promises'
|
|||
vi.mock('../src/prisma.js', () => ({
|
||||
prisma: {
|
||||
$executeRaw: vi.fn(),
|
||||
claudeJob: { findFirst: vi.fn(), findUnique: vi.fn() },
|
||||
claudeJob: { findFirst: vi.fn(), findUnique: vi.fn(), update: vi.fn() },
|
||||
product: { findUnique: vi.fn() },
|
||||
},
|
||||
}))
|
||||
|
|
@ -21,7 +21,7 @@ import { resolveRepoRoot, rollbackClaim, attachWorktreeToJob } from '../src/tool
|
|||
|
||||
const mockPrisma = prisma as unknown as {
|
||||
$executeRaw: ReturnType<typeof vi.fn>
|
||||
claudeJob: { findFirst: ReturnType<typeof vi.fn>; findUnique: ReturnType<typeof vi.fn> }
|
||||
claudeJob: { findFirst: ReturnType<typeof vi.fn>; findUnique: ReturnType<typeof vi.fn>; update: ReturnType<typeof vi.fn> }
|
||||
product: { findUnique: ReturnType<typeof vi.fn> }
|
||||
}
|
||||
const mockCreateWorktree = createWorktreeForJob as ReturnType<typeof vi.fn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue