HomeVideos

Using GitHub Copilot for code reviews: from VS Code to github.com

Now Playing

Using GitHub Copilot for code reviews: from VS Code to github.com

Transcript

40 segments

0:00

Here we have a project

0:01

open in Visual Studio Code.

0:03

Some changes have been made

0:04

and we're ready to create a commit.

0:06

But before we create it,

0:08

we're going to ask GitHub Copilot

0:10

to take a look at the code

0:11

for some initial feedback.

0:13

And we can see it has some suggestions on

0:15

how the code can be improved across multiple files.

0:18

Copilot code review catches issues like logic bugs,

0:22

unclear error messages, insecure coding patterns,

0:25

and even deviations from coding guidelines.

0:28

And we can apply changes directly without ever

0:31

leaving the context of our code editor.

0:33

Copilot code reviews are also

0:35

available on github.com.

0:38

Here is the same code we wrote in a newly-opened

0:40

pull request.

0:41

We can assign copilot

0:43

for an initial review

0:44

before asking a team member or maintainer

0:47

to spend their time on it.

0:48

You can also assign

0:49

Copilot automatically on some or all

0:52

new pull requests.

0:53

As a result of the review,

0:55

Copilot will add comments to our pull request.

0:58

As you can see here, there are comments around

1:00

writing more efficient code

1:02

and also around error handling.

1:04

Copilot will also come in with suggestions

1:07

that we can apply in one click

1:09

with the commit suggestion button.

1:11

Copilot can also use your repository’s

1:13

copilot-instructions file to shape

1:16

how it will review.

1:17

When we have responded to the feedback,

1:19

we can re request a review from Copilot

1:21

for the next round of suggestions.

Interactive Summary

This video demonstrates how GitHub Copilot can assist developers by performing automated code reviews both within Visual Studio Code and directly on GitHub pull requests. It highlights features such as identifying bugs and insecure patterns, automated feedback, and the ability to apply suggestions with a single click.

Suggested questions

3 ready-made prompts