Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 7af50e4

Browse files
authored
show skipped files (#80)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI Release Notes: - New Feature: The pull request adds a list of skipped files to the final response of a code review. It also updates the default system message for `@openai` and adds documentation review capability. <!-- end of auto-generated comment: release notes by openai -->
1 parent 6d70e9b commit 7af50e4

File tree

3 files changed

+42
-11
lines changed

3 files changed

+42
-11
lines changed

action.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ inputs:
7070
required: false
7171
description: 'System message to be sent to OpenAI'
7272
default: |
73-
You are `@openai`, a highly experienced software engineer with a strong
74-
ability to review code changes thoroughly.You can uncover issues such as
75-
logic errors, syntax errors, out of bound errors, potential data races,
76-
livelocks, starvation, suspension, order violation, atomicity violation,
77-
consistency, complexity, error handling, typos, and more.
78-
79-
You will be conducting code reviews today and write code if asked to do so.
73+
You are `@openai` (aka `github-actions[bot]`), a highly experienced software
74+
engineer with a strong ability to review code changes thoroughly.You will
75+
uncover issues such as logic errors, syntax errors, out of bound errors,
76+
potential data races, livelocks, starvation, suspension, order violation,
77+
atomicity violation, consistency, complexity, error handling, typos, grammar,
78+
and more.
79+
80+
You will be conducting code & documentation review today and generate code
81+
& documentation if asked to do so.
8082
summarize_beginning:
8183
required: false
8284
description: 'The prompt for the whole pull request'
@@ -116,7 +118,7 @@ inputs:
116118
Please provide your final response in the `markdown` format with
117119
the following content:
118120
- Thank the user for letting you participate in the code review.
119-
- High-level summary (focus on the purpose and intent within 80 words)
121+
- High-level summary (comment on the overall change instead of specific files within 80 words)
120122
- Table of files and their summaries. You can group files with similar
121123
changes together into one row to save space.
122124
@@ -286,7 +288,7 @@ inputs:
286288
Please reply directly to the new comment (instead of suggesting
287289
a reply) and your reply will be posted as-is.
288290
289-
If the comment contains instructions/request for you, please comply.
291+
If the comment contains instructions/requests for you, please comply.
290292
For example, if the comment is asking you to generate documentation
291293
comments on the code, in your reply please generate the required code.
292294

dist/index.js

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/review.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ export const codeReview = async (
6767

6868
// skip files if they are filtered out
6969
const filtered_files = []
70+
const skipped_files = []
7071
for (const file of files) {
7172
if (!options.check_path(file.filename)) {
7273
core.info(`skip for excluded path: ${file.filename}`)
73-
continue
74+
skipped_files.push(file)
7475
} else {
7576
filtered_files.push(file)
7677
}
@@ -222,8 +223,22 @@ ${filename}: ${summary}
222223
} else {
223224
inputs.summary = summarize_final_response
224225

226+
// make a bullet point list of skipped files
227+
let skipped_files_str = ''
228+
if (skipped_files.length > 0) {
229+
skipped_files_str = `---
230+
231+
These files were skipped from the review:
232+
`
233+
for (const file of skipped_files) {
234+
skipped_files_str += `- ${file.filename}\n`
235+
}
236+
}
237+
225238
const summarize_comment = `${summarize_final_response}
226239
240+
${skipped_files_str}
241+
227242
---
228243
229244
Tips:

0 commit comments

Comments
 (0)