Skip to content

Automate PR reviews in Azure DevOps using OpenAI. This bot analyzes code changes, offers suggestions, detects potential bugs, and ensures adherence to coding standards. Streamline code reviews with customizable criteria and natural language feedback, improving code quality and reducing review time.

License

Notifications You must be signed in to change notification settings

justinpitcher/pr-inspection-assistant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull Request Inspection Assistant (PRIA) - OpenAI PR Review Bot for Azure DevOps

Automate pull request (PR) reviews in Azure DevOps using the PR Inspection Assistant (PRIA) and OpenAI. This bot analyzes code changes, offers suggestions, detects potential bugs, and ensures adherence to coding standards. Streamline code reviews with customizable criteria and natural language feedback, improving code quality and reducing review time.

Key Features

  • Automated PR Reviews: Leverage OpenAI to analyze code changes in pull requests.
  • Code Quality Suggestions: Detect potential issues and ensure best practices are followed.
  • Customizable Review Criteria: Tailor the bot to specific code quality metrics.
  • Azure DevOps Integration: Seamlessly integrates with existing DevOps pipelines.
  • Natural Language Feedback: Provides human-readable, actionable feedback.

Use Cases

  • Automate Routine PR Tasks: Speed up the code review process by automating common review tasks.
  • Improve Code Quality: Receive consistent, detailed feedback to enhance code quality.
  • Early Bug Detection: Help developers understand best practices and identify bugs early in the development cycle.

Process

Prerequisites

Getting Started

  1. Install the PRIA DevOps Extension

    Install the PRIA DevOps extension from the Azure DevOps Marketplace.

  2. Create a PRIA Code Review Pipeline

    Create an Azure DevOps Pipeline using the following YAML snippet to set up the PRIA code review task:

    trigger:
      branches:
        exclude:
          - '*'
    
    pr:
      branches:
        include:
          - '*'
    
    jobs:
      - job: CodeReview
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - checkout: self
            persistCredentials: true
          - task: PRIA@1
            inputs:
              api_key: $(OpenAI_ApiKey)
  3. Configure your Main Branch for Build Validation

Cofigure Azure DevOps Build Validation to use PRIA Code Review Pipeline created above as a build validation pipeline.

Build & Publish

  1. Install Prequisites
  2. Run npm install -g typescript to install TypeScript
  3. Run tsc.cmd from .\pr-inspection-assistant\src\ to build the solution
  4. Run tfx extension create --manifest-globs vss-extension.json from .\pr-inspection-assistant\ to package the solution

Resources

About

Automate PR reviews in Azure DevOps using OpenAI. This bot analyzes code changes, offers suggestions, detects potential bugs, and ensures adherence to coding standards. Streamline code reviews with customizable criteria and natural language feedback, improving code quality and reducing review time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%