< All articles

How to use CodeRabbit to validate issues against Linear Board

Aravind Putrevu - September 04, 2024

Cover image for article: How to use CodeRabbit to validate issues against Linear Board

CodeRabbit is an AI code review tool that integrates with version control platforms like GitHub, GitLab, and Azure DevOps.

It automatically analyzes pull requests, providing comprehensive reviews powered by Large Language Models (LLM). CodeRabbit offers detailed feedback, flags potential issues, and suggests code improvements. Teams can customize CodeRabbit's behavior through an intuitive UI or YAML configuration files, allowing it to adapt to specific project requirements and coding standards.

But, do you know that CodeRabbit could also connect with your Issue Tracking or Project management tools like Linear and Jira to perform issue validation, performing a context-aware Pull-request review.

This blog post covers CodeRabbit's feature that analyzes the issues linked to pull requests and checks whether the code changes effectively resolve linked issues. Whether you're using GitHub, Jira or Linear for issue tracking, CodeRabbit integrates with both.

Before we explore Linear integration, if you're new to CodeRabbit, we suggest checking this blog. It explains how CodeRabbit performs code reviews for pull requests. This background will help you better understand the context of Linear integration.

Setting up Linear Integration

Head on to the Integrations section in CodeRabbit and flip the Linear button ON. You've now started the integration process.

Image from article

Once you've enabled the integration, you'll need to authorize CodeRabbit to access your Linear workspace. The process differs slightly depending on whether you're a new or existing Linear user. If you're already using Linear, simply authorize it for your workspace.

New to Linear? just follow the setup prompts to get everything configured.

Image from article

With these two straightforward steps, you've successfully integrated CodeRabbit with Linear. This connection allows CodeRabbit to access your entire Linear workspace and provides context-aware code reviews for your pull requests.

If you need to limit CodeRabbit's access to specific Linear projects, you can do it by three ways.

Organization Settings

Navigate to Organization Settings -> Configuration -> Knowledge Base -> Linear Team Keys section and enter the project keys of the Linear projects you want CodeRabbit to access. By doing this, you ensure that CodeRabbit only uses issue context from the projects you've specified, keeping other project data off-limits.

Image from article

Repository Settings

Navigate to Repository Settings -> Knowledge Base -> Linear Team Keys section and enter the project keys of the Linear projects you want CodeRabbit to access.

YAML Configuration

If you're using YAML configuration (.coderabbit.yaml), you can also specify Linear team keys in the section shown below

linear:

team_keys:

Note:1. Each setting individually gets applied. It is YAML > Repository > Organization.2. We're assuming you've already connected GitHub and Linear, allowing you to manage GitHub issues through Linear.

On that note, if you haven't set up your GitHub and Linear integration yet, just head over to your Linear workspace settings. Click on 'Integrations', then 'GitHub'. From there, you'll see options to connect your GitHub account, link your organization, and select which repositories you want to sync with Linear.

Once you are done with repository sync with Linear, your issues will sync between GitHub and Linear automatically. Create an issue in either place, and it'll show up in both.

Context-aware PR Review using CodeRabbit’s Issue Validation

CodeRabbit starts by identifying the issue linked to the Pull Request. It then analyzes the code changes in detail and evaluates whether these changes effectively address the linked issue, ensuring the intended problem is actually solved. The image below demonstrates how CodeRabbit provides its analysis, showing whether the Pull Request successfully addresses the linked issue. This assessment helps developers and reviewers quickly understand if the code changes align with the issue's requirements.

In the below PR, CodeRabbit's analysis process begins by identifying the linked issue #9220, which aims to remove legacy README.md handling in programming exercises. It then examines the pull request's code changes across multiple files, focusing on modifications that treat README.md like any other file in the online code editor.

CodeRabbit concludes that the pull request effectively addresses the linked issue, as indicated by the green checkmark in the "Assessment against linked issues" section. This demonstrates CodeRabbit's ability to validate whether code changes truly resolve the intended issues, in this case, updating the handling of README.md files in the programming exercise system.

Image from article

You can also interact with CodeRabbit through chat to verify if a pull request fully addresses its linked issue, helping you make informed decisions about merging.

Image from article

Hope this guide has clarified how to integrate CodeRabbit with Linear and how CodeRabbit uses the issue context to validate pull requests. By using this integration, you can ensure if pull requests are effectively solving the problems they're meant to address.

Integrate CodeRabbit and let it take care of your PR reviews and issue validation. Start your free trial today!