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

Commit 4a2505e

Browse files
authored
turn on suggestions again (#125)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI Release Notes: - New Feature: Added prompts for generating release notes and responding to pull request review comments in `action.yml`. - Enhancement: `summarize` prompt now includes a summary of changes for each file. - Enhancement: `review` prompt includes a new format for suggesting replacement code. > "Code reviews made easy, > With prompts that are oh so breezy. > Release notes and comments galore, > Now we can review with so much more!" <!-- end of auto-generated comment: release notes by openai -->
1 parent afffd23 commit 4a2505e

File tree

1 file changed

+52
-47
lines changed

1 file changed

+52
-47
lines changed

action.yml

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -94,41 +94,44 @@ inputs:
9494
required: false
9595
description: 'The prompt for the whole pull request'
9696
default: |
97-
GitHub pull request has the title "$title" and the following description:
97+
GitHub pull request has the title -
98+
`$title`
9899
100+
Here is the description -
99101
```
100102
$description
101103
```
102-
I am providing diff for `$filename` below. I would like you to summarize
103-
the diff within 50 words.
104104
105+
Here is the diff for `$filename` -
105106
```diff
106107
$file_diff
107108
```
109+
110+
I would like you to summarize the diff within 50 words.
108111
summarize:
109112
required: false
110113
description: 'The prompt for final summarization response'
111114
default: |
112-
This is the end of the summarization session. Below is the summary you have
113-
generated so far for each file.
114-
115+
Here is the summary of changes you have generated for each file -
115116
```
116117
$summary
117118
```
118119
119-
Please provide your final response in the `markdown` format with
120-
the following content:
120+
Provide your final response in the `markdown` format with
121+
the following content -
121122
- Thank the user for letting you participate in the code review.
122123
- High-level summary (comment on the overall change instead of
123124
specific files within 80 words)
124125
- Table of files and their summaries. You can group files with
125126
similar changes together into one row to save space.
126127
127128
Avoid additional commentary as this summary will be added as a
128-
comment on the pull request.
129+
comment on the GitHub pull request.
129130
summarize_release_notes:
130131
required: false
131-
description: 'The prompt for generating release notes'
132+
description:
133+
'The prompt for generating release notes in the same chat as summarize
134+
stage'
132135
default: |
133136
Create concise release notes in `markdown` format for this pull request,
134137
focusing on its purpose and user story. You can classify the changes as
@@ -145,33 +148,37 @@ inputs:
145148
required: false
146149
description: 'The prompt for each file'
147150
default: |
148-
GitHub pull request has the title "$title" and the following description:
151+
GitHub pull request has the title -
152+
`$title`
149153
154+
Here is the description -
150155
```
151156
$description
152157
```
153158
154-
The OpenAI-generated summary is as follows:
155-
159+
Here is the OpenAI generated summary -
156160
```
157161
$summary
158162
```
159163
160-
Content of `$filename` is follows.
161-
164+
Here is the content of file `$filename` -
162165
```
163166
$file_content
164167
```
165168
166-
Format for changes and review comments on line ranges.
167-
`---` separator is used.
168-
169+
Format for changes and review comments (if any)
170+
on line ranges -
169171
<start_line-end_line>:
170172
```diff
171173
<diff_hunk>
172174
```
173175
```text
174-
<existing review comments on diff_hunk, if any>
176+
<existing review comments>
177+
```
178+
---
179+
<start_line-end_line>:
180+
```diff
181+
<diff_hunk>
175182
```
176183
---
177184
...
@@ -181,21 +188,30 @@ inputs:
181188
displaying added, removed, and unchanged lines with
182189
"+" or "-" prefixes and surrounding context lines.
183190
184-
Diff hunks for review are below -
185-
191+
Changes for review -
186192
$patches
187193
188194
Your review must consist of comments in the below format
189195
with a separator between review comments. Any other
190196
commentary outside of this format will be ignored and will not
191197
be read by the parser. Make sure to use the line numbers exactly
192-
as provided above.
193-
198+
as provided above -
194199
<start_line-end_line>:
195200
<review>
196201
---
202+
<start_line-end_line>:
203+
<review>
204+
```suggestion
205+
<replacement code from start_line>
206+
```
207+
---
197208
...
198209
210+
The replacement code you suggest must not be in the diff format and
211+
must the exact code that will replace existing code from the start_line.
212+
The suggestion must include context lines from diff hunk even if they
213+
are unchanged.
214+
199215
Reflect on the provided code at least 3 times to identify any
200216
bug risks or provide improvement suggestions in these diff hunks.
201217
You will point out potential issues such as security, logic errors,
@@ -213,52 +229,42 @@ inputs:
213229
required: false
214230
description: 'Prompt for comment'
215231
default: |
216-
A comment was made on a review for a diff hunk on file
217-
`$filename`. I would like you to follow the instructions
218-
in that comment.
219-
220-
If possible, I will provide you the file and the entire diff
221-
to help provide overall context for your response.
232+
A comment was made on a GitHub pull request review for a
233+
diff hunk on file `$filename`. I would like you to follow
234+
the instructions in that comment.
222235
223-
The pull request has the title "$title" and the following
224-
description:
236+
Here is the title -
237+
`$title`
225238
239+
Here is the description-
226240
```
227241
$description
228242
```
229243
230-
The OpenAI-generated summary is as follows:
231-
244+
Here is the OpenAI generated summary -
232245
```
233246
$summary
234247
```
235248
236-
Here is the content of file.
237-
249+
Here is the content of file -
238250
```
239251
$file_content
240252
```
241253
242-
Here is the entire diff.
243-
254+
Here is the entire diff -
244255
```diff
245256
$file_diff
246257
```
247258
248-
I would like you to follow the instructions in the new
249-
comment made on a conversation chain on a code review diff.
250-
251-
Diff being commented on:
252-
259+
Here is diff being commented on -
253260
```diff
254261
$diff
255262
```
256263
257-
The format of the conversation chain is:
264+
The format of the conversation chain is -
258265
`user: comment`
259266
260-
Conversation chain (including the new comment):
261-
267+
Conversation chain (including the new comment) -
262268
```
263269
$comment_chain
264270
```
@@ -273,8 +279,7 @@ inputs:
273279
In your reply, please make sure to begin the reply by tagging the user
274280
with "@user".
275281
276-
The comment/request that you need to directly reply to:
277-
282+
The comment/request that you need to directly reply to -
278283
```
279284
$comment
280285
```

0 commit comments

Comments
 (0)