Azure Pipelines GPT Pull Request Review TaskThe Azure Pipelines feature for reviewing Pull Requests with GPT involves leveraging OpenAI's GPT model to examine Pull Requests and deliver feedback via comments directly within the Pull Request. Setup InstructionsBefore setting it up, make sure the build service can add to Pull Requests in your repository. Also, set up the task to let it use the system token. Allow the build service agent to have permissionsGrant Task Access to System TokenTo enable this feature, choose the appropriate method based on your pipeline type: For YAML Pipelines:Include a checkout section in your YAML file and ensure persistCredentials is enabled by setting it to true.
For Classic Pipelines:Turn on "Allow scripts to access the OAuth token" by selecting it within the "Agent job" settings. Using Azure Open AI ServiceTo integrate the Azure Open AI service, input the endpoint and API key details for Azure OpenAI. The endpoint should be formatted as: https://{XXXXXXXX}.openai.azure.com/openai/deployments/{MODEL_NAME}/chat/completions?api-version={API_VERSION} Choosing OpenAI ModelsIf not utilizing Azure's Open AI Service, select from the available models: "gpt-4", "gpt-3.5-turbo", or "gpt-3.5-turbo-16k". By default, "gpt-3.5-turbo" is selected if no model is specified. Installation and UsageInstall the extensionFirst, add the extension to your Azure DevOps organization by clicking "Get it free" and follow the steps for installation. You might need to allow the extension access to your Azure DevOps account. Add the Task to Your PipelinePost-installation, include the task in your build pipeline by clicking the "+" icon, search for "Review PullRequest by GPT", select, and add it. Task ConfigurationAfter adding the task, set it up by providing your OpenAI API key. Create an API key at https://platform.openai.com/account/api-keys. Reviewing Pull RequestsThe task reviews Pull Requests when the build is triggered by one. It comments on the Pull Request with any feedback. The task is skipped if the build is manually triggered. CompatibilityThe task is compatible with Linux and MacOS build agents. |