Extract review logic into bot_actions module

Move `exec_review`, `download_git_diff`, and review formatting
to a new `bot_actions::review` module. Update the review flow to
post inline review comments via the Gitea API and simplify the
comment markdown to a summary. Add diff formatting that
preprocesses added lines with line numbers for the LLM prompt.
This commit is contained in:
2026-06-06 17:27:35 +00:00
parent ced1fca563
commit aa0dbdcc7a
6 changed files with 265 additions and 117 deletions
+4 -9
View File
@@ -17,19 +17,14 @@ pub const REVIEW_PROMPT: &str = "
This is the user comment: \"{comment}\"
This is the git diff of the code changes:
The code changes (only added lines, with line numbers):
\"{diff}\"
{diff}
Please review the code changes and provide feedback.
IMPORTANT — How to compute the line number:
The diff is in unified format. Each hunk starts with a header like:
`@@ -old_start,old_count +new_start,new_count @@`
The `line` field must be the line number in the **new** version of the file.
To find it, start at `new_start`, then count every context line (no prefix)
and every added line (prefixed with `+`) — skip removed lines (prefixed with `-`).
The line number increments by 1 for each context or added line.
IMPORTANT: the `line` field must be the line number shown before each line.
The provided code has the format: `filename:line:code`
Return your feedback, in french, with only this json format, reviews must contain each review
All fields are mandatory.