DEV Community

MRITUNJAY SRIVASTAVA
MRITUNJAY SRIVASTAVA

Posted on

Effortless PR Handling: CodiumAI's PR-Agent for Developers

Developers rely on pull requests (PRs) for vital contributions to projects through code review and integration. However, the PR review process can be time-consuming, often stalling overall development.

Today, the solution lies in AI-powered tools like PR-Agent by CodiumAI, revolutionizing PR reviews and enhancements.

What is Codium AI?

CodiumAI, an open-source provider, offers AI-driven products that simplify developers' lives and boost productivity.

What is PR-Agent?

CodiumAI's PR-Agent, a free open-source tool, streamlines pull request reviews efficiently.

It offers a suite of PR functionalities across various git platforms and supports multiple models (GPT-4, GPT -3.5, Anthropic, Cohere, Llama2). Explore detailed usage in this article.

Installation of PR-Agent

To integrate PR-Agent into GitHub, install CodiumAI PR-Agent.
Pr-Agent marketplace

Since it's free, you won't have to add any banking details or be charged a single penny.
PR-Agent billing

Once PR-Agent is added to Github, it is easy to give access and apply PR-Agent to all repositories or a single repository. Profile Icon -> Settings -> Integrations -> Applications -> CodiumAI PR-Agent
github codium-ai access

Types of Command:

PR-Agent automatically analyzes the pull request and can provide several types of commands:

Explore these commands using this PR.

Generate Custom Labels (/generate_labels)

PR-Agent scans the code base, suggesting labels based on PR code changes. Enable custom labels by creating .pr_agent.toml in the repository. It also be used by /describe and /review commands. By default custom labels feature is false in PR-Agent to enable and config custom labels have to create .pr_agent.toml in the repository

  • Enable the custom labels add enable_custom_labels it will turn off the default label and use custom labels
  • Add custom label add custom_labels."Label name
[config]
enable_custom_labels=true 

[custom_labels."Custom Label Name"]
description = "Description of when AI should suggest this label"

[custom_labels."Custom Label 2"]
description = "Description of when AI should suggest this label 2"
Enter fullscreen mode Exit fullscreen mode

PR-Agent custom labels /generate_labels

Auto Description (/describe)

Auto Description tool automatically generates PR descriptions - title, type, summary, walkthrough, and labels based on PR code changes.

  • PR-Agent will update the title by analyzing the commit message and code

PR-Agent description update PR summary

  • PR-Agent will scan the code changes and add a description.

PR-Agent will add a detailed description

Auto Review (/review)

Auto Review tool provides comprehensive feedback on PR analysis, including the main theme, relevant tests, and security concerns.

  • The review tool will provide a detailed PR Analysis with details like (PR summary, Type Of PR, Relevant test added, code effort, and security concerns...)
  • The review tool will also provide suggestions on how PR is structured and a few points need to be verified for a reviewer

Auto Review (PR Analysis and PR Feedback)

PR Reflection (/reflect_and_review)

PR-Agent asks basic questions via /reflect_and_review and analyzes author-provided answers, enhancing reviewers' and the author can answer these questions using the command /answer. Once an answer is provided by the author PR-Agent will analyze the answer and add the attribute Insights from user's answer in PR-Analysis, it's one of the features that help the reviewer to get more insight into PR.

PR-Agent ask question using /reflect_and_review

PR-Agent answer using /answer

PR-Agent insight from user answer

Question Answering (/ask "...")

The tool answers reviewers' questions based on PR code changes.

PR-Agent /ask

PR-Agent /ask

Code Suggestions (/improve)

PR-Agent gives us a handle /improve to find possible bugs/errors. It will generate and suggest the improved code for the PR code.

PR-Agent /improve

PR-Agent will also provide the different committable suggestions that will be combined into a single compact comment /improve --pr_code_suggestions.summarize=true

PR-Agent /improve

Update Changelog (/update_changelog)

Update Changelog will help to maintain the CHANGELOG.md that keeps track of all the changes that were made in a specific version.

PR-Agent /update_changelog

Conclusion

PR-Agent emerges as a game-changer in the development landscape. This open-source, free tool not only streamlines PR reviews but also redefines efficiency, minimizing manual efforts while maximizing precision.

By leveraging CodiumAI's PR-Agent, developers dive into processes, accelerating productivity and ensuring code quality. Its seamless integration across various git platforms and versatile command options mark a significant leap towards efficient PR handling.

Explore more about Codium AI PR-Agent and unlock a new era of hassle-free PR management.

Top comments (0)