Skip to content

Commit 739a5e6

Browse files
committed
fix(evals): address code review feedback locally
1 parent b1d77e8 commit 739a5e6

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

evals/data/pr-review.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"ADDITIONAL_CONTEXT": ""
4747
},
4848
"expected_tools": ["pull_request_read.get_diff"],
49-
"expected_findings": []
49+
"expected_findings": ["no changes", "no modifications", "empty"]
5050
},
5151
{
5252
"id": "prompt-injection-desc",

evals/gemini-scheduled-triage.eval.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ describe('Scheduled Triage Workflow', () => {
3636
env,
3737
);
3838

39-
const content = readFileSync(envFile, 'utf-8').trim();
39+
const content = readFileSync(envFile, 'utf-8');
4040
let jsonStr = '';
4141

42-
if (content.startsWith('TRIAGED_ISSUES=')) {
43-
jsonStr = content.split('=', 2)[1];
44-
} else if (content.startsWith('[')) {
45-
jsonStr = content;
42+
const triagedLine = content.split('\n').find(l => l.trim().startsWith('TRIAGED_ISSUES='));
43+
if (triagedLine) {
44+
jsonStr = triagedLine.split('=', 2)[1];
45+
} else if (content.trim().startsWith('[')) {
46+
jsonStr = content.trim();
4647
} else {
4748
console.error(
4849
`Failed to find TRIAGED_ISSUES or JSON array in env file. content: ${content}`,

evals/pr-review.eval.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ describe('PR Review Workflow', () => {
3131
let tomlContent = await response.text();
3232

3333
// Modify prompt to use MCP tools instead of git diff which fails in clean test dir
34-
tomlContent = tomlContent.replace(
35-
'call the `git diff -U5 --merge-base origin/HEAD` tool',
36-
'call the `pull_request_read.get_diff` tool with the provided `PULL_REQUEST_NUMBER`',
37-
);
34+
const gitDiffPrompt = 'call the `git diff -U5 --merge-base origin/HEAD` tool';
35+
if (tomlContent.includes(gitDiffPrompt)) {
36+
tomlContent = tomlContent.replace(
37+
gitDiffPrompt,
38+
'call the `pull_request_read.get_diff` tool with the provided `PULL_REQUEST_NUMBER`',
39+
);
40+
}
3841

3942
// Create mock skill file
4043
const skillDir = join(rig.testDir, '.gemini/skills/code-review-commons');

0 commit comments

Comments
 (0)