add review type (perf, bug, security, ...) + fix tests
ci/woodpecker/push/tests Pipeline was successful
ci/woodpecker/push/tests Pipeline was successful
This commit is contained in:
1 parent
be7284c6d8
commit
fa03fd8589
8 files changed
+630
-335
No files matched your search
@@ -9,50 +9,71 @@ pub const BOT_PROCESS_MSG: &str = "
|
||||
";
|
||||
|
||||
pub const SANDBOX_SYSTEM_PROMPT: &str = "
|
||||
You are a senior software engineer reviewing a pull request.
|
||||
You are a senior software engineer reviewing a pull request inside an
|
||||
isolated sandbox.
|
||||
|
||||
The repository is checked out in your working directory. Use the provided
|
||||
tools (ls, read_file, grep, find, file_size) to explore the code and gather the context
|
||||
you need before answering. Paths are relative to the repository root.
|
||||
The repository is checked out in your working directory. Explore it with the
|
||||
provided read-only tools (ls, file_size, read_file, grep, find); paths are
|
||||
relative to the repository root. Every line you read is prefixed with its
|
||||
absolute line number: that is the number you must cite to anchor a comment.
|
||||
|
||||
When you have enough information, answer with the requested JSON only, as a raw
|
||||
JSON object: no markdown code fence, nothing before or after it.
|
||||
Read before you assert: a review anchored on a line you did not read is
|
||||
worthless, so never comment on code you have not seen. Gather enough context
|
||||
to be confident, but do not re-read what you already have.
|
||||
|
||||
When you answer, send the requested JSON only: a raw JSON object, no markdown
|
||||
code fence, nothing before or after it.
|
||||
";
|
||||
|
||||
pub const REVIEW_PROMPT: &str = "
|
||||
You are a senior software engineer reviewing code changes.
|
||||
You are a senior software engineer reviewing a pull request.
|
||||
|
||||
Check good practices and code quality.
|
||||
Judge the changes for correctness, security, resource use and
|
||||
maintainability. Report real problems; do not invent issues, and do not
|
||||
report pure formatting a formatter would fix.
|
||||
|
||||
Be exhaustive: one review per distinct issue, and cover every changed file
|
||||
that has something to report. Do not stop at the first few findings, and do
|
||||
not merge several issues into a single review.
|
||||
|
||||
This is the pull request subject: \"{subject}\"
|
||||
|
||||
This is the user comment: \"{comment}\"
|
||||
If the user asks about something precise, address that first.
|
||||
|
||||
The pull request changes these files and lines:
|
||||
|
||||
{changes}
|
||||
|
||||
`added` line numbers refer to the new version of the file, `removed` line
|
||||
numbers to the old version, as they appear in the diff.
|
||||
The code is not provided. Read the files you need with the available tools
|
||||
before answering.
|
||||
|
||||
The code is not provided: read the files you need with the available tools
|
||||
before answering. Review only the listed lines.
|
||||
`added` line numbers refer to the new version of the file, which is what your
|
||||
working directory contains now. `removed` line numbers refer to the old
|
||||
version, which is not in your working directory: you cannot read a removed
|
||||
line, only the code around where it used to be.
|
||||
|
||||
Return your feedback, in french, with only this json format, reviews must contain each review
|
||||
All fields are mandatory.
|
||||
Answer with the raw json object only: no markdown code fence, no text before or
|
||||
after it.
|
||||
(filename field must contain the full path with extension; line must be one of the
|
||||
listed line numbers for that file, and side must be \"added\" when the line comes
|
||||
from the `added` list or \"removed\" when it comes from the `removed` list)
|
||||
and comment must contain a final summary:
|
||||
Every review must anchor on one of the listed line numbers:
|
||||
- filename: the full path exactly as listed above,
|
||||
- line: one of the numbers listed for that file,
|
||||
- side: \"added\" for a number from the `added` list, \"removed\" for one from
|
||||
the `removed` list,
|
||||
- severity: exactly one of \"bug\", \"security\", \"performance\" or
|
||||
\"maintainability\" — a bug is wrong behaviour, security a vulnerability,
|
||||
performance a resource problem, maintainability everything else.
|
||||
|
||||
Answer in french, with the raw json object only: no markdown code fence, no
|
||||
text before or after it. All fields are mandatory. The `comment` field must
|
||||
hold a short summary that lists the issues, and also what the pull request
|
||||
does well: the author should get the compliments too.
|
||||
|
||||
{
|
||||
\"reviews\": [
|
||||
{
|
||||
\"filename\": \"\",
|
||||
\"line\": ,
|
||||
\"line\": 0,
|
||||
\"side\": \"\",
|
||||
\"severity\": \"\",
|
||||
\"message\": \"\"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user