by Phil Miller
Lately here at Korbit, we’ve written quite a bit about the importance of, tooling for, and ways to improve, code review. This is no accident. We believe in it as a critical inflection point for engineering organizations. So much so, that we built an entire product around it. We also believe that Korbit AI Mentor is the easiest way to embed modern AI tooling into your software development workflow. Think of it like your own on-demand senior engineer.
And like any productive engineer on your team, they are there to support the rest of the team and help them grow. All while helping to deliver software more quickly, and with better quality. This is why an AI mentor that joins existing processes is such an easy upgrade: from day one they can add value with minimal training, and with minimal disruption to the team. They live in the GitHub PRs that are already second nature to your team and they evolve as your team (and your codebase) grows.
Starting with a good foundation
Previously, we went over how to do better code reviews in general. Let’s look at a few GitHub specific things to make them even better.
Effective descriptions using markdown (and more!)
We could (and probably should!) write an entire guide to effective markdown on GitHub. For now, let’s go over a few must-haves for writing effective descriptions outside of the more obvious standard markdown you’re all familiar with.
- Task lists - These are especially useful if your PR is a draft. It gives reviewers a key indication of what’s left to be done so they can adjust feedback accordingly
- Assets - Did you know you can drag and drop files into your description? It’s the perfect way to share a screenshot of the UI that was implemented, or perhaps to ask for feedback.
- Mentions - @somebody (or @someteam) and let them know you value their input
- References - type # and bring up a list of suggested issues or PRs!
- Alerts - for when you really need to flag something as important ⚠ or dangerous 💀
Suggested Reviewers / Code owners
When you create a PR, GitHub will use `git blame` data to try and suggest reviewers for you. This can be useful if you’re new or you’re just struggling to remember who might be a good person to tag.
Another, more structured, approach is to use code owners. This allows you to create a file which defines rules for who will automatically receive a request for review when a PR is created. Like mentions, you can tag individuals or teams and it can be configured by branch, filetype, directory, or globally.
Suggested changes, Requested changes
And when it comes time for one of those reviewers to enter their feedback, one excellent way to do that is via suggested changes. This allows them to suggest (ideally) small changes which the code author can either commit individually or in a batch. This workflow has the advantage of crediting all the folks who contributed to the PR, which will also make git blames more accurate.
Another topic that warrants its own in-depth future article is continuous integration (CI) as it relates to pull requests. In the case of GitHub, these could be things like suites of tests (e.g. unit tests) or static-analysis tools (e.g. linting) that run via GitHub Actions. These checks are typically a type of gate which prevent a PR from being merged and would also represent a gate for reviewer’s approval.
The future of PRs with Korbit AI Mentor
Building on the strong foundation of all of the above, Korbit AI Mentor allows you to take even more off the plates of your most in-demand engineers.
Our AI Mentor will detect issues on every PR. This includes things like critical bugs, performance optimizations, security vulnerabilities, and deviation from your internal coding standards. Conversation happens in the PR, always in context. The AI Mentor will explain issues and provide proposed replacement code. It will also provide links to live coding exercises to help upskill your engineers and prevent recurrence of the issue at hand.
Unlike other “just-in-time” AI tools, Korbit AI Mentor has persistent context. It will improve over time and you can fine tune the types of issues it surfaces via muting and filtering. You can also globally exclude files and directories using a `.korbitignore` file in your repo.
In addition to automated review of every PR, you can do manual scans of your repositories. This can be accomplished via your Mentor Dashboard or via our CLI tool. These can be for the entire repo (all files) or a specific branch (recently changed files). The CLI also allows easy integration with your CI/CD (like GitHub Actions!).
As our AI Mentor becomes a fully integrated part of your engineering organization, it will provide you with valuable insights about team and organizational health. Track issues and scans, and see key metrics for all of your engineers. This is a valuable tool for project planning, scheduling, and budgeting. Instead of guessing, you can now make more informed decisions and work on what’s most important.
Working hand in hand with AI
AI tools like Korbit AI Mentor will only become more and more integrated with engineering culture and processes. The important thing here is balancing human expertise with AI mentorship. These tools exist to make your engineers more productive, not to replace them. It is crucial to your operational success that your engineers are well trained in how to work with AI, especially early career engineers. The better you can fine tune your AI tools to your unique needs, the more productive they (and you) will be.
If you’re using GitHub today and you would like an on-demand AI Mentor that will make your engineering organization more productive, provide continuous learning, valuable insights, and grow with your team you owe it to yourself to give Korbit AI Mentor a try. Then please let us know what you think, we value your input!
Previous article on accelerating your team's code reviews with Korbit.