Changesets · Branches · Tags · Compare
| Changeset | f5ca24cbed080275fa225a0e0ff258012bf59e1006211664b703ffc7e892bf8d |
|---|---|
| Author | Tomasz Stefaniak <tomasz.p.stefaniak@gmail.com> · 2025-08-18 11:24 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-08-18 11:24 -07:00 |
| Parents | ccf00d6c610c, 6247e8eef992 |
5 files changed
modified .github/workflows/continue-detailed-review.yaml +1 −1
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | timeout-minutes: 10 |
| 19 | 19 | steps: |
| 20 | 20 | - name: Run Detailed PR Review |
| 21 | - uses: continuedev/continue/actions/detailed-review@23d9260536372acf4eb57a41e6ab62bc5869b070 | |
| 21 | + uses: continuedev/continue/actions/detailed-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe | |
| 22 | 22 | with: |
| 23 | 23 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 24 | 24 | continue-org: continuedev |
modified .github/workflows/continue-general-review.yaml +1 −1
| @@ -18,7 +18,7 @@ | ||
| 18 | 18 | timeout-minutes: 10 |
| 19 | 19 | steps: |
| 20 | 20 | - name: Run Continue PR Review Action |
| 21 | - uses: continuedev/continue/actions/general-review@23d9260536372acf4eb57a41e6ab62bc5869b070 | |
| 21 | + uses: continuedev/continue/actions/general-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe | |
| 22 | 22 | with: |
| 23 | 23 | continue-api-key: ${{ secrets.CONTINUE_API_KEY }} |
| 24 | 24 | continue-org: "continuedev" |
modified actions/README.md +1 −1
| @@ -219,7 +219,7 @@ | ||
| 219 | 219 | Example: |
| 220 | 220 | |
| 221 | 221 | ```yaml |
| 222 | -uses: continuedev/continue/actions/general-review@17fe39cc4f1760838ce4428aad0a984af13f8266 | |
| 222 | +uses: continuedev/continue/actions/general-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe | |
| 223 | 223 | ``` |
| 224 | 224 | |
| 225 | 225 | ## Troubleshooting |
modified actions/detailed-review/action.yml +44 −19
| @@ -29,12 +29,17 @@ | ||
| 29 | 29 | SHOULD_RUN="false" |
| 30 | 30 | |
| 31 | 31 | if [ "${{ github.event_name }}" = "pull_request" ]; then |
| 32 | - # Check PR author association | |
| 33 | - AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}" | |
| 34 | - if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then | |
| 35 | - SHOULD_RUN="true" | |
| 32 | + # Check if PR is a draft | |
| 33 | + if [ "${{ github.event.pull_request.draft }}" = "true" ]; then | |
| 34 | + echo "::notice::Skipping review - PR is a draft" | |
| 36 | 35 | else |
| 37 | - echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)" | |
| 36 | + # Check PR author association | |
| 37 | + AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}" | |
| 38 | + if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then | |
| 39 | + SHOULD_RUN="true" | |
| 40 | + else | |
| 41 | + echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)" | |
| 42 | + fi | |
| 38 | 43 | fi |
| 39 | 44 | elif [ "${{ github.event_name }}" = "issue_comment" ]; then |
| 40 | 45 | # Check if it's a PR comment with the trigger phrase |
| @@ -268,7 +273,23 @@ | ||
| 268 | 273 | console.log('Invalid comments:', JSON.stringify(invalidComments, null, 2)); |
| 269 | 274 | } |
| 270 | 275 | |
| 271 | - const comments = validComments.map(comment => ({ | |
| 276 | + // Deduplicate comments based on path + position + body | |
| 277 | + const uniqueComments = []; | |
| 278 | + const seen = new Set(); | |
| 279 | + | |
| 280 | + for (const comment of validComments) { | |
| 281 | + const key = `${comment.path}:${comment.position}:${comment.body}`; | |
| 282 | + if (!seen.has(key)) { | |
| 283 | + seen.add(key); | |
| 284 | + uniqueComments.push(comment); | |
| 285 | + } | |
| 286 | + } | |
| 287 | + | |
| 288 | + if (uniqueComments.length < validComments.length) { | |
| 289 | + console.log(`Filtered out ${validComments.length - uniqueComments.length} duplicate comments (same path + position + body)`); | |
| 290 | + } | |
| 291 | + | |
| 292 | + const comments = uniqueComments.map(comment => ({ | |
| 272 | 293 | path: comment.path, |
| 273 | 294 | position: comment.position, |
| 274 | 295 | body: comment.body |
| @@ -283,12 +304,19 @@ | ||
| 283 | 304 | // Create the review |
| 284 | 305 | if (comments.length > 0) { |
| 285 | 306 | try { |
| 307 | + let reviewBody = `${reviewData.review_summary || 'AI Code Review'}\n\n---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`; | |
| 308 | + | |
| 309 | + // Add triggered by note if from comment | |
| 310 | + if (context.eventName === 'issue_comment') { | |
| 311 | + reviewBody = `*Triggered by @${context.payload.comment.user.login}'s request*\n\n${reviewBody}`; | |
| 312 | + } | |
| 313 | + | |
| 286 | 314 | await github.rest.pulls.createReview({ |
| 287 | 315 | owner: context.repo.owner, |
| 288 | 316 | repo: context.repo.repo, |
| 289 | 317 | pull_number: prNumber, |
| 290 | 318 | commit_id: commitSha, |
| 291 | - body: `${reviewData.review_summary || 'AI Code Review'}\n\n---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`, | |
| 319 | + body: reviewBody, | |
| 292 | 320 | event: 'COMMENT', |
| 293 | 321 | comments: comments |
| 294 | 322 | }); |
| @@ -310,22 +338,19 @@ | ||
| 310 | 338 | } |
| 311 | 339 | } else { |
| 312 | 340 | // No inline comments, just post the summary |
| 341 | + let summaryBody = `## AI Code Review\n\n${reviewData.review_summary}\n\n*No specific line comments generated.*\n\n` + | |
| 342 | + `---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`; | |
| 343 | + | |
| 344 | + // Add triggered by note if from comment | |
| 345 | + if (context.eventName === 'issue_comment') { | |
| 346 | + summaryBody = `*Triggered by @${context.payload.comment.user.login}'s request*\n\n${summaryBody}`; | |
| 347 | + } | |
| 348 | + | |
| 313 | 349 | await github.rest.issues.createComment({ |
| 314 | 350 | issue_number: prNumber, |
| 315 | 351 | owner: context.repo.owner, |
| 316 | 352 | repo: context.repo.repo, |
| 317 | - body: `## AI Code Review\n\n${reviewData.review_summary}\n\n*No specific line comments generated.*\n\n` + | |
| 318 | - `---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*` | |
| 319 | - }); | |
| 320 | - } | |
| 321 | - | |
| 322 | - // Add triggered by note if from comment | |
| 323 | - if (context.eventName === 'issue_comment') { | |
| 324 | - await github.rest.issues.createComment({ | |
| 325 | - issue_number: prNumber, | |
| 326 | - owner: context.repo.owner, | |
| 327 | - repo: context.repo.repo, | |
| 328 | - body: `*Inline review triggered by @${context.payload.comment.user.login}*` | |
| 353 | + body: summaryBody | |
| 329 | 354 | }); |
| 330 | 355 | } |
| 331 | 356 |
modified actions/general-review/action.yml +10 −5
| @@ -29,12 +29,17 @@ | ||
| 29 | 29 | SHOULD_RUN="false" |
| 30 | 30 | |
| 31 | 31 | if [ "${{ github.event_name }}" = "pull_request" ]; then |
| 32 | - # Check PR author association | |
| 33 | - AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}" | |
| 34 | - if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then | |
| 35 | - SHOULD_RUN="true" | |
| 32 | + # Check if PR is a draft | |
| 33 | + if [ "${{ github.event.pull_request.draft }}" = "true" ]; then | |
| 34 | + echo "::notice::Skipping review - PR is a draft" | |
| 36 | 35 | else |
| 37 | - echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)" | |
| 36 | + # Check PR author association | |
| 37 | + AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}" | |
| 38 | + if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then | |
| 39 | + SHOULD_RUN="true" | |
| 40 | + else | |
| 41 | + echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)" | |
| 42 | + fi | |
| 38 | 43 | fi |
| 39 | 44 | elif [ "${{ github.event_name }}" = "issue_comment" ]; then |
| 40 | 45 | # Check if it's a PR comment with the trigger phrase |