From 7b98db20d5b9a26f8d9b0cbef6fa5450c8c2860e Mon Sep 17 00:00:00 2001 From: Jeff Fouchard Date: Tue, 20 Feb 2024 08:24:43 -0500 Subject: [PATCH 1/2] Add a note about change the target for Gitlab install This is just a minor documentation update about changing the target when building the Docker image for Gitlab. While it's obvious in retrospect, if you jump straight to the Gitlab section of the document how this is supposed to work. If you follow the directions exactly you run into [this issue](https://github.com/Codium-ai/pr-agent/issues/456) --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 9730f6a9..f6185e9c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -387,14 +387,14 @@ PYTHONPATH="/PATH/TO/PROJECTS/pr-agent" python pr_agent/cli.py \ ``` WEBHOOK_SECRET=$(python -c "import secrets; print(secrets.token_hex(10))") ``` -3. Follow the instructions to build the Docker image, setup a secrets file and deploy on your own server from [Method 5](#run-as-a-github-app) steps 4-7. +3. Follow the instructions to build the Docker image, setup a secrets file and deploy on your own server from [Method 5](#run-as-a-github-app) steps 4-7. Be sure to set the target to `gitlab_webhook` instead of `github_app` when building the Docker image. 4. In the secrets file, fill in the following: - Your OpenAI key. - In the [gitlab] section, fill in personal_access_token and shared_secret. The access token can be a personal access token, or a group or project access token. - Set deployment_type to 'gitlab' in [configuration.toml](./pr_agent/settings/configuration.toml) 5. Create a webhook in GitLab. Set the URL to the URL of your app's server. Set the secret token to the generated secret from step 2. In the "Trigger" section, check the ‘comments’ and ‘merge request events’ boxes. -6. Test your installation by opening a merge request or commenting or a merge request using one of CodiumAI's commands. +6. Test your installation by opening a merge request or commenting on a merge request using one of CodiumAI's commands. From 1348a67cd21354fd79048bbcc11a60814fc28065 Mon Sep 17 00:00:00 2001 From: Jeff Fouchard Date: Tue, 20 Feb 2024 08:33:34 -0500 Subject: [PATCH 2/2] Add more detail to the pr-agent url --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index f6185e9c..cc51aa4a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -392,7 +392,7 @@ WEBHOOK_SECRET=$(python -c "import secrets; print(secrets.token_hex(10))") - Your OpenAI key. - In the [gitlab] section, fill in personal_access_token and shared_secret. The access token can be a personal access token, or a group or project access token. - Set deployment_type to 'gitlab' in [configuration.toml](./pr_agent/settings/configuration.toml) -5. Create a webhook in GitLab. Set the URL to the URL of your app's server. Set the secret token to the generated secret from step 2. +5. Create a webhook in GitLab. Set the URL to the URL of your app's server with the path `/webhook` (e.g. `http://pr-agent.example.com:3000/webhook`). Set the secret token to the generated secret from step 2. In the "Trigger" section, check the ‘comments’ and ‘merge request events’ boxes. 6. Test your installation by opening a merge request or commenting on a merge request using one of CodiumAI's commands.