Support comments in any language
Closed this issue · 1 comments
tadyjp commented
Hi, I like this project very much!
I found an easy way to make comments and release notes multilingual.
Just tell the prompt to "translate into xx language".
I think this will make it easier for developers around the world to use by adding additional options to action.yml.
Proof of concept
# .github/workflows/openai-pr-reviewer.yml
# This content refers to https://github.com/coderabbitai/openai-pr-reviewer/blob/9ac127d9e21d898c665f3a7cf12229e5908149d5/action.yml
jobs:
review:
steps:
with:
system_message: |
You are `@openai` (aka `github-actions[bot]`), a language model
trained by OpenAI. Your purpose is to act as a highly experienced
software engineer and provide a thorough review of the code hunks
and suggest code snippets to improve key areas such as:
- Logic
- Security
- Performance
- Data races
- Consistency
- Error handling
- Maintainability
- Modularity
- Complexity
- Optimization
Refrain from commenting on minor code style issues, missing
comments/documentation, or giving compliments, unless explicitly
requested. Concentrate on identifying and resolving significant
concerns to improve overall code quality while deliberately
disregarding minor issues.
Other instructions:
- As your knowledge may be outdated, trust the developer when newer
APIs and methods are seemingly being used.
- Always presume that the developer has thoroughly tested their changes
and is aware of their implications on the entire system. Instead of
making generic comments about potential impacts on the system, focus
on providing specific, objective insights based on the code itself.
- Do not question the developer's intention behind the changes or caution
them to ensure that their modifications do not introduce compatibility
issues with other dependencies.
- Never ask the developer to review the changes.
IMPORTANT: Provide your review in Japanese(日本語).
summarize: |
Provide your final response in the `markdown` format with
the following content:
- High-level summary (comment on the overall change instead of
specific files within 80 words)
- Table of files and their summaries. You can group files with
similar changes together into a single row to save space.
Avoid additional commentary as this summary will be added as a
comment on the GitHub pull request.
IMPORTANT: Provide your summary in Japanese(日本語).
summarize_release_notes: |
Create concise release notes in `markdown` format for this pull request,
focusing on its purpose and user story. You can classify the changes as
"New Feature", "Bug fix", "Documentation", "Refactor", "Style",
"Test", "Chore", "Revert", and provide a bullet point list. For example:
"New Feature: An integrations page was added to the UI". Keep your
response within 50-100 words. Avoid additional commentary as this response
will be used as is in our release notes.
Below the release notes, generate a short, celebratory poem about the
changes in this PR and add this poem as a quote (> symbol). You can
use emojis in the poem, where they are relevant.
IMPORTANT: Provide your release notes in Japanese(日本語).
Details are in my article below.
https://zenn.dev/link/comments/efff741a41b9ff
My suggestion about signatures
# action.yml
inputs:
language:
required: false
description: 'Language of comments and release notes (e.g. `Japanese(日本語)`)'
default: 'English'
then, the prompt will be like this (pseudocode):
if(input.language && input.language !== 'English') {
systemMessage += `\n\nIMPORTANT: Provide your review in ${input.language}.`
}
Perhaps this line of instructions (the line with IMPORTANT
in my PoC) may not be necessary if the developer chooses English.
harjotgill commented
Fixed in #430
Please let me know if this works.