Gemini AI Pull Request review Task for Azure PipelinesThe Gemini AI Pull Request Review Task for Azure Pipelines is designed to use the AI model from Gemini AI to review Pull Requests and provide feedback as comments in the Pull Request. SetupBefore using this task, ensure that the build service has permissions to contribute to Pull Requests in your repository, and allow the task to access the system token. Give permission to the build service agentbefore use this task, make sure that the build service has permissions to contribute to pull requests in your repository Allow Task to access the system tokenDepending on the type of pipeline you are using, follow one of the two steps below: Yaml pipelinesAdd a checkout section with persistCredentials set to true.
Classic editorsEnable the option "Allow scripts to access the OAuth token" in the "Agent job" properties Gemini AI ModelsCurrently only support gemini-2.0-flash, gemini-1.5-flash model Models: https://ai.google.dev/gemini-api/docs/models Rate limits: https://ai.google.dev/gemini-api/docs/rate-limits How to use itInstall the extensionTo use the Gemini AI Pull Request Review Task, first install the extension in your Azure DevOps organization. Click on the "Get it free" button and follow the prompts to install it. You may need to authorize the extension to access your Azure DevOps account. Configure the taskOnce you have added the task to your pipeline, configure it. In the task configuration, provide your API key for Gemini AI API. Review Pull RequestsWhen the build is triggered from a Pull Request, the task will review it. If there is feedback on the changed code, the task will add comments to the Pull Request. If the build is triggered manually, the task will be skipped. Compatible with Linux Build AgentsThe tasks can execute on all supported build agent operating systems including Linux and MacOS. |