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: README.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,20 @@
2
2
3
3
## Goal
4
4
5
-
The goal of this exercise is to learn how to use GitHub Copilot, using an exercise that consist of building a REST API using Spring Boot.
5
+
The goal is to create a REST API using Spring Boot and a corresponding Docker image with the help of GitHub Copilot.
6
+
Follow the instructions below and try to use GitHub Copilot as much as possible.
7
+
Try different things and see what GitHub Copilot can do for you, like generating a Dockerfile or a class, add comments, etc.
8
+
9
+
> Make sure GitHub Copilot is configure and enabled for the current laguage, just check the status bar on the bottom right corner of VS Code.
6
10
7
11
## Instructions
8
12
9
13
The `copilot-demo` folder contains the Maven project and Maven installer.
10
14
11
15
-`src` contains `main` and `test`. Where `main` is where the source code lives, and `test` contains the unit tests.
12
16
-`Dockerfile` will be used to create a docker image for the project.
13
-
-`mvnw` is the unix CLI that can be invoked to run the project.
14
-
-`mvnw.cmd` is the Windows CLI that can be invoked to run the project.
17
+
-`mvnw` is the unix CLI that can be invoked to use maven CLI.
18
+
-`mvnw.cmd` is the Windows CLI that can be invoked to use maven CLI.
15
19
16
20
To run Copilot inline on Windows you press `Ctrl + i` (Windows) / `⌘ + i` (Mac)
17
21
@@ -26,7 +30,6 @@ To run the app open a terminal in the `copilot-demo` folder and run:
26
30
```sh
27
31
./mvnw package
28
32
./mvnw spring-boot:run
29
-
30
33
```
31
34
32
35
### Unix Note
@@ -135,7 +138,7 @@ From now on, you will have to create the unit tests for every new operation. Was
135
138
136
139
-**/tellmeajoke**:
137
140
138
-
- Make a call to the joke api and return a random joke - https://api.chucknorris.io/jokes/random
141
+
- Make a call to the joke api and return a random joke - <https://api.chucknorris.io/jokes/random>
139
142
140
143
> **_NOTE:_** Here's example where you might need to use you own knowledge and judgement
141
144
> to validate that Copilot follows best practices. Just because Copilot mimic
@@ -148,7 +151,7 @@ From now on, you will have to create the unit tests for every new operation. Was
148
151
- Make a call to the movie api and return a list of movies of that director
149
152
- Return the full list of movies
150
153
151
-
> **_NOTE:_** This will require to browse to https://www.omdbapi.com/apikey.aspx and request a FREE API Key
154
+
> **_NOTE:_** This will require to browse to <https://www.omdbapi.com/apikey.aspx> and request a FREE API Key
152
155
153
156
-**/parseurl**:
154
157
@@ -186,15 +189,15 @@ Have you been building your Unit Tests along the way? If not this is the perfect
186
189
187
190
We will create automated tests to check that the functionality of the previous endpoints is correctly implemented. The tests should be together in the `CopilotDemoApplicationTests.java` file.
188
191
189
-
You can leverage Copilot to run the tests. There is a /tests command that you can directly run from Copilot Chat or by selecting the piece of code you want to create tests for and using the Copilot inline feature.
192
+
You can leverage Copilot to run the tests. There is a `/tests` command that you can directly run from Copilot Chat or by selecting the piece of code you want to create tests for and using the Copilot inline feature.
190
193
191
194
### Exercise 5: Create a Dockerfile
192
195
193
196
Use the Dockerfile provided to create a docker image of the application. There are some comments in the Dockerfile that will help you to complete the exercise.
194
197
195
198
In order to build, run and test the docker image, you can use Copilot as well to generate the commands.
196
199
197
-
For instance, create a DOCKER.md file where you can store the commands to build, run and test the docker image.
200
+
For instance, create a `DOCKER.md` file where you can store the commands to build, run and test the docker image.
198
201
199
202
Examples of steps to document: Build the container image, Run the container, Test the container.
0 commit comments