MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createRunningReview

Function createRunningReview

apps/web/src/lib/code-reviews/analytics/db.test.ts:95–122  ·  view source on GitHub ↗
(analyticsEnabledAtDispatch: boolean)

Source from the content-addressed store, hash-verified

93 });
94
95 async function createRunningReview(analyticsEnabledAtDispatch: boolean) {
96 const suffix = crypto.randomUUID();
97 const reviewId = await createCodeReview({
98 owner: { type: 'org', id: organizationId, userId },
99 platformIntegrationId: organizationIntegrationId,
100 repoFullName: `analytics/repo-${suffix}`,
101 prNumber: 1,
102 prUrl: `https://github.com/analytics/repo-${suffix}/pull/1`,
103 prTitle: 'Analytics test',
104 prAuthor: 'octocat',
105 prAuthorGithubId: '1234',
106 baseRef: 'main',
107 headRef: 'feature',
108 headSha: suffix,
109 platform: 'github',
110 });
111 reviewIds.push(reviewId);
112 const attempt = await createCodeReviewAttempt({
113 codeReviewId: reviewId,
114 status: 'running',
115 sessionId: `session-${suffix}`,
116 analyticsEnabledAtDispatch,
117 });
118 await updateCodeReviewStatus(reviewId, 'running', {
119 sessionId: attempt.session_id ?? undefined,
120 });
121 return { reviewId, attempt };
122 }
123
124 it('atomically completes an enrolled review and stores taxonomy-only findings', async () => {
125 const { reviewId, attempt } = await createRunningReview(true);

Callers 1

db.test.tsFile · 0.85

Calls 4

createCodeReviewFunction · 0.90
createCodeReviewAttemptFunction · 0.90
updateCodeReviewStatusFunction · 0.90
pushMethod · 0.80

Tested by

no test coverage detected