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

Close summary to reduce noise #511

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,11 @@ tags.lock
.env
.secrets
bin/act
/.idea/.gitignore
/.idea/ai-pr-reviewer.iml
/.idea/codeStyles/codeStyleConfig.xml
/.idea/misc.xml
/.idea/modules.xml
/.idea/codeStyles/Project.xml
/.idea/inspectionProfiles/Project_Default.xml
/.idea/vcs.xml
Comment on lines +126 to +133
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the .gitignore file seem to be ignoring IDE-specific files, which is a good practice. However, instead of listing each file in the .idea directory individually, you can ignore the entire directory by simply adding /.idea/. This will make your .gitignore file cleaner and easier to maintain.

- /.idea/.gitignore
- /.idea/ai-pr-reviewer.iml
- /.idea/codeStyles/codeStyleConfig.xml
- /.idea/misc.xml
- /.idea/modules.xml
- /.idea/codeStyles/Project.xml
- /.idea/inspectionProfiles/Project_Default.xml
- /.idea/vcs.xml
+ /.idea/

27 changes: 9 additions & 18 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,8 @@ ${COMMENT_TAG}`
}
}

async submitReview(pullNumber: number, commitId: string, statusMsg: string) {
async submitReview(pullNumber: number, commitId: string) {
const body = `${COMMENT_GREETING}

${statusMsg}
`

if (this.reviewCommentsBuffer.length === 0) {
Expand Down
24 changes: 7 additions & 17 deletions src/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ ${
`

// update the existing comment with in progress status
const inProgressSummarizeCmt = commenter.addInProgressStatus(
/*const inProgressSummarizeCmt = commenter.addInProgressStatus(
existingSummarizeCmtBody,
statusMsg
)
)*/

// add in progress status to the summarize comment
await commenter.comment(`${inProgressSummarizeCmt}`, SUMMARIZE_TAG, 'replace')
// await commenter.comment(`${inProgressSummarizeCmt}`, SUMMARIZE_TAG, 'replace')

const summariesFailed: string[] = []

Expand Down Expand Up @@ -457,17 +457,6 @@ ${RAW_SUMMARY_END_TAG}
${SHORT_SUMMARY_START_TAG}
${inputs.shortSummary}
${SHORT_SUMMARY_END_TAG}

---

<details>
<summary>Uplevel your code reviews with CodeRabbit Pro</summary>

### CodeRabbit Pro

If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

</details>
`

statusMsg += `
Expand Down Expand Up @@ -745,13 +734,14 @@ ${
// post the review
await commenter.submitReview(
context.payload.pull_request.number,
commits[commits.length - 1].sha,
statusMsg
commits[commits.length - 1].sha
)
}

// post the final summary comment
await commenter.comment(`${summarizeComment}`, SUMMARIZE_TAG, 'replace')

// close summary to reduce comment noise
// await commenter.comment(`${summarizeComment}`, SUMMARIZE_TAG, 'replace')
}

const splitPatch = (patch: string | null | undefined): string[] => {
Expand Down