diff --git a/Usage.md b/Usage.md index 75504b13..4ec84567 100644 --- a/Usage.md +++ b/Usage.md @@ -441,3 +441,16 @@ And use the following settings (you have to replace the values) in .secrets.toml org = "https://dev.azure.com/YOUR_ORGANIZATION/" pat = "YOUR_PAT_TOKEN" ``` + +##### Azure DevOps webhook +To allow triggering from azure webhook, you need to manually [add webhook](https://learn.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops) +of type "Pull request created" to trigger a review, or "Pull request commented on" to trigger any supported comment with / comment on the relevant PR. +note the for "Pull request commented on" trigger, only API v2.0 is supported. + +To use webhook security, you need to configure webhook user name and password, both on the server and azure devops webhook. +These will be sent as basic Auth data by thewebhook with each request: +``` +[azuredevops_server] +webhook_username = "" +webhook_password = "" +``` \ No newline at end of file diff --git a/pr_agent/servers/azuredevops_server_webhook.py b/pr_agent/servers/azuredevops_server_webhook.py index 58683e28..9bcc35e4 100644 --- a/pr_agent/servers/azuredevops_server_webhook.py +++ b/pr_agent/servers/azuredevops_server_webhook.py @@ -23,7 +23,7 @@ import base64 router = APIRouter() available_commands_rgx = re.compile(r"^\/(" + "|".join(command2class.keys()) + r")\s*") -azuredevops_server = get_settings().get("azure_devops") +azuredevops_server = get_settings().get("azure_devops_server") WEBHOOK_USERNAME = azuredevops_server.get("webhook_username") WEBHOOK_PASSWORD = azuredevops_server.get("webhook_password") diff --git a/pr_agent/settings/.secrets_template.toml b/pr_agent/settings/.secrets_template.toml index e398db4a..b5ce13b6 100644 --- a/pr_agent/settings/.secrets_template.toml +++ b/pr_agent/settings/.secrets_template.toml @@ -77,7 +77,7 @@ base_url = "" [litellm] LITELLM_TOKEN = "" # see https://docs.litellm.ai/docs/debugging/hosted_debugging for details and instructions on how to get a token -[azuredevops_server] +[azure_devops_server] # For Azure devops Server basic auth - configured in the webhook creation # Optional, uncomment if you want to use Azure devops webhooks. Value assinged when you create the webhook # webhook_username = ""