Fastronome AI Code Review DevOps Extension
Supercharge Your Code Reviews with the OpenAI API
Use your own OpenAI API key to provide pull request code reviews while keeping your code private.
This repository is an MIT-licensed fork published and maintained by Fastronome.
Current maintainer: Alexey Samoylov.
Original project lineage is preserved and attributed in the license section below.
- AI Powered Insights: Optimized for latest LLM models like GPT-4o-mini, which provides optimal high performance with small cost.
- Security and Privacy: Use your own OpenAI API key for reviews
- Automated Summaries: Let AI summarise your pull request so it's easier for humans to follow. AI will also provide feedback for all changes related to bugs, performance, best practices etc.
- Easy to install: A simple one-click installation from the Azure DevOps Marketplace gets you up and running instantly. Configure to your pipeline as shown below.
- Faster Reviews: Reduce the time spent on code reviews. Let Open AI handle the routine, allowing your team to focus on impactful work.
- Configurable and Customizable: Tailor the extension to your needs with customizable settings. Specify the Open AI model, define file exclusions, and more.

Sample review
Click for larger version:

What does it cost?
The extension itself is free. The reviews will utilize your own OpenAI API account, so cost depends on the model you choose. As of today October 2024 the GPT-4o-mini seems to be optimal for this purpose and is cheap to use - today price for input prompt was $0.15 per 1M tokens, output was $0.60 per 1M tokens. While completing many pull requests the price per code review ranges from ~$0.0002 to ~$0.002 per review, so even 1000 PRs per month is still inexpensive.
You can set the token pricing on the task parameters and then you can see from your logs how much each of the reviews cost:

Prerequisites
Getting started
- Install the AI Code Review DevOps Extension from the Azure DevOps Marketplace.
- Add Open AI Code Review Task to Your Pipeline:
trigger:
branches:
exclude:
- '*'
pr:
branches:
include:
- '*'
jobs:
- job: CodeReview
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AICodeReview@1
inputs:
apiKey: $(OpenAIApiKey)
# Optional: override for OpenAI-compatible gateways/providers
# apiBaseUrl: "https://api.openai.com/v1"
aiModel: "gpt-4o-mini"
promptTokensPricePerMillionTokens: "0.15"
completionTokensPricePerMillionTokens: "0.6"
addCostToComments: true
reviewBugs: true
reviewPerformance: true
reviewBestPractices: true
reviewWholeDiffAtOnce: true
maxTokens: 16384
fileExtensions: '.js,.ts,**/*.sql,*.md'
fileExcludes: '**/*.gen.go,**/*.pb.go,secret.txt'
additionalPrompts: |
Fix variable naming, Ensure consistent indentation, Review error handling approach, Check for OWASP best practices
Notes:
apiBaseUrl is optional. Use it only when you need a custom OpenAI-compatible endpoint (proxy, gateway, or provider-specific base URL). Leave it unset for the default OpenAI API.
fileExtensions accepts a comma-separated mix of extensions (for example .ts, .go) and glob patterns (for example **/*.sql, *.md)
fileExcludes accepts a comma-separated mix of exact filenames and glob patterns (for example secret.txt, **/*.gen.go, **/vendor/**)
- If you do not already have Build Validation configured for your branch already add Build validation to your branch policy to trigger the code review when a Pull Request is created
FAQ
Q: What agent job settings are required?
A: Ensure that "Allow scripts to access OAuth token" is enabled as part of the agent job. Follow the documentation for more details.
Q: What permissions are required for Build Administrators?
A: Build Administrators must be given "Contribute to pull requests" access. Check this Stack Overflow answer for guidance on setting up permissions.
Bug Reports
If you find a bug or unexpected behavior, please open a bug report.
Feature Requests
If you have ideas for new features or enhancements, please submit a feature request.
License
This project is licensed under the MIT License.
Fastronome publishes and maintains this fork under the same MIT license terms.
Please retain existing copyright and license notices when redistributing.
If you would like to contribute to the development of this extension, please follow our contribution guidelines.
This repository is based on the work of Tommi Laukkanen's fork,
which was originally forked from a1dancole/OpenAI-Code-Review.