Skip to content

Commit b56c68a

Browse files
GeekTrainerCopilot
andcommitted
Fix 1-hour and full-day workshop content issues
1-hour fixes: - Fix ## HERE line number: 69 → 80 (1-add-endpoint.md) - Fix WS → WSL abbreviation (README.md) - Fix 'prior set' → 'prior step' (0-setup.md) - Fix 'one of models' → 'one of the models' (5-bonus.md) - Fix test command: remove 'as you did previously', add working dir (4-add-feature.md) - Fix absolute link paths to relative (1-add-endpoint.md) - Fix Ctl → Ctrl (1-add-endpoint.md) Full-day fixes: - Fix if __name__ line number: 71 → 82, fix code indent (6-code.md) - Fix 'Mongo DB' → 'SQLite' (3-codespaces.md) - Fix 3 corrupted URLs (5-context.md) - Fix XCode link syntax: parentheses → brackets (5-context.md) - Fix wrong issue title/PR name to match exercise 2 (7-github-flow.md) - Fix 'front-end tests' → 'server unit tests' (7-github-flow.md) - Fix 'virtual server' → 'virtual environment' (6-code.md) - Fix cd server → cd app/server (6-code.md) - Fix Explorer path: 'server' → 'app > server' (4-testing.md) - Fix test_file.py → test_app.py (5-context.md) - Fix 'previously talked about extensions' (8-deployment.md) - Fix Ctl → Ctrl across 6 files - Update actions/checkout@v3 → v4, setup-python@v4 → v5 (4-testing.md) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b278230 commit b56c68a

12 files changed

Lines changed: 35 additions & 35 deletions

content/1-hour/0-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In a few moments a new repository will be created from the template for this wor
3232

3333
With the repository created, it's now time to clone the repository locally. We'll do this from a shell capable of running BASH commands.
3434

35-
1. Copy the URL for the repository you just created in the prior set.
35+
1. Copy the URL for the repository you just created in the prior step.
3636
2. Open your terminal or command shell.
3737
3. Run the following command to clone the repository locally (changing directories to a parent directory as appropriate):
3838

content/1-hour/1-add-endpoint.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It's standard to work in phases when adding functionality to an application. Giv
1313
The application uses a Flask app with SQLAlchemy as the backend API (in the [app/server][server-code] folder), and an Astro app as the frontend (in the [app/client][client-code] folder). You will explore more of the project later; this exercise will focus solely on the Flask application.
1414

1515
> [!NOTE]
16-
> As you begin making changes to the application, there is always a chance a breaking change could be created. If the page stops working, check the terminal window you used previously to start the application for any error messages. You can stop the app by using <kbd>Ctl</kbd>+<kbd>C</kbd>, and restart it by running the script appropriate for your operating system: `./app/scripts/start-app.sh` (macOS / Linux) or `./app/scripts/start-app.ps1` (Windows PowerShell).
16+
> As you begin making changes to the application, there is always a chance a breaking change could be created. If the page stops working, check the terminal window you used previously to start the application for any error messages. You can stop the app by using <kbd>Ctrl</kbd>+<kbd>C</kbd>, and restart it by running the script appropriate for your operating system: `./app/scripts/start-app.sh` (macOS / Linux) or `./app/scripts/start-app.ps1` (Windows PowerShell).
1717
1818
## Flask routes
1919

@@ -34,7 +34,7 @@ Let's build our new route in our Flask backend with the help of code completion.
3434
3535
1. Return to your IDE with the project open.
3636
2. Open **app/server/app.py**.
37-
3. Locate the comment which reads `## HERE`, which should be at line 69.
37+
3. Locate the comment which reads `## HERE`, which should be at line 80.
3838
4. Delete the comment to ensure there isn't any confusion for Copilot, and leave your cursor there.
3939
5. Begin adding the code to create the route to return all breeds from an endpoint of **api/breeds** by typing the following:
4040

@@ -68,7 +68,7 @@ Let's build our new route in our Flask backend with the help of code completion.
6868
> [!IMPORTANT]
6969
> Because LLMs are probabilistic, not deterministic, the exact code generated can vary. The above is a representative example. If your code is different, that's just fine as long as it works!
7070

71-
8. Add a comment to the newly created function. To do this, place your cursor inside the function (anywhere between the lines `def get_breeds...` and `return jsonify...`). Then, press <kbd>Ctl</kbd>+<kbd>I</kbd> (or <kbd>cmd</kbd>+<kbd>I</kbd> on a Mac) to open the editor inline chat. In the input box, type `/doc`. (You can optionally provide additional details, but it's not required). This will prompt GitHub Copilot to generate a documentation comment for the function. The suggested comment will appear inline in the code (highlighted in green). Click **Accept** to apply the comment to your code, or click **Close** to discard the suggestion. You just used a slash command, a shortcut to streamline a task, these commands eliminate the need for verbose prompts.
71+
8. Add a comment to the newly created function. To do this, place your cursor inside the function (anywhere between the lines `def get_breeds...` and `return jsonify...`). Then, press <kbd>Ctrl</kbd>+<kbd>I</kbd> (or <kbd>cmd</kbd>+<kbd>I</kbd> on a Mac) to open the editor inline chat. In the input box, type `/doc`. (You can optionally provide additional details, but it's not required). This will prompt GitHub Copilot to generate a documentation comment for the function. The suggested comment will appear inline in the code (highlighted in green). Click **Accept** to apply the comment to your code, or click **Close** to discard the suggestion. You just used a slash command, a shortcut to streamline a task, these commands eliminate the need for verbose prompts.
7272

7373
9. **Save** the file.
7474

@@ -94,13 +94,13 @@ You've added a new endpoint with the help of GitHub Copilot! You saw how Copilot
9494
|:-----------------------------------|------------------------------------------:|
9595

9696
[breeds-endpoint]: http://localhost:5100/api/breeds
97-
[client-code]: /app/client/
97+
[client-code]: ../../app/client/
9898
[copilot-suggestions]: https://docs.github.com/en/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot
9999
[flask-routing]: https://flask.palletsprojects.com/en/stable/quickstart/#routing
100100
[http-methods]: https://www.w3schools.com/tags/ref_httpmethods.asp
101101
[prompt-crafting]: https://code.visualstudio.com/docs/copilot/prompt-crafting
102102
[inline-chat]: https://code.visualstudio.com/docs/copilot/chat/inline-chat
103-
[server-code]: /app/server/
103+
[server-code]: ../../app/server/
104104
[vscode-copilot]: https://code.visualstudio.com/docs/copilot/ai-powered-suggestions
105105
[walkthrough-previous]: ./0-setup.md
106106
[walkthrough-next]: ./2-explore-project.md

content/1-hour/4-add-feature.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ And
6565

6666
1. 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.
6767
2. Open the page at [http://localhost:4321][tailspin-shelter-website] to see the updates!
68-
3. Run the Python tests by using `python -m unittest` in the terminal as you did previously.
68+
3. Run the Python tests by running `python -m unittest` from the `app/server` directory in the terminal.
6969
4. If any changes are needed, explain the required updates to GitHub Copilot and allow it to generate the new code.
7070

7171
> [!IMPORTANT]

content/1-hour/5-bonus.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In this section, you will use Copilot's agent mode to add themes to the Tailspin
3030
2. Close any tabs you may have open in your IDE to ensure the context for Copilot chat is empty.
3131
3. Select the `+` icon towards the top of Copilot chat to begin a new chat.
3232
4. Select agent mode, by selecting `Agent` (just like you did `Edit` before) in the model selector dropdown at the bottom of the chat window.
33-
5. Select one of models (some may not be available) `Claude 3.7 Sonnet`, `Claude 3.5 Sonnet` or `GPT-4.1 (Preview)`
33+
5. Select one of the models (some may not be available) `Claude 3.7 Sonnet`, `Claude 3.5 Sonnet` or `GPT-4.1 (Preview)`
3434
6. Navigate to the [prompt file](../prompts/fun-add-themes.md) for this task.
3535
7. Copy the content of the prompt
3636
8. Paste the content in the copilot prompt input

content/1-hour/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You will also need the following available and installed locally:
3939
- A shell capable of running BASH commands.
4040

4141
> [!NOTE]
42-
> Linux and macOS are able to run BASH commands without additional configuration. For Windows, you will need either [Windows Subsystem for Linux (WS)][windows-subsystem-linux] or the BASH shell available via [git][git-link].
42+
> Linux and macOS are able to run BASH commands without additional configuration. For Windows, you will need either [Windows Subsystem for Linux (WSL)][windows-subsystem-linux] or the BASH shell available via [git][git-link].
4343
4444
## Getting started
4545

content/full-day/2-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Our project needs two main updates. We want to make the updates to support devel
4949
| Add filters to dog list | Add the code to allow users to filter for dogs by breed and availability |
5050

5151
> [!TIP]
52-
> You can also save an issue by pressing <kbd>Ctl</kbd> - <kbd>Enter</kbd> (or <kbd>Cmd</kbd> - <kbd>Return</kbd> on a Mac) in the title or description fields.
52+
> You can also save an issue by pressing <kbd>Ctrl</kbd> - <kbd>Enter</kbd> (or <kbd>Cmd</kbd> - <kbd>Return</kbd> on a Mac) in the title or description fields.
5353
5454
You've now defined all the issues for the workshop! You'll use these issues to help guide your progress through the workshop.
5555

content/full-day/3-codespaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ You've now defined a custom container!
9999

100100
## Use the newly defined custom container
101101

102-
Whenever someone uses the codespace you defined they'll have an environment with Node.js and Mongo DB, and the GitHub Copilot extension installed. Let's use this container!
102+
Whenever someone uses the codespace you defined they'll have an environment with Node.js and SQLite, and the GitHub Copilot extension installed. Let's use this container!
103103

104104
1. Access the Command Palette (<kbd>F1</kbd> or clicking ☰ → View → Command Palette), then start typing **dev container**.
105105
1. Type **rebuild** and select **Codespaces: Rebuild container**.
@@ -117,7 +117,7 @@ Custom containers for GitHub Codespaces become part of the source code for the r
117117
> [!IMPORTANT]
118118
> For purposes of this exercise we are pushing code updates directly to `main`, our default branch. Normally you would follow the [GitHub flow][github-flow], which we will do in a [later exercise][github-flow-exercise].
119119

120-
1. Open a new terminal window in the codespace by selecting <kbd>Ctl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd> or clicking ☰ → View → Terminal.
120+
1. Open a new terminal window in the codespace by selecting <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>`</kbd> or clicking ☰ → View → Terminal.
121121
2. Find the issue number for defining the codespace by entering the following command:
122122

123123
```bash

content/full-day/4-testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Let's take a look at the tests defined for the project.
2121
> There are only a few tests defined for this project. Many projects will have hundreds or thousands of tests to ensure reliability.
2222
2323
1. Return to your codespace, or reopen it by navigating to your repository and selecting **Code** > **Codespaces** and the name of your codespace.
24-
2. In **Explorer**, navigate to **server** and open **test_app.py**.
24+
2. In **Explorer**, navigate to **app** > **server** and open **test_app.py**.
2525
3. Open GitHub Copilot Chat and ask for an explanation of the file.
2626

2727
> [!NOTE]
@@ -77,10 +77,10 @@ jobs:
7777
runs-on: ubuntu-latest
7878

7979
steps:
80-
- uses: actions/checkout@v3
80+
- uses: actions/checkout@v4
8181

8282
- name: Set up Python
83-
uses: actions/setup-python@v4
83+
uses: actions/setup-python@v5
8484
with:
8585
python-version: '3.10'
8686

@@ -109,7 +109,7 @@ With the workflow created, let's push it to the repository. Typically you would
109109
> [!NOTE]
110110
> All commands are entered using the terminal window in the codespace.
111111
112-
1. Use the open terminal window in your codespace, or open it (if necessary) by pressing <kbd>Ctl</kbd> + <kbd>`</kbd>.
112+
1. Use the open terminal window in your codespace, or open it (if necessary) by pressing <kbd>Ctrl</kbd> + <kbd>`</kbd>.
113113
1. List all issues for the repository by entering the following command in the terminal window:
114114

115115
```bash

content/full-day/5-context.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Before adding new functionality to the website, you want to explore the existing
1111

1212
## Getting started with GitHub Copilot
1313

14-
GitHub Copilot is a cloud-based service offered for both individuals and businesses. As an individual, you can [sign up for a free account][copilot-signup] of the service. After enrolling you will typically install the extension for your IDE, which is available for [Visual Studio][copilot-vs], [Visual Studio Code][copilot-vscode], [NeoVIM][copilot-vim], the [JetBrains IDEs][copilot-jetbrains], [XCode](copilot-xcode) and [Eclipse][copilot-eclipse]. Because we'll be using the [Codespace][walkthrough-codespaces] you defined in the previous exercise, you won't need to manually install the extension - you did that when you configured the dev container!
14+
GitHub Copilot is a cloud-based service offered for both individuals and businesses. As an individual, you can [sign up for a free account][copilot-signup] of the service. After enrolling you will typically install the extension for your IDE, which is available for [Visual Studio][copilot-vs], [Visual Studio Code][copilot-vscode], [NeoVIM][copilot-vim], the [JetBrains IDEs][copilot-jetbrains], [XCode][copilot-xcode] and [Eclipse][copilot-eclipse]. Because we'll be using the [Codespace][walkthrough-codespaces] you defined in the previous exercise, you won't need to manually install the extension - you did that when you configured the dev container!
1515

1616
1. If you don't already have access to GitHub Copilot, [sign up for a free trial][copilot-signup].
1717
2. In the [previous exercise][walkthrough-codespaces] you configured your [devcontainer][devcontainer-docs] to automatically install the extension for GitHub Copilot, so you're all set and ready to go!
@@ -75,7 +75,7 @@ This is an application to allow people to look for dogs to adopt. It is built in
7575
## Backend
7676

7777
- Built using Flask and SQLAlchemy
78-
- All routes require unit tests, which are created in *test_file.py* in the same folder as the file
78+
- All routes require unit tests, which are created in *test_app.py* in the same folder as the file
7979
- When creating tests, always mock database calls
8080

8181
## Frontend
@@ -118,13 +118,13 @@ Congratulations! You've explored context in GitHub Copilot, which is key to gene
118118
[copilot-prompt-files]: https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot?tool=vscode#about-prompt-files
119119
[copilot-personal-instructions]: https://docs.github.com/en/copilot/customizing-copilot/adding-personal-custom-instructions-for-github-copilot
120120
[copilot-signup]: https://github.com/github-copilot/signup
121-
[copilot-vim]: https://github.com/github/copilot.vim#getting-startedins.com/plugin/17718-github-copilot
121+
[copilot-vim]: https://github.com/github/copilot.vim#getting-started
122122
[copilot-vs]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilotvs
123123
[copilot-vscode]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
124124
[copilot-xcode]: https://github.com/github/CopilotForXcode
125-
[devcontainer-docs]: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containersopilot/adding-personal-custom-instructions-for-github-copilot
125+
[devcontainer-docs]: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers
126126
[vscode-copilot-chat]: https://code.visualstudio.com/docs/copilot/copilot-chat
127-
[walkthrough-codespaces]: ./3-codespaces.mdvisualstudio.com/docs/copilot/copilot-chat
127+
[walkthrough-codespaces]: ./3-codespaces.md
128128
[walkthrough-next]: 6-code.md
129129
[walkthrough-previous]: 4-testing.md
130130

content/full-day/6-code.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Let's build our new route in our Flask backend with the help of code completion.
3737

3838
1. Return to your codespace, or reopen it by navigating to your repository and selecting **Code** > **Codespaces** and the name of your codespace.
3939
2. Open **app/server/app.py**.
40-
3. Locate the section of code at the very bottom which launches the server, and put your cursor just above it. This should be line 71, and the code will be:
40+
3. Locate the section of code at the very bottom which launches the server, and put your cursor just above it. This should be line 82, and the code will be:
4141

4242
```python
4343
if __name__ == '__main__':
44-
app.run(debug=True, port=5100) # Port 5100 to avoid macOS conflicts
44+
app.run(debug=True, port=5100) # Port 5100 to avoid macOS conflicts
4545
```
4646

4747
4. Create the route which will call the database to find all breeds, and returns a JSON array with their names and IDs. If you begin typing `@app.route` or add a comment with the requirements like `# Route to get all breeds`, you should notice italicized text generated by GitHub Copilot.
@@ -64,9 +64,9 @@ With the route created, we want to now add the tests to ensure the code is corre
6464
7. Review and validate the code, making any necessary changes. Select **Keep** once you're satisfied.
6565
> [!IMPORTANT]
6666
> 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.
67-
8. Open a terminal window in your codespace or VS Code by selecting <kbd>Ctl</kbd>+<kbd>Shift</kbd>+<kbd>`</kbd>
68-
9. Ensure the virtual server is activated by running the terminal command `source ./venv/bin/activate`
69-
10. Navigate to the **server** folder by running the terminal command `cd server`
67+
8. Open a terminal window in your codespace or VS Code by selecting <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>`</kbd>
68+
9. Ensure the virtual environment is activated by running the terminal command `source ./venv/bin/activate`
69+
10. Navigate to the **app/server** folder by running the terminal command `cd app/server`
7070
11. Run the tests by running the terminal command `python -m unittest`
7171
12. Ensure all tests pass!
7272

0 commit comments

Comments
 (0)