Skip to content

Commit 331647c

Browse files
committed
Enhance exercise instructions for using GitHub Copilot, including additional notes on Flask routes and terminal commands, and add resource links for better guidance.
1 parent a8ad2b0 commit 331647c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

content/guided-workshop/exercises/6-code.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Let's build our new route in our Flask backend with the help of code completion.
4545
5. Select <kbd>Tab</kbd> to accept the code suggestion.
4646
6. Navigate to [http://localhost:5100/api/breeds](http://localhost:5100/api/breeds) to validate the route.
4747

48+
> [!NOTE]
49+
> As with the prior exercise, we don't provide specific prompts to use with Copilot, as part of the learning experience is to discover how to interact with Copilot. If you are unfamiliar with Flask or how to add routes, you can look at the routes defined above for inspiration, or ask Copilot chat for guidance!
50+
4851
## Generate the unit tests
4952

5053
With the route created, we want to now add the tests to ensure the code is correct. We can use GitHub Copilot chat's slash command **/tests** to create the test for us!
@@ -58,7 +61,7 @@ With the route created, we want to now add the tests to ensure the code is corre
5861
7. Review and validate the code, making any necessary changes. Select **Keep** once you're satisfied.
5962
> [!IMPORTANT]
6063
> GitHub Copilot, like any generative AI solution, can make mistakes. Always review the generated code, making any necessary changes to ensure it's accurate and performs as expected.
61-
8. Open a terminal window in your codespace or VS Code by selecting <kbd>Ctl</kbd> <kbd>`</kbd>
64+
8. Open a terminal window in your codespace or VS Code by selecting <kbd>Ctl</kbd>+<kbd>Shift</kbd>+<kbd>`</kbd>
6265
9. Ensure the virtual server is activated by running the terminal command `source ./venv/bin/activate`
6366
10. Navigate to the **server** folder by running the terminal command `cd server`
6467
11. Run the tests by running the terminal command `python -m unittest`
@@ -68,7 +71,7 @@ With the route created, we want to now add the tests to ensure the code is corre
6871

6972
Adding the filters to the page will require updating a minimum of three files - the Flask backend, the unit tests for our Flask backend, and the Svelte frontend. Fortunately, Copilot Edits can update multiple files! Let's get our page updated with the help of Copilot Edits.
7073

71-
1. Open the following files to help Copilot Chat understand the context we need to use:
74+
1. Open the following files in your IDE (which we'll point Copilot chat to for context):
7275
- **server/app.py**
7376
- **server/test_app.py**
7477
- **client/src/components/DogList.svelte**
@@ -82,12 +85,18 @@ Adding the filters to the page will require updating a minimum of three files -
8285
- Tests should be updated for any changes to the endpoint.
8386
6. Review the code suggestions to ensure they behave the way you expect them to, making any necessary changes. Once you're satisfied, you can select **Keep** on the files individually or in Copilot Chat to accept all changes.
8487
7. Open the page at [http://localhost:4321](http://localhost:4321) to see the updates!
85-
8. Run the Python tests by using `python -m unittest` as you did previously.
88+
8. Run the Python tests by using `python -m unittest` in the terminal as you did previously.
8689
9. If any changes are needed, explain the required updates to GitHub Copilot and allow it to generate the new code.
8790

8891
> [!IMPORTANT]
8992
> Working iteratively a normal aspect of coding with an AI pair programmer. You can always provide more context to ensure Copilot understands, make additional requests, or rephrase your original prompts.
9093

9194
## Summary and next steps
9295

93-
Congratulations! You've worked with GitHub Copilot to add new features to the website - the ability to filter the list of dogs. Let's close out by [creating a pull request with our new functionality](./7-git-flow.md)!
96+
Congratulations! You've worked with GitHub Copilot to add new features to the website - the ability to filter the list of dogs. Let's close out by [creating a pull request with our new functionality](./7-git-flow.md)!
97+
98+
## Resources
99+
100+
- [Asking GitHub Copilot questions in your IDE](https://docs.github.com/en/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide)
101+
- [Copilot Edits](https://code.visualstudio.com/docs/copilot/copilot-edits)
102+
- [Copilot Chat cookbook](https://docs.github.com/en/copilot/copilot-chat-cookbook)

0 commit comments

Comments
 (0)