You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@ This is a crowdfunding platform for games with a developer theme. The applicatio
13
13
- When adding new functionality, make sure you update the README
14
14
- Make sure all guidance in the Copilot Instructions file is updated with any relevant changes, including to project structure and scripts, and programming guidance
15
15
16
-
### Global language guidance
16
+
### Code formatting requirements
17
17
18
-
-Use type hints for function parameters and return values for all languages which support them
18
+
-When writing Python, you must use type hints for return values and function parameters.
Copy file name to clipboardExpand all lines: docs/0-prereqs.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,11 @@ To create a copy of the repository for the code you'll create an instance from t
14
14
> [!IMPORTANT]
15
15
> If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors for naming the repository.
16
16
17
-
3. If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors. Otherwise, you can create the new repository in an organization where you have access to either GitHub Copilot Pro+ or GitHub Copilot Enterprise.
17
+
3. If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors. Otherwise, you can create the new repository in an organization where you have access to Copilot coding agent and can assign issues to Copilot.
18
18
19
19

20
20
21
-
4. Make a note of the repository path you created (`organization-or-user-name/repository-name`), as you will be referring to this later in the lab.
21
+
4. Make a note of the repository path you created (**organization-or-user-name/repository-name**), as you will be referring to this later in the lab.
Copy file name to clipboardExpand all lines: docs/1-copilot-coding-agent.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ As a result, we want to [be mindful about how we approach assigning tasks to Cop
34
34
35
35
Creating code, regardless of who's involved, typically requires a specific environment and some setup scripts to be run to ensure everything is in a good state. This holds true when assigning tasks to Copilot, which is performing tasks in a similar fashion to a SWE.
36
36
37
-
[Copilot coding agent supports a special workflow][setup-workflow], set in the `.github/workflows/copilot-setup-steps.yml` file, to run before it gets to work. This enables it to have access to the required development tools and dependencies. We pre-configured this ahead of the lab to help the lab flow and allow this learning opportunity. It makes sure that Copilot had access to Python, Node.JS, and the required dependencies for the client and server:
37
+
[Copilot coding agent supports a special workflow][setup-workflow], set in the **.github/workflows/copilot-setup-steps.yml** file, to run before it gets to work. This enables it to have access to the required development tools and dependencies. We pre-configured this ahead of the lab to help the lab flow and allow this learning opportunity. It makes sure that Copilot had access to Python, Node.JS, and the required dependencies for the client and server:
38
38
39
39
```yaml
40
40
name: "Copilot Setup Steps"
@@ -79,8 +79,8 @@ jobs:
79
79
80
80
It looks like any other GitHub workflow file, but it has a few key points:
81
81
82
-
- It contains a single job called `copilot-setup-steps`. This job is executed in GitHub Actions before Copilot starts working on the pull request.
83
-
- We've also added a `workflow_dispatch` trigger, which allows you to run the workflow manually from the Actions tab of your repository. This is useful for testing that the workflow runs successfully instead of waiting for Copilot to run it.
82
+
- It contains a single job called **copilot-setup-steps**. This job is executed in GitHub Actions before Copilot starts working on the pull request.
83
+
- We've also added a **workflow_dispatch** trigger, which allows you to run the workflow manually from the Actions tab of your repository. This is useful for testing that the workflow runs successfully instead of waiting for Copilot to run it.
84
84
85
85
## Improving code documentation
86
86
@@ -109,13 +109,17 @@ While every developer and organization understands the importance of documentati
109
109
110
110
11. Select the **Pull Requests** tab.
111
111
12. Open the newly generated issue, which will be titled something similar to **[WIP]: Code lacks documentation**.
112
-
13. Notice how Copilot has created a todo list.
112
+
13. After a few minutes, you should see that Copilot has created a todo list.
113
113
14. Review the list and the tasks it's going to complete.
114
114
15. Scroll down the pull request timeline, and you should see an update that Copilot has started working on the issue.
> You may need to refresh the window to see the updated indicator.
122
+
119
123
17. Notice that you can scroll through the live session, and how Copilot is solving the problem. That includes exploring the code and understanding the state, how Copilot pauses to think and decide on the appropriate plan and also creating code.
120
124
121
125
This will likely take several minutes. One of the primary goals of Copilot coding agent is to allow it to perform tasks asynchronously, freeing us to focus on other tasks. We're going to take advantage of that very feature by both assigning another task to Copilot coding agent, then turning our attention to writing some code to add features to our application.
@@ -180,7 +184,7 @@ You explored the these concepts:
180
184
- the importance of clearly scoped issues.
181
185
- assigning issues to Copilot.
182
186
183
-
With coding agent working diligently in the background, we can now turn our attention to our next lesson, [using MCP servers to interact with external services][next-lesson].
187
+
With coding agent working diligently in the background, we can now turn our attention to our next lesson, [using MCP servers to interact with external services][next-lesson]. [Copilot coding agent can also use MCP servers][coding-agent-mcp], but we're going to switch back to our Codespace and try use MCP with Copilot agent mode.
184
188
185
189
## Resources
186
190
@@ -194,6 +198,7 @@ With coding agent working diligently in the background, we can now turn our atte
Copy file name to clipboardExpand all lines: docs/2-mcp.md
+26-48Lines changed: 26 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ Once you have the extension installed, you may need to authenticate with your Gi
83
83

84
84
85
85
> [!IMPORTANT]
86
-
> The authors of this lab are not indicating a preference towards one model or another. When building this lab, we used Claude 3.5, and as such are including that in the instructions. The hope is the code suggestions you receive will be relatively consistent to ensure a good experience. However, because LLMs are probabilistic, you may notice the suggestions received differ from what is indicated in the lab. This is perfectly normal and expected.
86
+
> The authors of this lab are not indicating a preference towards one model or another. When building this lab, we used Claude 3.5 Sonnet, and as such are including that in the instructions. The hope is the code suggestions you receive will be relatively consistent to ensure a good experience. However, because LLMs are probabilistic, you may notice the suggestions received differ from what is indicated in the lab. This is perfectly normal and expected.
87
87
88
88
8. The chat pane should update to indicate that you are now in agent mode. You should see a tools icon, showing that we can configure tools for GitHub Copilot to use.
89
89
@@ -100,74 +100,50 @@ The **.vscode/mcp.json** file is used to configure the MCP servers that are avai
The `inputs` section defines the inputs that the MCP server will require. In this case, we are asking for a GitHub Personal Access Token, which is required to authenticate with the GitHub API. The `password` field is set to `true`, which means that the input will be masked when you enter it.
131
-
132
-
> [!IMPORTANT]
133
-
> Make sure that you do not share your GitHub Personal Access Token with anyone, as it provides access to your GitHub account and repositories. Treat it like a password and keep it secure. That means you should not check it into source control or share it with anyone else.
134
-
>
135
-
> Because it is a sensitive password, **DO NOT** paste it into the **mcp.json** file, is an artifact of the source code. Published tokens is the leading cause of security breaches. Instead, you'll securely add it to your codespace in a later step.
112
+
This configuration provides GitHub Copilot access to several additional tools so that it can interact with GitHub repositories, issues, pull requests, and more. This particular configuration uses the [remote GitHub MCP server][remote-github-mcp-server]. By using this approach, we don't need to worry about running the MCP server locally (and the associated management, like keeping it up to date), and we can authenticate to the remote server using OAuth 2.0 instead of a personal access token (PAT).
136
113
137
-
The `servers` section defines the MCP server that you want to use. In this case, we are using the GitHub MCP server, which is run in a Docker container. The `command` field specifies the command to run the MCP server, and the `args` field specifies the arguments to pass to the command. The `env` field specifies the environment variables to set when running the MCP server. The `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable is set to the value of the `github_token` input, which is provided by the user when prompted.
114
+
The MCP server configuration is defined in the **servers** section of the **mcp.json** file. Each MCP server is defined by a unique name (in this case, github) and its type (in this case, **http**). When using local MCP servers, the type may be **stdio** and have a **command** and **args** field to specify how to start the MCP server. You can find out more about the configuration format in the [VS Code documentation][vscode-mcp-config]. In some configurations (not for the remote GitHub MCP server with OAuth), you may also see an **inputs** section. This defines any inputs (like sensitive tokens) that the MCP server may require. You can read more about the configuration properties in the [VS Code documentation][vscode-mcp-config]
138
115
139
-
## Obtain the token
116
+
To utilize an MCP server it needs to be "started". This will allow GitHub Copilot to communicate with the server and perform the tasks you request.
140
117
141
-
In order to interact with GitHub via the MCP server you'll need to have a token. This can either be done by [creating a personal access token (PAT)][github-pat-docs], or (as in our case) using the GitHub token from the codespace. Let's obtain the GitHub token.
118
+
1. Inside VS Code, open **.vscode/mcp.json**.
119
+
2. To start the GitHub MCP server, select **Start** above the GitHub server.
142
120
143
-
1. Open the terminal in your Codespace by selecting <kbd>Ctl</kbd>+<kbd>\`</kbd>.
144
-
2. Run the following command to print the value of the GITHUB_TOKEN environment variable:
121
+

145
122
146
-
```bash
147
-
echo $GITHUB_TOKEN
148
-
```
123
+
3. You should see a popup asking you to authenticate to GitHub.
149
124
150
-
3. Highlight the token and copy it to the clipboard.
125
+

151
126
152
-
## Start the MCP server
127
+
4. Select **Continue** on the user account that you're using for this lab.
153
128
154
-
To utilize an MCP server it needs to be "started". This will allow GitHub Copilot to communicate with the server and perform the tasks you request.
129
+

155
130
156
-
1. Inside VS Code, open **.vscode/mcp.json**.
157
-
2. To start the GitHub MCP server, select **Start** above the GitHub server.
158
-
3. You should see a prompt asking for the GitHub personal access token.
159
-
4. Paste the token you copied previously.
131
+
5. If the page appears, select **Authorize visual-studio-code** to allow the GitHub MCP server to login as your selected user account. Once complete, the page should say "You can now close the window.".
160
132
161
-

133
+

162
134
163
-
> [!IMPORTANT]
164
-
> Do not share your PAT with anyone, as it provides access to your GitHub account and repositories. Treat it like a password and keep it secure. That includes not checking it into source control. **Do not paste it directly into the .vscode/mcp.json file.**
135
+
6. After navigating back to the GitHub Codespace, you should see that the GitHub MCP server has started. You can check this in two places:
136
+
- The line in **.vscode/mcp.json** which previously said start. It should now present several options, and show a number of tools available.
137
+
- Select the tools icon in the Copilot Chat pane to see the tools available. Scroll down the list that appears at the top of the screen, and you should see a list of tools from the GitHub MCP server.
165
138
166
-
5. The GitHub MCP server should start up, and you should now see the number of tools available in the Copilot Chat window increase from 0. This indicates that the AI agent is now able to access the GitHub MCP server and perform actions on your behalf.
139
+

167
140
168
-

141
+
That's it! You can now use Copilot Chat in agentmode to create issues, manage pull requests, and more.
169
142
170
-
6. You can select the tools icon to see the list of available tools that the GitHub MCP server provides. This includes tools for creating and managing repositories, issues, pull requests, and more.
143
+
> [!IMPORTANT]
144
+
> If you have any issues with this MCP server configuration, there are alternate configuration options in the [GitHub MCP server][github-mcp-server] repository using local or remote MCP. If you opt for a configuration that requires authentication via a GitHub Personal Access Token (PAT), make sure that you do not share it with anyone. Treat it like a password and keep it secure. That means you should not check it into source control or share it with anyone else.
145
+
>
146
+
> Because it is a sensitive password, **DO NOT** paste it into the **mcp.json** file. Instead use the **inputs** property to pass the token as an input variable. Published tokens is one of the leading causes of security breaches.
171
147
172
148
## Creating a backlog of tasks
173
149
@@ -267,3 +243,5 @@ Notice that the setup process is similar to the GitHub MCP server, but you do no
0 commit comments