Merge commit '0b1edd9716160bf57eecf307db72439b5443704d' into hl/refactor_install_md

# Conflicts:
#	README.md
This commit is contained in:
Hussam.lawen
2023-07-16 22:02:34 +03:00
5 changed files with 25 additions and 20 deletions

View File

@ -25,11 +25,11 @@ Possible questions you can ask include:
- Is the PR ready for merge?
- What are the main changes in this PR?
- Should this PR be split into smaller parts?
- Can you compose a rhymed song about this PR.
- Can you compose a rhymed song about this PR?
---
#### Method 2: Run as a Github Action
#### Method 2: Run as a GitHub Action
You can use our pre-built Github Action Docker image to run PR-Agent as a Github Action.
@ -58,12 +58,12 @@ jobs:
OPENAI_KEY: <your key>
```
The GITHUB_TOKEN secret is automatically created by Github.
The GITHUB_TOKEN secret is automatically created by GitHub.
3. Merge this change to your main branch.
When you open your next PR, you should see a comment from `github-actions` bot with a review of your PR, and instructions on how to use the rest of the tools.
4. You may configure PR-Agent by adding environment variables under the env section that corresponds to any configurable property in the [configuration](./CONFIGURATION.md) file. Some examples:
4. You may configure PR-Agent by adding environment variables under the env section corresponding to any configurable property in the [configuration](./CONFIGURATION.md) file. Some examples:
```yaml
env:
# ... previous environment values
@ -107,7 +107,7 @@ python pr_agent/cli.py --pr_url <pr_url> improve
---
#### Method 4: Run as a polling server
Request reviews by tagging your Github user on a PR.
Request reviews by tagging your Github user on a PR
Follow steps 1-3 of method 2.
Run the following command to start the server:
@ -118,7 +118,7 @@ python pr_agent/servers/github_polling.py
---
#### Method 5: Run as a Github App
#### Method 5: Run as a GitHub App
Allowing you to automate the review process on your private or public repositories.
1. Create a GitHub App from the [Github Developer Portal](https://docs.github.com/en/developers/apps/creating-a-github-app).
@ -139,7 +139,7 @@ WEBHOOK_SECRET=$(python -c "import secrets; print(secrets.token_hex(10))")
3. Acquire the following pieces of information from your app's settings page:
- App private key (click "Generate a private key", and save the file)
- App private key (click "Generate a private key" and save the file)
- App ID
4. Clone this repository:
@ -170,11 +170,11 @@ docker push codiumai/pr-agent:github_app # Push to your Docker repository
7. Host the app using a server, serverless function, or container environment. Alternatively, for development and
debugging, you may use tools like smee.io to forward webhooks to your local machine.
8. Go back to your app's settings, set the following:
8. Go back to your app's settings, and set the following:
- Webhook URL: The URL of your app's server, or the URL of the smee.io channel.
- Webhook URL: The URL of your app's server or the URL of the smee.io channel.
- Webhook secret: The secret you generated earlier.
9. Install the app by navigating to the "Install App" tab, and selecting your desired repositories.
9. Install the app by navigating to the "Install App" tab and selecting your desired repositories.
---

View File

@ -16,30 +16,36 @@ CodiumAI `PR-Agent` is an open-source tool aiming to help developers review PRs
**Auto-Description**: Automatically generating PR description - name, type, summary, and code walkthrough.
\
**PR Review**: Feedback about the PR main theme, type, relevant tests, security issues, focused, and various suggestions for the PR content.
**PR Review**: Feedback about the PR main theme, type, relevant tests, security issues, focused PR, and various suggestions for the PR content.
\
**Question Answering**: Answering free-text questions about the PR.
\
**Code Suggestion**: Committable code suggestions for improving the PR.
Example results:
<h3>Example results:</h2>
</div>
<h>Describe:</h>
<h4>Describe:</h4>
<div align="center">
<p float="center">
<img src="./pics/describe.gif" width="800">
</p>
</div>
<h>Ask:</h>
<h4>Review:</h4>
<div align="center">
<p float="center">
<img src="./pics/review.gif" width="800">
</p>
</div>
<h4>Ask:</h4>
<div align="center">
<p float="center">
<img src="./pics/ask.gif" width="800">
</p>
</div>
<h>Code Suggestion:</h>
<h4>Improve:</h4>
<div align="center">
<p float="center">
<img src="./pics/pr_code_suggestions.png" width="800">
<img src="./pics/improve.gif" width="800">
</p>
</div>
<div align="left">
@ -112,15 +118,14 @@ Here are several ways to install and run PR-Agent:
- [Method 5: Run as a Github App](INSTALL.md#method-5-run-as-a-github-app)
- Allowing you to automate the review process on your private or public repositories
## Usage and Tools
**PR-Agent** provides four types of interactions ("tools"): `"PR Reviewer"`, `"PR Q&A"`, `"PR Description"` and `"PR Code Sueggestions"`.
- The "PR Reviewer" tool automatically analyzes PRs, and provides different types of feedbacks.
- The "PR Reviewer" tool automatically analyzes PRs, and provides different types of feedback.
- The "PR Ask" tool answers free-text questions about the PR.
- The "PR Description" tool automatically sets the PR Title and body.
- The "PR Code Suggestion" tool provide inline code suggestions for the PR, that can be applied and committed.
- The "PR Code Suggestion" tool provide inline code suggestions for the PR that can be applied and committed.
## How it works

BIN
pics/improve.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 MiB

BIN
pics/review.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 MiB

View File

@ -94,7 +94,7 @@ async def polling_loop():
success = await agent.handle_request(pr_url, rest_of_comment)
if not success:
git_provider.set_pr(pr_url)
git_provider.publish_comment("### How to user PR-Agent\n" +
git_provider.publish_comment("### How to use PR-Agent\n" +
bot_help_text(user_id))
elif response.status != 304: