MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / processCommit

Function processCommit

evals/buffbench/gen-evals.ts:160–227  ·  view source on GitHub ↗
(
    commitSha: string,
  )

Source from the content-addressed store, hash-verified

158 const evalCommits: EvalCommitV2[] = []
159
160 const processCommit = async (
161 commitSha: string,
162 ): Promise<EvalCommitV2 | null> => {
163 console.log(`Processing commit ${commitSha.slice(0, 8)}...`)
164
165 return await withTestRepoAndParent(
166 {
167 repoUrl,
168 commitSha,
169 initCommand: undefined,
170 },
171 async (repoPath, commitSha, parentSha) => {
172 const fileDiffs = await extractFileDiffsFromCommit(
173 repoPath,
174 commitSha,
175 parentSha,
176 )
177
178 const fullDiff = getFullDiff(repoPath, commitSha, parentSha)
179 const commitMessage = getCommitMessage(repoPath, commitSha)
180 const editedFilePaths = fileDiffs.map((f) => f.path)
181
182 console.log(`Generating eval task for ${commitSha.slice(0, 8)}...`)
183 const taskResult = await generateEvalTask({
184 client,
185 input: {
186 commitSha,
187 parentSha,
188 diff: fullDiff,
189 editedFilePaths,
190 commitMessage,
191 repoPath,
192 },
193 })
194
195 // Filter out supplementalFiles that don't exist at parentSha
196 const { valid: validSupplementalFiles, removed } = filterSupplementalFiles(
197 repoPath,
198 parentSha,
199 taskResult.supplementalFiles,
200 )
201
202 if (removed.length > 0) {
203 console.log(`⚠️ Filtered out ${removed.length} supplementalFiles that don't exist at parentSha:`)
204 for (const file of removed) {
205 console.log(` - ${file}`)
206 }
207 }
208
209 printTaskResult({
210 ...taskResult,
211 supplementalFiles: validSupplementalFiles,
212 })
213
214 const evalCommit: EvalCommitV2 = {
215 id: taskResult.id,
216 sha: commitSha,
217 parentSha,

Callers 1

generateEvalFileV2Function · 0.70

Calls 7

withTestRepoAndParentFunction · 0.90
generateEvalTaskFunction · 0.90
filterSupplementalFilesFunction · 0.90
getFullDiffFunction · 0.85
getCommitMessageFunction · 0.85
printTaskResultFunction · 0.85

Tested by

no test coverage detected