GitHub Next Logo

AI for Pull Requests

Pull requests are a central part of the GitHub user experience. But they can be frustrating: is the review cycle too long or breaking your flow? Are you suffering from failed Actions? AI for Pull Requests aims to make PRs seamless, low burden and magical.

What's it for?
Make Pull Requests magical.
Who made it?
User Statement
As a
developer contributing or participating in PRs
I want to
have PRs created, completed and repaired quickly and accurately with better flow
I must do it manually and wait for human input at each step
AI for Pull Requests helps by
adding assistive AI into the issue and PR process via PR suggested creations, completions and repairs
human-human interaction and existing bots today

Pull Requests have become a central part of many team's workflows. We love how they let us group changes into a single transactional chunk so they can be communicated, discussed and improved. But they also create overhead. It takes time to put them together, review them and sometimes it's hard to even merge them.

Resolving issues with AI

Someone just filed an issue on your repository: "Replace TensorFlow with PyTorch". Seems like a big job? Maybe you are not sure where to start? We think that AI can help.

We are prototyping functionality to automatically describe how to solve an issue and even to automatically suggest the changes you need to make. In this video we file the issue about moving to PyTorch and use our AI to example how it might be done, to generate code suggestions and raise a new pull request.

Reviewing pull-requests with AI

Considerable amounts of developer time are spent on code review and on preparing a PR for code review. We think that AI can help. In this video we use our AI to describe the changes in the pull request and to review the code. See how it makes actionable suggestions for improvement that you can just click to accept. Maybe this won't replace human reviewers, but we think it can cut down the time spent in the review cycle.

AI-powered PR completion

Some PRs flow almost automatically from one or two lines of edits. Add a comment to a function? AI can “complete the job” and add comments to all your functions, throughout all your code. Change your packages.json from Express to Koa? Today’s AI models can guide you how to adjust your code.

We’re working to empower our AI bot with the capability to complete pull requests given a few indicative edits. We’ve mocked this up in VS Code and are looking to integrate this into our bot and other delivery channels.

AI-generated tests

Fixing a bug is great. Completing a new feature is great. But if you don't add tests to firm up these changes, the bug might soon be back and the feature gone again.

And yet writing tests often feels like a chore, and many PRs don't test the progress they bring to a codebase. "Ok, but please add tests" is a common refrain.

We want to help you with those tests, so new PRs don't increase your project's test debt. Our prototype uses AI to identify the parts of the PR that should be tested, and generate tests that affirm the new functionality added.

AI-powered PR repair

We know the PR process can damage your flow. There is inevitably a delay while you wait for a review, or you wait for Actions to run. And many PRs go back and forth a few times. Each time you switch in and then switch out again is disruptive. We want to know if we can use artificial intelligence to fill in the gaps and reduce the number of switches.

How many times have you submitted a change and forgot to update the unit tests? Or the documentation? Or introduced linter errors. Perhaps we can fix that for you….watch this space!

AI-powered review responses

Is someone nit-picking on your changes? What if we could auto-generate changes in response to their requests to add documentation or even to add another test?