auto-claude: subtask-5-1 - Fix type errors and verify full test suite
- Remove obsolete setPRReviewResult calls in PRDetail.tsx (now handled by XState) - Add missing onPRReviewStateChange to browser-mock.ts - Fix pr-review-machine.test.ts mock data to match actual PRReviewResult/PRReviewProgress types - All 130 test files pass (3278 tests), typecheck clean, lint clean Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
181fe50be7
commit
16f3194ca0
@@ -420,16 +420,8 @@ export function PRDetail({
|
||||
const pollForCompletion = async () => {
|
||||
// Timeout: stop polling after 30 minutes to avoid indefinite polling
|
||||
if (Date.now() - pollStart > MAX_POLL_DURATION_MS) {
|
||||
usePRReviewStore.getState().setPRReviewResult(projectId, {
|
||||
prNumber: pr.number,
|
||||
repo: '',
|
||||
success: false,
|
||||
findings: [],
|
||||
summary: '',
|
||||
overallStatus: 'comment',
|
||||
reviewedAt: new Date().toISOString(),
|
||||
error: 'External review polling timed out after 30 minutes',
|
||||
});
|
||||
// XState now handles external review state - timeout is managed by the state machine
|
||||
console.warn('[PRDetail] External review polling timed out after 30 minutes');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -440,7 +432,8 @@ export function PRDetail({
|
||||
// Otherwise this is a stale result from a previous review still on disk
|
||||
// (in-progress results are intentionally NOT saved to disk).
|
||||
if (startedAt && result.reviewedAt && new Date(result.reviewedAt) > new Date(startedAt)) {
|
||||
usePRReviewStore.getState().setPRReviewResult(projectId, result);
|
||||
// XState now handles review completion via IPC events - no need to manually set result
|
||||
console.log('[PRDetail] External review completed, result handled by XState');
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
|
||||
@@ -225,6 +225,7 @@ const browserMockAPI: ElectronAPI = {
|
||||
onPRReviewProgress: () => () => {},
|
||||
onPRReviewComplete: () => () => {},
|
||||
onPRReviewError: () => () => {},
|
||||
onPRReviewStateChange: () => () => {},
|
||||
onPRLogsUpdated: () => () => {},
|
||||
batchAutoFix: () => {},
|
||||
getBatches: async () => [],
|
||||
|
||||
@@ -19,17 +19,20 @@ function runEvents(events: PRReviewEvent[]) {
|
||||
}
|
||||
|
||||
const mockResult = {
|
||||
prNumber: 42,
|
||||
repo: 'test/repo',
|
||||
success: true,
|
||||
findings: [],
|
||||
summary: 'Test review',
|
||||
rating: 'approve' as const,
|
||||
comments: [],
|
||||
filesReviewed: 3,
|
||||
issuesFound: 0,
|
||||
overallStatus: 'approve' as const,
|
||||
reviewedAt: new Date().toISOString(),
|
||||
};
|
||||
|
||||
const mockProgress = {
|
||||
phase: 'analyzing' as const,
|
||||
prNumber: 42,
|
||||
progress: 50,
|
||||
message: 'Analyzing files...',
|
||||
percentage: 50,
|
||||
};
|
||||
|
||||
describe('prReviewMachine', () => {
|
||||
|
||||
Reference in New Issue
Block a user