From aa18d532cf1af7b36c049e10242c340cf53542a6 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Tue, 8 Jul 2025 18:01:37 +0530 Subject: [PATCH] docs: improve installation for various providers --- docs/docs/installation/azure.md | 4 ++-- docs/docs/installation/bitbucket.md | 4 ++-- docs/docs/installation/gitea.md | 11 +++++------ docs/docs/installation/gitlab.md | 4 ++-- docs/docs/installation/locally.md | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/docs/installation/azure.md b/docs/docs/installation/azure.md index 9586cb5b..c90f9a69 100644 --- a/docs/docs/installation/azure.md +++ b/docs/docs/installation/azure.md @@ -1,7 +1,7 @@ ## Azure DevOps Pipeline You can use a pre-built Action Docker image to run PR-Agent as an Azure devops pipeline. -add the following file to your repository under `azure-pipelines.yml`: +Add the following file to your repository under `azure-pipelines.yml`: ```yaml # Opt out of CI triggers @@ -71,7 +71,7 @@ git_provider="azure" ``` Azure DevOps provider supports [PAT token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) or [DefaultAzureCredential](https://learn.microsoft.com/en-us/azure/developer/python/sdk/authentication-overview#authentication-in-server-environments) authentication. -PAT is faster to create, but has build in expiration date, and will use the user identity for API calls. +PAT is faster to create, but has built-in expiration date, and will use the user identity for API calls. Using DefaultAzureCredential you can use managed identity or Service principle, which are more secure and will create separate ADO user identity (via AAD) to the agent. If PAT was chosen, you can assign the value in .secrets.toml. diff --git a/docs/docs/installation/bitbucket.md b/docs/docs/installation/bitbucket.md index 51eae8af..776f27dc 100644 --- a/docs/docs/installation/bitbucket.md +++ b/docs/docs/installation/bitbucket.md @@ -50,7 +50,7 @@ git_provider="bitbucket_server" and pass the Pull request URL: ```shell -python cli.py --pr_url https://git.onpreminstanceofbitbucket.com/projects/PROJECT/repos/REPO/pull-requests/1 review +python cli.py --pr_url https://git.on-prem-instance-of-bitbucket.com/projects/PROJECT/repos/REPO/pull-requests/1 review ``` ### Run it as service @@ -63,6 +63,6 @@ docker push codiumai/pr-agent:bitbucket_server_webhook # Push to your Docker re ``` Navigate to `Projects` or `Repositories`, `Settings`, `Webhooks`, `Create Webhook`. -Fill the name and URL, Authentication None select the Pull Request Opened checkbox to receive that event as webhook. +Fill in the name and URL. For Authentication, select 'None'. Select the 'Pull Request Opened' checkbox to receive that event as a webhook. The URL should end with `/webhook`, for example: https://domain.com/webhook diff --git a/docs/docs/installation/gitea.md b/docs/docs/installation/gitea.md index 4f0bb5fc..ce60304e 100644 --- a/docs/docs/installation/gitea.md +++ b/docs/docs/installation/gitea.md @@ -17,12 +17,11 @@ git clone https://github.com/qodo-ai/pr-agent.git ``` 5. Prepare variables and secrets. Skip this step if you plan on setting these as environment variables when running the agent: -1. In the configuration file/variables: - - Set `config.git_provider` to "gitea" - -2. In the secrets file/variables: - - Set your AI model key in the respective section - - In the [Gitea] section, set `personal_access_token` (with token from step 2) and `webhook_secret` (with secret from step 3) + - In the configuration file/variables: + - Set `config.git_provider` to "gitea" + - In the secrets file/variables: + - Set your AI model key in the respective section + - In the [Gitea] section, set `personal_access_token` (with token from step 2) and `webhook_secret` (with secret from step 3) 6. Build a Docker image for the app and optionally push it to a Docker repository. We'll use Dockerhub as an example: diff --git a/docs/docs/installation/gitlab.md b/docs/docs/installation/gitlab.md index 9fa0291d..7e587617 100644 --- a/docs/docs/installation/gitlab.md +++ b/docs/docs/installation/gitlab.md @@ -46,7 +46,7 @@ Note that if your base branches are not protected, don't set the variables as `p 1. In GitLab create a new user and give it "Reporter" role ("Developer" if using Pro version of the agent) for the intended group or project. -2. For the user from step 1. generate a `personal_access_token` with `api` access. +2. For the user from step 1, generate a `personal_access_token` with `api` access. 3. Generate a random secret for your app, and save it for later (`shared_secret`). For example, you can use: @@ -111,7 +111,7 @@ For example: `GITLAB.PERSONAL_ACCESS_TOKEN` --> `GITLAB__PERSONAL_ACCESS_TOKEN` 4. Create a lambda function that uses the uploaded image. Set the lambda timeout to be at least 3m. 5. Configure the lambda function to have a Function URL. 6. In the environment variables of the Lambda function, specify `AZURE_DEVOPS_CACHE_DIR` to a writable location such as /tmp. (see [link](https://github.com/Codium-ai/pr-agent/pull/450#issuecomment-1840242269)) -7. Go back to steps 8-9 of [Run a GitLab webhook server](#run-a-gitlab-webhook-server) with the function url as your Webhook URL. +7. Go back to steps 8-9 of [Run a GitLab webhook server](#run-a-gitlab-webhook-server) with the function URL as your Webhook URL. The Webhook URL would look like `https:///webhook` ### Using AWS Secrets Manager diff --git a/docs/docs/installation/locally.md b/docs/docs/installation/locally.md index 9ceb077b..e002c564 100644 --- a/docs/docs/installation/locally.md +++ b/docs/docs/installation/locally.md @@ -12,7 +12,7 @@ To invoke a tool (for example `review`), you can run PR-Agent directly from the - For GitHub: ```bash - 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.