Intro0:00
So, good morning, everybody.
Good morning.
There we go. My name's Dave Bernason, I'm a Senior DevOps Advocate with GitHub, and I want to talk today about GitHub Copilot and demo a little bit of everything that Copilot is today, because it has the capabilities have grown a lot now over the last 2, 3 years.
So how many of you are using GitHub Copilot today? Okay, looks like half to two-thirds kind of a thing, kind of a ratio or so here. So, yeah, as we get started, we can see GitHub Copilot started out just as generating code in the IDE with Copilot Individual.
Then we launched Copilot Business into GA. Shortly after that, a year and a half ago, I guess that would be, we launched Copilot Chat. So now not only could you ask Copilot to generate code for you, but you could take somebody's existing code.
Maybe they didn't write very good comments in their code. Shocker,right? Say, "Hey Copilot, explain that code to me," or "Help me simplify that code." So many more ways to use GitHub Copilot. And then just this February, we launched GitHub Copilot Enterprise, being able to not only use Copilot in your IDE of choice, but alsoright on GitHub.com itself, have Copilot help you generate pull request summaries, or tap into information that may be stored in your knowledge bases and ask Copilot questions and things like that, and use a lot of the same chat featuresright there.
And I'll also talk about some of the things that we're launchingright now. We've got in beta and technical preview and such. So, as most of you know, GitHub Copilot is there to be your AI pair programmer, help you generate code based on comments and things.
Now, the thing about Copilot Individual and Copilot Business, it lives and runs as extensions in Visual Studio Code, GitHub Codespaces, which is Visual Studio Code running inside the browser. The JetBrains IDEs, like PyCharm and IntelliJ, and Visual Studio.
And a key thing about this is, it doesn't actually matter where your code lives,right? The code hopefully lives on GitHub, GitHub Enterprise Cloud, but the code could live in Bitbucket or Azure DevOps, even in Team Foundation Version Control.
It doesn't even have to be Git-based Version Control, and you can still take advantage of everything that Copilot Business and Copilot Individual have to offer. So, I am going to play through a little video of the basics here, because there's a couple of things I want to point out.
This is just a two-minute video.
Code Generation3:16
Let's see how Copilot can make me a more productive developer. I'm using Django Python, which, like most programming languages and frameworks, is supported by Copilot. Django is a framework for creating line-to-business applications, and the first step is to create my model classes, which is typically tedious.
What I'm going to do instead is describe, using natural language, what I need my model to look like. That gray italicized text is Copilot generating the appropriate code. It creates the class definition and the full class across multiple lines of code.
Copilot is also context-aware. It saw the fact that I created a speaker class, and once again goes, "Well, speakers need to do something," and it generates a talk class forming. That entire class, all of those lines of code, was generated for me automatically by Copilot.
There was one thing I didn't necessarily want here, which is it's allowing for speakers and talks all to be deleted. I want to modify that. So I go back to Copilot, ask it for a new suggestion, and it generates one.
Finally, I want to add on a code for the talk which matches a particular pattern. Normally at this point, I would go running off to Stack Overflow to look up how to write this regular expression. Instead, I describe in natural language what that pattern is supposed to look like, and Copilot generates all of the appropriate code for me.
This allows me to stay in the zone and focus in on the more important aspects of writing code.
Allright, now I know that's a very basic demo, and most of you who are using Copilot have seen it and used it in this way, but still, there's some key things to point out here. It's called GitHub Copilot.
It's not called GitHub Autopilot. This is not going to replace developers. We still need that person in the middle. And there was a great example here of that. When it generated
the talk class, initially it was allowing speakers to be deleted even when talks existed. So he wiped out that line. He continued the conversation with Copilot, added that additional comment to say, "Hey, no, don't allow speakers to be deleted when talks exist."
And then he was able to get exactly what he needed in this case. Now, another thing, there's actually an opportunity here in this, even in this little demo, to talk about prompt crafting or prompt engineering. When he was adding this talk code, he didn't just say, "Add a talk code."
He was more specific,right? He said, "With a format of three letters, a dash, and three numbers." And that allowed him to get back the regular expression that he needed. So part of prompt crafting is that specificity in your comments, in your requests, and things.
Prompt Crafting6:13
But another key element here is he was able to stay in the flow. He didn't have to leave the IDE and go to find some regular expression documentation or do a Google search or anything like that to figure out that syntax.
He got that in a matter of seconds. So you can see, in a second, actually, so you can see just how much this can improve productivity and keep you in the flow and things like that. Now, next, we oh, so here's some at the end, I'll have a link where you can find a lot of these resources and things.
And at some point after this session, I'll put a PDF up there so you've also got all of these links and things. But we've got several resources now to learn about prompt crafting. This is not something where you need a week-long boot camp or anything like that.
Just an hour or two of it'll take less than an hour to understand prompt crafting, but then just kind of playing around with it yourself to get a better feel, how do you get more accurate suggestions for the context that you're in and everything.
Copilot Chat7:43
And then next, we launched GitHub Copilot Chat. So we went from just typing in comments in code to having a chat panelright inside the IDE. So now I can do things like, "Hey, give me an overview of the entire solution.
Help me write automated tests. Explain this code to me. Help me find and fix the bugs in my code and stuff." So let's see a little demo of that.
Copilot is great for giving you code suggestions in line as you type, but there was no way to easily ask questions or provide additional context until now. Copilot Chat lets you have a much richer pair programming experienceright in Visual Studio and Visual Studio Code.
It can suggest tasks based on your code. For example, here I have some code I've inherited with a bunch of regular expressions in it, but it's pretty poorly documented. Let's ask Copilot what they do. Oh, looks like we have validation for email addresses, phone numbers, and strong passwords.
Makes sense. But let's ask for help to make this code a bit more readable for the next person. I'll type, "Make this code more readable." Not bad. But I'd like some more. So let's ask Copilot to separate out the validation functions and add more comments.
Okay, great. That's much better. The code is now in separate functions with the comments, and the variables have much more meaningful names. This is going to be a lot easier to maintain going forward, so let's bring it over.
Now, let's take a look at some code that isn't working and see if Copilot can help me figure out why. I'll ask Copilot to propose a fix for the bugs in my code.
Now, Copilot's determined by looking at my comment and comparing it to the code that I was treating the data as comma-separated in my code, but in my comment, I was saying it was space-separated. It's also noticed from the comment that I was returning the values in a different order, and it's adding some error checking for me that it typically sees with this type of code.
Okay, so let's bring this code over and run it. And yep, that works. Brilliant. While we're here, let's ask Copilot to create us some unit tests so we don't accidentally break this code again. Perfect. Copilot's analyzing the code paths we take in our code and using the context from the comment to generate a set of unit tests for the branches of logic it sees.
It's a great start for us, so we could take this, copy it over into a test function, and then build that out over time. But let me show you one last thing. With chat functionalityright in your editor, it's so much easier to stay focused and on task.
You can ask for help about codingright where you are. You can even have a conversation with Copilot to learn more. Let's ask for an example here. However, we're deliberately constraining the prompt to ensure we only have questions that we detect has an intent around programming.
If we stray outside of this, it will politely decline.
So yeah, while Copilot can help, you're on your own as far as figuring out what's for dinner.
So yeah, you can see there, he was able to have the code explained to him, generate comments for the code, refactor it, debug code, write unit tests for it, all from workingright inside of GitHub Copilot Chat. So we added a lot more capabilities there.
Extensions11:12
Now, we made a pretty big splash at Microsoft Build last month talking about GitHub Copilot extensions. So this brings the world's knowledge into the most widely adopted AI developer tool. And through a growing partner ecosystem, Copilot extensions are going to enable developers to build and deploy to the cloud with natural language with their preferred tools and services.
A lot of third parties out there, MongoDB and
Octopus Deploy and DataStax and lots of others understand that GitHub is the place that developers want to be. So that developers can stay in the flow, now with GitHub extensions, you can access information and things from a lot of these other third-party systems directly from GitHub Copilot Chat.
And so you can see we had an initial set of partners here. And actually, I'm going to play through one of the little demos here. So that link there, and again, this will all be provided at the end, takes you to this blog post where we made the announcement.
And I'm going to play the Octopus Deploy demo.
The Octopus extension for GitHub Copilot allows developers to maintain a state of flow by querying the state of their deployments from the same tools they use to write their code. In this example, we have a Node.js web application.
We will commit and push changes to our Git repository and track those changes through the GitHub Copilot Chat interface. We'll make a small change to the index page, save those changes, and then push those to our repository. Once pushed, the GitHub Actions workflow will trigger a build and initiate a deployment to Octopus Deploy.
We can then track the deployment through the Octopus extension for GitHub Copilot. We can view the high-level status of deployments to all environments with a text-based dashboard.
So you can see he asked there, "Hey, Octopus Deploy, show me the dashboard." And again, without breaking the flow,right inside of GitHub Copilot Chat, he's getting this information to see, "Okay, have the changes been deployed all the way to production yet?"
Let's look at the versions and see, no, the latest version is not yet in production. So getting all of this valuable information without leaving your flow.
Useful items in the deployment logs, like URLs, can be extracted. We can use the comprehension capability.
Actually, in the interest of time, we'll just stop there because there's definitely other things that I want to cover. But yeah, you can see that full demo if you go to GitHub.blog and look for the Copilot extensions blog post.
Knowledge Bases14:14
And we'll have links to that available later. So in February, we launched GitHub Copilot Enterprise. So now, not only are you able to do all of this inside of your IDE, but bringing it to GitHub Enterprise Cloud and adding new capabilities, like building Bing searchright into the chat and everything.
Being able to tap into knowledge bases of information that you have and everything. So for this, I'm actually going to do a live demo if I can find here we go. So here I am on GitHub. Let me reload this.
Get logged in here.
There we go. So I'm on GitHub.com/GitHub, where we have our repositories and everything. And you can see here now, we actually have the chat available to usright inside of GitHub.com. So I can come in here and I can ask general questions.
Let's say I'm starting a new project and I know we want to put feature flags into our solution. So I could say, how do I
whoops, if I type my little shortcutright here, how do I get started with feature flags here at GitHub? Now, if I don't specify that I want to search our knowledge bases, I'm going to get a very generic answer.
Choose a feature flag library. Integrate that library
and such. But now we have the capability to add in your own knowledge bases. So knowledge bases are collections of Markdown files that are storedright inside of your repos themselves. So if I say, "Hey, I want as context to look at the GitHub Engineering documentation," and then I ask that same
ask that same well, yeah, I should have pulled out my other keyboard. This keyboard's a little sticky. Come on now.
There we go. How do I get started using feature flags here at GitHub? Now I'm going to see a different answer with more specifics based on GitHub Engineering's documentation and everything. And actually, this is still somewhat generic, but it is referencing documentation
from our knowledge base. So I'm going to do this again because I typically get a little different answer there.
There we go. Now my shortcut's working.
There we go. This is more what I was hoping to see. So now it's giving me specifics. It's saying, "Hey, we use the Flipper framework here internally." So it's showing me specifics about, here's what I need to actually put in my code to get started with feature flags.
So that's using knowledge bases. Allright, now I'm going to flip over to another environment. This environment uses enterprise-managed users. So let me do a refresh here because I'll have to re-log in. There we go.
So yeah, I have a separate identity under enterprise-managed users because now this is for everything internal. This is a walled garden to ensure that nobody can accidentally take a private repository and make it public and things like that.
So a lot of the security that enterprises are looking for. But in this case, I have this is
parts unlimited website. So if I open up
and if I open up the website, it's a site for selling auto parts,right? And how many recognize parts unlimited?
Anybody ever read the Phoenix Project by Gene Kim? Okay, yeah, parts unlimited was the fictitional company that was in that book. But anyway, yeah, so parts unlimited started out as a brick-and-mortar store in the Washington area. Soright now, sales tax is kind of hard-coded to sales tax for Washington.
But that's not what we want. Now that we're an e-commerce site, we have to be able to calculate sales tax wherever the buyer lives,right? So I'm going to bring up GitHub Copilot Chat here, Enterprise Chat, and ask where
come on, if my keys will cooperate, where in this repo do we have code that calculates sales tax?
So it'll take a moment, but it's looking
so something to notice here is it's saying this repository has been indexed for improved understanding and accuracy. So with GitHub Copilot Enterprise, you go through and pick what repos you want to index for these types of searches. So it's telling me, yes, there's the default shipping tax calculator CS file that includes this calculate tax function.
And I'm actually going oh, come on.
Well, there we go. I'm going to copy calculate tax there. But then it's also showing me who the other callers are of calculate tax. So I get a good picture of how this is working throughout the entire solution or repository.
So we can open that file up and we'll see, okay, here's calculate tax. And yeah, in fact, it is hard-codedright now to certain tax rates. So 7.5% sales tax for the state of Washington. That might even be out of date.
But now I'm going to ask Copilot, this is where kind of like the built-in Bing search comes into play. Are there any public APIs out there that I can use to calculate sales tax in any postal code? So now it's going to come back with
a list of APIs that I could use here.
Free sales tax API, tax APIs, sales tax USA,
Avalara, et cetera. So now I want to leverage GitHub Copilot Enterprise to say, "Hey, what would that calculate tax function look like if I wanted to use, let's say, the Avalara API?" But what I want to do is first kind of set the context for Copilot.
So I'm going to say now, did that paste? Nope, doesn't look like it. See if I can spell itright. Calcu. And see if my keyboard will cooperate.
There we go. Calculate tax. So now I'm telling Copilot, that's the context that I'm talking about. So now I will say, how would I update this code to use
Avalara
API?
Allright, and you can see this is live demo responding in real time. So now if we look here at the differences, I'll kind of try to zoom in here. Yeah, you can see where we were calculating the tax rate here hard-coded.
Now it is showing me how to it's doing the same thing. It's still returning taxable times tax rate and all that. But here it is using that Avalara API and everything instead. Now, another key thing here, if I scroll down and look at some of the additional explanation it gave me, it said, "Hey, there's one possible vulnerability here."
When you're working with an API like that, you're going to have an API key that you have to store. So it's telling me, make sure you do not hard-code that API key in your code. Make sure you store that in HashiCorp Vault or Azure Key Vault or GitHub Secrets or something like that.
So it's helping you with some of those security best practices as well along the way.
Allright, a couple more things and then kind of
about five, six minutes left. So yeah, there's demos out there on YouTube for GitHub Copilot Enterprise and everything also. Oh, yes, so that was the chat in the repository. One other thing I want to show you is
Pull Requests24:31
we have it now so that when we're looking at pull requests so here's an existing pull request. And I was kind of lazy when I first created this pull request. I've got GitHub integrated with Azure Boards. So I referred to the Azure Boards, user stories, and work tasks and stuff that I'm completing as part of this, but I didn't provide any other kind of a description.
Well, now with GitHub Copilot Chat,
I can edit this, and you'll see we have the Copilot icon in here as well. So I could come in here and say, "Hey, Copilot, generate a summary for me." So how many times do developers write nice summaries that anybody could read, getting ready to review the code and everything?
Yeah, not very often. But with Copilot, it's going to look at all the changes that you've made, provide a nice summary paragraph, and then file by file list out all of the changes. There we go. Just took a few seconds.
So now I have a nice summary here. And then you can see, yeah, file by file, it's listing out each change in each file kind of a thing. And it makes it easy for developers then to provide a lot of information and not have to spend a lot of time doing that.
Now, the other thing that you can do here when you're looking at a pull request and we even have more coming with this. Okay, come on, internet. You can do it. There we go. So I can go in and look at one of my changes.
I'm going to skip over this one for the moment. Yeah, let me just look at this change. And I can come in whoops, that's not the word I want. Here we go. You'll see the Copilot icon here too.
Now, this is obviously a very simple change. We're just doing some rebranding of the website here. But if this were more complex, I could say, "Explain," and have Copilot explain the change to me. So yeah, in this case, it's just that simple changing from Fabricam to Contoso.
But if this were more complex, the reviewer can look at this, look back at that user story, and say, "Okay, by looking at the user story, I know what the intent was." Now, does Copilot agree that what's actually implemented matches that intent?
So that's another way to use Copilot Enterprise. So we talked about the chat. We talked about searching the knowledge bases,
pull request summaries, and such. Copilot works with any language. The large language models have been built off of the vast majority of the open-source code that's out there. There's even COBOL code out there. So I found a COBOL repository out there that has COBOL examples in it.
Any Language27:58
So I said, "Hey, what does this code do?" And GitHub Copilot was able to provide an explanation for me, simple Fibonacci sequence. So you could then next prompt and say, "Hey, what would that code look like in Java?
What would that code look like in C# or something?" So use this as a way to modernize your
COBOL and other code. The next one is Copilot Workspace. I ran out of time. I actually don't let's see. Let's go. Allright, let me do this. I'm not sure if there's anybody coming in the roomright away here at 11:15.
Wrap-Up28:30
Let me do this first, just in case there is somebody coming in next. So if you want to take a screenshot of this
URL, we have a page out there that has, I don't know, 15, 20 links to additional training, some of our key blog posts, and things like that that we've recently had. And yeah, this will be dynamic. As more and more things come in, we'll add to that and everything.
Also, yes, we'll be at the GitHub booth where we can answer additional questions and things like that. So yep, I see people moving on. Thank you very much for your time. So yeah, stop by the Microsoft booth and we'll show you Copilot Workspace.





