Integrate OpenRouter for AI-powered code review

Add openrouter-rs dependency, review prompt, and markdown formatting.
Update comment API to accept dynamic body. Adjust devcontainer for
podman compatibility.
This commit is contained in:
2026-06-03 19:38:00 +00:00
parent 4966d08d18
commit de81232201
9 changed files with 541 additions and 50 deletions
+33
View File
@@ -1,3 +1,36 @@
pub const GITEA_SIG_HEADER_NAME: &str = "x-gitea-signature";
pub const GITEA_EVENT_TYPE_HEADER_NAME: &str = "x-gitea-event-type";
pub const MAX_WEBHOOK_BODY_SIZE: usize = 1024 * 1024; // 1 MiB
pub const BOT_PROCESS_MSG: &str = "
Review in progress with the model \"{model}\"...
";
pub const REVIEW_PROMPT: &str = "
You are a senior software engineer reviewing code changes.
Check good practices and code quality.
This is the pull request subject: \"{subject}\"
This is the user comment: \"{comment}\"
This is the git diff of the code changes:
\"{diff}\"
Please review the code changes and provide feedback.
Return your feedback with only this json format, reviews must contain each review (filename field must contain the full path with extension) and comment msut contain a final summary:
{
\"reviews\": [
{
\"filename\": \"\",
\"line\": ,
\"code\": \"\",
\"message\": \"\"
}
],
\"comment\": \"\"
}
";