From 9dd1995464e8b90aa24de4f2bcf251aa9541def1 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 14 Oct 2024 10:25:51 +0300 Subject: [PATCH 1/3] docs: update installation guides with GitHub enterprise server instructions and formatting improvements --- docs/docs/installation/github.md | 55 +++++++++++++++++++------------ docs/docs/installation/locally.md | 50 ++++++++++++---------------- 2 files changed, 55 insertions(+), 50 deletions(-) diff --git a/docs/docs/installation/github.md b/docs/docs/installation/github.md index 653b0844..8035d6db 100644 --- a/docs/docs/installation/github.md +++ b/docs/docs/installation/github.md @@ -27,27 +27,6 @@ jobs: 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`: ``` @@ -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) +### 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 diff --git a/docs/docs/installation/locally.md b/docs/docs/installation/locally.md index 123a6c03..fad9d789 100644 --- a/docs/docs/installation/locally.md +++ b/docs/docs/installation/locally.md @@ -16,8 +16,8 @@ from pr_agent.config_loader import get_settings def main(): # Fill in the following values - provider = "github" # GitHub provider - user_token = "..." # GitHub user token + provider = "github" # github/gitlab/bitbucket/azure_devops + user_token = "..." # user token openai_key = "..." # OpenAI key 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?"', ...) @@ -42,42 +42,34 @@ A list of the relevant tools can be found in the [tools guide](../tools/ask.md). To invoke a tool (for example `review`), you can run directly from the Docker image. Here's how: - For GitHub: -``` -docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent:latest --pr_url review -``` + ``` + docker run --rm -it -e OPENAI.KEY= -e GITHUB.USER_TOKEN= codiumai/pr-agent:latest --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: -``` -docker run --rm -it -e OPENAI.KEY= -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN= codiumai/pr-agent:latest --pr_url review -``` + ``` + docker run --rm -it -e OPENAI.KEY= -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN= codiumai/pr-agent:latest --pr_url review + ``` -Note: If you have a dedicated GitLab instance, you need to specify the custom url as variable: -``` -docker run --rm -it -e OPENAI.KEY= -e CONFIG.GIT_PROVIDER=gitlab -e GITLAB.PERSONAL_ACCESS_TOKEN= -e GITLAB.URL= codiumai/pr-agent:latest --pr_url review -``` + If you have a dedicated GitLab instance, you need to specify the custom url as variable: + ``` + -e GITLAB.URL= + ``` - For BitBucket: -``` -docker run --rm -it -e CONFIG.GIT_PROVIDER=bitbucket -e OPENAI.KEY=$OPENAI_API_KEY -e BITBUCKET.BEARER_TOKEN=$BITBUCKET_BEARER_TOKEN codiumai/pr-agent:latest --pr_url= review -``` + ``` + docker run --rm -it -e CONFIG.GIT_PROVIDER=bitbucket -e OPENAI.KEY=$OPENAI_API_KEY -e BITBUCKET.BEARER_TOKEN=$BITBUCKET_BEARER_TOKEN codiumai/pr-agent:latest --pr_url= review + ``` For other git providers, update CONFIG.GIT_PROVIDER accordingly, and check the `pr_agent/settings/.secrets_template.toml` file for the environment variables expected names and values. --- - -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= -e GITHUB.USER_TOKEN= codiumai/pr-agent@sha256:71b5ee15df59c745d352d84752d01561ba64b6d51327f97d46152f0c58a5f678 --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 1. Clone this repository: @@ -115,7 +107,7 @@ python3 -m pr_agent.cli --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: ``` \ No newline at end of file From 13c6ed9098548fc063967f1c2d602bb09215a517 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 14 Oct 2024 10:27:52 +0300 Subject: [PATCH 2/3] docs: update installation instructions for GitHub Enterprise Server in pr_agent_pro.md --- docs/docs/installation/pr_agent_pro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/installation/pr_agent_pro.md b/docs/docs/installation/pr_agent_pro.md index 850c1851..2ca914eb 100644 --- a/docs/docs/installation/pr_agent_pro.md +++ b/docs/docs/installation/pr_agent_pro.md @@ -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. ## 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 using 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) From fb85cb721a9b4f6c6882e9c104462841a67dffcd Mon Sep 17 00:00:00 2001 From: mrT23 Date: Mon, 14 Oct 2024 10:31:06 +0300 Subject: [PATCH 3/3] docs: fix typo in installation instructions for GitHub Enterprise Server in pr_agent_pro.md --- docs/docs/installation/pr_agent_pro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/installation/pr_agent_pro.md b/docs/docs/installation/pr_agent_pro.md index 2ca914eb..0fe870e7 100644 --- a/docs/docs/installation/pr_agent_pro.md +++ b/docs/docs/installation/pr_agent_pro.md @@ -18,7 +18,7 @@ Beyond this limit, Qodo Merge Pro will cease to respond to their inquiries unles ## Install Qodo Merge Pro for GitHub Enterprise Server -To using 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. +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)