mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 10:06:47 +00:00
CICO-111286: Include diff_hunk in the review comments
This commit is contained in:
parent
2d083cc61e
commit
c2dee0d45a
3 changed files with 16 additions and 6 deletions
7
dist/index.js
vendored
7
dist/index.js
vendored
|
@ -460,10 +460,12 @@ function createComment(file, chunk, aiResponses) {
|
|||
return [];
|
||||
}
|
||||
const commentLine = "ln" in change ? change.ln : "ln2" in change ? change.ln2 : 0;
|
||||
const diff_hunk = chunk.content + "\n" + chunk.changes.map(c => `${c.type === 'add' ? '+' : c.type === 'del' ? '-' : ' '} ${c.content}`).join("\n");
|
||||
return {
|
||||
body: aiResponse.reviewComment,
|
||||
path: file.to,
|
||||
line: commentLine,
|
||||
diff_hunk: diff_hunk.trim(),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
@ -485,7 +487,10 @@ function createReviewComment(owner, repo, pull_number, comments, commit_id) {
|
|||
path: comment.path,
|
||||
line: comment.line,
|
||||
side: 'RIGHT',
|
||||
commit_id, // Include commit_id in the request
|
||||
commit_id,
|
||||
start_line: comment.line,
|
||||
start_side: 'RIGHT',
|
||||
diff_hunk: comment.diff_hunk, // Include diff_hunk in the request
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue