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

Commit

Permalink
fix issue with multiple release notes (#452)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit

```
- Refactor: Updated `DESCRIPTION_START_TAG` constant to be a string and optimized the `removeContentWithinTags` function in `src/commenter.ts`.
- Documentation: Updated product name from "Professional Version of CodeRabbit" to "CodeRabbit Pro" in README.md and src/review.ts.
- New Feature: Announced that CodeRabbit Pro is now free for open source projects, as reflected in src/review.ts.
```
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
  • Loading branch information
harjotgill committed Sep 1, 2023
1 parent 8f7ccd6 commit 516a072
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 67 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ FAQs, you can refer to the sections below.
- [Contribute](#contribute)
- [FAQs](#faqs)

## Professional Version of CodeRabbit
## CodeRabbit Pro

The professional version of `openai-pr-reviewer` project is now available at
[coderabbit.ai](http://coderabbit.ai). Building upon our open-source foundation,
CodeRabbit offers premium features including enhanced context and superior noise
reduction, dedicated support, and our ongoing commitment to improve code
reviews.
[coderabbit.ai](http://coderabbit.ai). Building upon our open source foundation,
CodeRabbit Pro offers premium features including enhanced context and superior
noise reduction, dedicated support, and our ongoing commitment to improve code
reviews. Moreover, CodeRabbit Pro is free for open source projects.

## Install instructions

Expand Down
76 changes: 19 additions & 57 deletions dist/index.js

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

8 changes: 4 additions & 4 deletions src/commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const IN_PROGRESS_START_TAG =
export const IN_PROGRESS_END_TAG =
'<!-- end of auto-generated comment: summarize review in progress by OSS CodeRabbit -->'

export const DESCRIPTION_START_TAG = `
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit -->`
export const DESCRIPTION_START_TAG =
'<!-- This is an auto-generated comment: release notes by OSS CodeRabbit -->'
export const DESCRIPTION_END_TAG =
'<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->'

Expand Down Expand Up @@ -93,7 +93,7 @@ ${tag}`

removeContentWithinTags(content: string, startTag: string, endTag: string) {
const start = content.indexOf(startTag)
const end = content.indexOf(endTag)
const end = content.lastIndexOf(endTag)
if (start >= 0 && end >= 0) {
return content.slice(0, start) + content.slice(end + endTag.length)
}
Expand Down Expand Up @@ -155,7 +155,7 @@ ${tag}`
DESCRIPTION_START_TAG,
DESCRIPTION_END_TAG
)
const newDescription = `${description}${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
const newDescription = `${description}\n${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
await octokit.pulls.update({
owner: repo.owner,
repo: repo.repo,
Expand Down
2 changes: 1 addition & 1 deletion src/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ ${SHORT_SUMMARY_END_TAG}
### 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.
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>
`
Expand Down

0 comments on commit 516a072

Please sign in to comment.