Skip to content

Commit 334536a

Browse files
committed
Tweaks to eval output: add github link to commit, print spec, quiet some git operations
1 parent 76e5a3c commit 334536a

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

evals/git-evals/pick-commits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ function basicFilter(commits: CommitInfo[]): CommitInfo[] {
295295
})
296296
}
297297

298-
function createGithubUrl(repoUrl: string, sha: string): string {
298+
export function createGithubUrl(repoUrl: string, sha: string): string {
299299
// Convert repo URL to GitHub commit URL
300300
let baseUrl = repoUrl
301301
if (baseUrl.endsWith('.git')) {

evals/git-evals/run-git-evals.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import pLimit from 'p-limit'
1313
import { resetRepoToCommit } from '../scaffolding'
1414
import { createInitialSessionState } from '../test-setup'
1515
import { judgeEvalRun } from './judge-git-eval'
16+
import { createGithubUrl } from './pick-commits'
1617
import { ClaudeRunner } from './runners/claude'
1718
import { CodebuffRunner } from './runners/codebuff'
1819
import { extractRepoNameFromUrl, setupTestRepo } from './setup-test-repo'
@@ -505,6 +506,19 @@ export async function runGitEvals(
505506
console.log(
506507
`Completed eval for commit ${testRepoName} - ${evalCommit.spec.split('\n')[0]}`,
507508
)
509+
510+
// Repeat spec before printing judge ruling
511+
console.log(`Spec for commit ${testRepoName}:`)
512+
console.log(evalCommit.spec)
513+
514+
// Print GitHub commit link after judging results
515+
try {
516+
const githubUrl = createGithubUrl(repoUrl, evalCommit.sha)
517+
console.log(`GitHub commit: ${githubUrl}`)
518+
} catch (error) {
519+
// Ignore errors if URL generation fails (e.g., non-GitHub repos)
520+
}
521+
508522
if (!logToStdout) {
509523
const finalResult = cloneDeep(message.result)
510524
for (const cbTrace of finalResult.trace) {

evals/git-evals/run-single-eval.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Command, Flags } from '@oclif/core'
1212

1313
import { createFileReadingMock } from '../scaffolding'
1414
import { setupTestEnvironmentVariables } from '../test-setup'
15+
import { createGithubUrl } from './pick-commits'
1516
import { runSingleEval } from './run-git-evals'
1617
import { extractRepoNameFromUrl, setupTestRepo } from './setup-test-repo'
1718

@@ -203,6 +204,18 @@ async function runSingleEvalTask(options: {
203204
const duration = Date.now() - startTime
204205
console.log(`✅ Evaluation completed in ${(duration / 1000).toFixed(1)}s`)
205206

207+
// Repeat spec before printing judge ruling
208+
console.log(`Spec for commit:`)
209+
console.log(evalCommit.spec)
210+
211+
// Print GitHub commit link after judging results
212+
try {
213+
const githubUrl = createGithubUrl(evalData.repoUrl, evalCommit.sha)
214+
console.log(`🔗 GitHub commit: ${githubUrl}`)
215+
} catch (error) {
216+
// Ignore errors if URL generation fails (e.g., non-GitHub repos)
217+
}
218+
206219
// Display results
207220
if (result.error) {
208221
console.log(`❌ Error occurred: ${result.error}`)

evals/git-evals/setup-test-repo.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,19 @@ export async function setupTestRepo(
135135
// Local development or public repos
136136
console.log(`Local environment detected - cloning from: ${repoUrl}`)
137137

138-
execFileSync('git', ['clone', '--no-checkout', repoUrl, repoDir], {
139-
timeout: 120_000, // 2 minute timeout for cloning
140-
stdio: 'inherit',
141-
})
142-
execFileSync('git', ['fetch', 'origin', commitSha], {
138+
execFileSync(
139+
'git',
140+
['clone', '--no-checkout', '--quiet', repoUrl, repoDir],
141+
{
142+
timeout: 120_000, // 2 minute timeout for cloning
143+
stdio: 'inherit',
144+
},
145+
)
146+
execFileSync('git', ['fetch', 'origin', '--quiet', commitSha], {
143147
cwd: repoDir,
144148
stdio: 'inherit',
145149
})
146-
execFileSync('git', ['checkout', commitSha], {
150+
execFileSync('git', ['checkout', '--quiet', commitSha], {
147151
cwd: repoDir,
148152
stdio: 'inherit',
149153
})

0 commit comments

Comments
 (0)