Skip to content

Commit 29b1aea

Browse files
authored
chore: make AI code review opt-in (coder#21883)
The comments generated are too noisy and not of sufficiently high signal that we should automatically opt every PR in. This PR moves the trigger to the `code-review` label _only_. Signed-off-by: Danny Kopping <danny@coder.com>
1 parent fd00958 commit 29b1aea

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

.github/workflows/code-review.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
# native suggestion syntax, allowing one-click commits of suggested changes.
77
#
88
# Triggers:
9-
# - New PR opened: Initial code review
10-
# - Label "code-review" added: Re-run review on demand
11-
# - PR marked ready for review: Review when draft is promoted
9+
# - Label "code-review" added: Run review on demand
1210
# - Workflow dispatch: Manual run with PR URL
1311
#
1412
# Note: This workflow requires access to secrets and will be skipped for:
@@ -20,9 +18,7 @@ name: AI Code Review
2018
on:
2119
pull_request:
2220
types:
23-
- opened
2421
- labeled
25-
- ready_for_review
2622
workflow_dispatch:
2723
inputs:
2824
pr_url:
@@ -44,9 +40,7 @@ jobs:
4440
cancel-in-progress: true
4541
if: |
4642
(
47-
github.event.action == 'opened' ||
4843
github.event.label.name == 'code-review' ||
49-
github.event.action == 'ready_for_review' ||
5044
github.event_name == 'workflow_dispatch'
5145
) &&
5246
(github.event.pull_request.draft == false || github.event_name == 'workflow_dispatch')
@@ -127,15 +121,9 @@ jobs:
127121
128122
# Set trigger type based on action
129123
case "${GITHUB_EVENT_ACTION}" in
130-
opened)
131-
echo "trigger_type=new_pr" >> "${GITHUB_OUTPUT}"
132-
;;
133124
labeled)
134125
echo "trigger_type=label_requested" >> "${GITHUB_OUTPUT}"
135126
;;
136-
ready_for_review)
137-
echo "trigger_type=ready_for_review" >> "${GITHUB_OUTPUT}"
138-
;;
139127
*)
140128
echo "trigger_type=unknown" >> "${GITHUB_OUTPUT}"
141129
;;
@@ -157,15 +145,9 @@ jobs:
157145
158146
# Build context based on trigger type
159147
case "${TRIGGER_TYPE}" in
160-
new_pr)
161-
CONTEXT="This is a NEW PR. Perform a thorough code review."
162-
;;
163148
label_requested)
164149
CONTEXT="A code review was REQUESTED via label. Perform a thorough code review."
165150
;;
166-
ready_for_review)
167-
CONTEXT="This PR was marked READY FOR REVIEW. Perform a thorough code review."
168-
;;
169151
manual)
170152
CONTEXT="This is a MANUAL review request. Perform a thorough code review."
171153
;;

0 commit comments

Comments
 (0)