Merge pull request #1292 from Codium-ai/tr/server

Tr/server
This commit is contained in:
Tal
2024-10-14 10:31:41 +03:00
committed by GitHub
3 changed files with 57 additions and 52 deletions

View File

@ -27,27 +27,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
``` ```
if you want to pin your action to a specific release (v0.23 for example) for stability reasons, use:
```yaml
...
steps:
- name: PR Agent action step
id: pragent
uses: docker://codiumai/pr-agent:0.23-github_action
...
```
For enhanced security, you can also specify the Docker image by its [digest](https://hub.docker.com/repository/docker/codiumai/pr-agent/tags):
```yaml
...
steps:
- name: PR Agent action step
id: pragent
uses: docker://codiumai/pr-agent@sha256:14165e525678ace7d9b51cda8652c2d74abb4e1d76b57c4a6ccaeba84663cc64
...
```
2) Add the following secret to your repository under `Settings > Secrets and variables > Actions > New repository secret > Add secret`: 2) Add the following secret to your repository under `Settings > Secrets and variables > Actions > New repository secret > Add secret`:
``` ```
@ -70,6 +49,40 @@ When you open your next PR, you should see a comment from `github-actions` bot w
``` ```
See detailed usage instructions in the [USAGE GUIDE](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-action) See detailed usage instructions in the [USAGE GUIDE](https://qodo-merge-docs.qodo.ai/usage-guide/automations_and_usage/#github-action)
### Using a specific release
!!! tip ""
if you want to pin your action to a specific release (v0.23 for example) for stability reasons, use:
```yaml
...
steps:
- name: PR Agent action step
id: pragent
uses: docker://codiumai/pr-agent:0.23-github_action
...
```
For enhanced security, you can also specify the Docker image by its [digest](https://hub.docker.com/repository/docker/codiumai/pr-agent/tags):
```yaml
...
steps:
- name: PR Agent action step
id: pragent
uses: docker://codiumai/pr-agent@sha256:14165e525678ace7d9b51cda8652c2d74abb4e1d76b57c4a6ccaeba84663cc64
...
```
### Action for GitHub enterprise server
!!! tip ""
To use the action with a GitHub enterprise server, add an environment variable `GITHUB.BASE_URL` with the API URL of your GitHub server.
For example, if your GitHub server is at `https://github.mycompany.com`, add the following to your workflow file:
```yaml
env:
# ... previous environment values
GITHUB.BASE_URL: "https://github.mycompany.com/api/v3"
```
--- ---
## Run as a GitHub App ## Run as a GitHub App

View File

@ -16,8 +16,8 @@ from pr_agent.config_loader import get_settings
def main(): def main():
# Fill in the following values # Fill in the following values
provider = "github" # GitHub provider provider = "github" # github/gitlab/bitbucket/azure_devops
user_token = "..." # GitHub user token user_token = "..." # user token
openai_key = "..." # OpenAI key openai_key = "..." # OpenAI key
pr_url = "..." # PR URL, for example 'https://github.com/Codium-ai/pr-agent/pull/809' pr_url = "..." # PR URL, for example 'https://github.com/Codium-ai/pr-agent/pull/809'
command = "/review" # Command to run (e.g. '/review', '/describe', '/ask="What is the purpose of this PR?"', ...) command = "/review" # Command to run (e.g. '/review', '/describe', '/ask="What is the purpose of this PR?"', ...)
@ -45,15 +45,20 @@ To invoke a tool (for example `review`), you can run directly from the Docker im
``` ```
docker run --rm -it -e OPENAI.KEY=<your key> -e GITHUB.USER_TOKEN=<your token> codiumai/pr-agent:latest --pr_url <pr_url> review docker run --rm -it -e OPENAI.KEY=<your key> -e GITHUB.USER_TOKEN=<your token> codiumai/pr-agent:latest --pr_url <pr_url> review
``` ```
If you are using GitHub enterprise server, you need to specify the custom url as variable.
For example, if your GitHub server is at `https://github.mycompany.com`, add the following to the command:
```
-e GITHUB.BASE_URL=https://github.mycompany.com/api/v3
```
- For GitLab: - For GitLab:
``` ```
docker run --rm -it -e OPENAI.KEY=<your key> -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN=<your token> codiumai/pr-agent:latest --pr_url <pr_url> review docker run --rm -it -e OPENAI.KEY=<your key> -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN=<your token> codiumai/pr-agent:latest --pr_url <pr_url> review
``` ```
Note: If you have a dedicated GitLab instance, you need to specify the custom url as variable: If you have a dedicated GitLab instance, you need to specify the custom url as variable:
``` ```
docker run --rm -it -e OPENAI.KEY=<your key> -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN=<your token> -e GITLAB.URL=<your gitlab instance url> codiumai/pr-agent:latest --pr_url <pr_url> review -e GITLAB.URL=<your gitlab instance url>
``` ```
- For BitBucket: - For BitBucket:
@ -65,19 +70,6 @@ For other git providers, update CONFIG.GIT_PROVIDER accordingly, and check the `
--- ---
If you want to ensure you're running a specific version of the Docker image, consider using the image's digest:
```bash
docker run --rm -it -e OPENAI.KEY=<your key> -e GITHUB.USER_TOKEN=<your token> codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --pr_url <pr_url> review
```
Or you can run a [specific released versions](https://github.com/Codium-ai/pr-agent/blob/main/RELEASE_NOTES.md) of pr-agent, for example:
```
codiumai/pr-agent@v0.9
```
---
## Run from source ## Run from source
1. Clone this repository: 1. Clone this repository:
@ -115,7 +107,7 @@ python3 -m pr_agent.cli --issue_url <issue_url> similar_issue
... ...
``` ```
[Optional] Add the pr_agent folder to your PYTHONPATH [Optional] Add the pr_agent folder to your PYTHONPATH
``` ```
export PYTHONPATH=$PYTHONPATH:<PATH to pr_agent folder> export PYTHONPATH=$PYTHONPATH:<PATH to pr_agent folder>
``` ```

View File

@ -17,8 +17,8 @@ Users without a purchased seat who interact with a repository featuring Qodo Mer
Beyond this limit, Qodo Merge Pro will cease to respond to their inquiries unless a seat is purchased. Beyond this limit, Qodo Merge Pro will cease to respond to their inquiries unless a seat is purchased.
## Install Qodo Merge Pro for GitHub Enterprise Server ## Install Qodo Merge Pro for GitHub Enterprise Server
You can install Qodo Merge Pro application on your GitHub Enterprise Server, and enjoy two weeks of free trial.
After the trial period, to continue using Qodo Merge Pro, you will need to contact us for an [Enterprise license](https://www.codium.ai/pricing/). To use Qodo Merge Pro application on your private GitHub Enterprise Server, you will need to contact us for starting an [Enterprise](https://www.codium.ai/pricing/) trial.
## Install Qodo Merge Pro for GitLab (Teams & Enterprise) ## Install Qodo Merge Pro for GitLab (Teams & Enterprise)