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: docs/assignments/hw3-25.md
+37-27Lines changed: 37 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,40 @@
1
-
# Homework 3: Github basics
1
+
# Homework 3: GitHub Basics
2
2
3
3
## Learning goals
4
4
5
-
- Get comfortable with Github if you aren't already
5
+
- Get comfortable with GitHub if you aren't already
6
6
- Think about secure development practices
7
7
- Practice simple code review
8
8
9
9
## Project context
10
10
11
-
You and your team have access to a basic calculator app through Github classroom. Over the next three assignments, you'll (1) set up the repo and merge a few simple PRs (2) deploy the application and set up automated deployments and (3) write tests and create a continuous integration (CI) pipeline. **You should apply the development processes you learn here to your prototype product.**
11
+
You and your team have access to a basic calculator app through GitHub classroom. Over the next three assignments, you'll (1) set up the repo and merge a few simple PRs (2) deploy the application and set up automated deployments and (3) write tests and create a continuous integration (CI) pipeline. **You should apply the development processes you learn here to your prototype product.**
12
12
13
13
## Assignment instructions
14
14
15
15
In this assignment, you'll set up your local development environment, securely configure your repo, make a PR, and review your teammates' PRs.
16
16
17
17
You'll notice that a number of these steps address *security operations*. Why bother with a secure setup? Well, if you actually build a successful company, you (and your software!) become a target. If an attacker can gain write access to your source code, for example, they can insert backdoors that let them hold services ransom, steal user data, or even steal money. This opens you up to a world of legal and financial pain---but luckily, there are really simple things you can do that significantly raise the barrier for attackers. This assignment touches on several of them.
18
18
19
-
### 1. Configure Github with (non-SMS) 2FA
19
+
### 1. Configure GitHub with (non-SMS) 2FA
20
20
21
-
Having a 2FA method makes it vastly harder for attackers to compromise your Github account and impersonate you.
21
+
Having a 2FA method makes it vastly harder for attackers to compromise your GitHub account and impersonate you.
22
22
23
-
Follow [these instructions](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication) to set up two-factor authentication for your Github account. **This 2FA method must not be text message/SMS**. We reccomend [FIDO](https://fidoalliance.org/specs/u2f-specs-master/fido-u2f-overview.html) if possible, and [TOTP](https://datatracker.ietf.org/doc/html/rfc6238) as a backup option.
23
+
Follow [these instructions](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication) to set up two-factor authentication for your GitHub account. **This 2FA method must not be text message/SMS**. We reccomend [FIDO](https://fidoalliance.org/specs/u2f-specs-master/fido-u2f-overview.html) if possible, and [TOTP](https://datatracker.ietf.org/doc/html/rfc6238) as a backup option.
24
24
25
25
#### Turn in instructions
26
26
27
-
When you have done so, navigate to your Github profile; under Settings and Authentication, take a screenshot of the Preferred 2FA Method box that includes both the 2FA method and your username. Do not include anything else in the screenshot (this is possible due to the layout of the page).
27
+
When you have done so, navigate to your GitHub profile; under Settings and Authentication, take a screenshot of the Preferred 2FA Method box that includes both the 2FA method and your username. Do not include anything else in the screenshot (this is possible due to the layout of the page).
28
28
29
-
### 2. Configure Github with SSH
29
+
### 2. Configure GitHub with SSH
30
30
31
-
Using SSH for Github authentication is both more secure and more convenient than using password authentication.
31
+
Using SSH for GitHub authentication is both more secure and more convenient than using password authentication.
32
32
33
-
Follow [these instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) to set up a new SSH key with Github if you haven't already. Specifically, you will:
34
-
-[Generate a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). Make sure to [use a passphrase](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases).
35
-
-[Add the SSH key to your account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).
36
-
-[Test that everything worked](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection).
33
+
Follow [these instructions](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) to set up a new SSH key with GitHub if you haven't already. Specifically, you will:
34
+
35
+
1.[Generate a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). Make sure to [use a passphrase](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases).
36
+
2.[Add the SSH key to your account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).
37
+
3.[Test that everything worked](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/testing-your-ssh-connection).
37
38
38
39
#### Turn in instructions
39
40
@@ -47,13 +48,21 @@ To get ten bonus points, [configure commit signing](https://docs.github.com/en/a
47
48
48
49
Submit a screenshot of your signed commits and your description.
49
50
50
-
### 3. Clone the calculator repo onto your local machine
51
+
### 3. Create your GitHub classroom team.
52
+
53
+
One person on your team should go to this [GitHub Classroom](https://classroom.github.com/a/2g4EHsgQ) link to create your team. Be sure to select all of your team's members. Check to see if your team name already exists in the Software Engineering for Startups organization before creating a new one.
51
54
52
-
When you navigate to the Code tabe, make sure you use the SSH tab, not the HTTPS tab. This will clone the repo using the SSH authentication flow.
55
+
This will create a shared repository for all members of your team. All of the instructors will have admin access to your new repository.
53
56
54
57
**There is no deliverable for this step.**
55
58
56
-
### 4. Configure branch protection
59
+
### 4. Clone the calculator repo onto your local machine
60
+
61
+
When you navigate to the Code tab, make sure you use the SSH tab, not the HTTPS tab. This will clone the repo using the SSH authentication flow.
62
+
63
+
**There is no deliverable for this step.**
64
+
65
+
### 5. Configure branch protection
57
66
58
67
As it stands, anyone with access to your repo can push whatever garbage they want to the main branch. That's not good! It's important to make sure code that actually gets deployed has been thoroughly tested and reviewed (to catch everything from mistakes to intentional back doors!). In this assignment, you'll focus on code review; in a future assignment, you'll block merges to main until your code passes CI.
59
68
@@ -63,7 +72,7 @@ To protect your main branch, navigate to the Settings tab in the calculator repo
63
72
64
73
Take a screenshot of your branch protection rules; we'll also check the repository directly.
65
74
66
-
### 5. Configure pull requests
75
+
### 6. Configure pull requests
67
76
68
77
Your main history is much easier to track if all commits to main are uniform. Different teams have different preferences for this configuration, but in this class, we'll require [squash merging](https://learn.microsoft.com/en-us/azure/devops/repos/git/merging-with-squash?view=azure-devops) for a clean history; this is a very common configuration.
69
78
@@ -73,37 +82,38 @@ Navigate to the General settings. Under Pull requests, uncheck merge commits and
73
82
74
83
Take a screenshot of your repo's PR settings.
75
84
76
-
### 6. Run the calculator app locally
85
+
### 7. Run the calculator app locally
77
86
Follow the instructions in the **README** to set up and run the calculator on your machine. You can choose to deploy the app locally using either Docker or npm, depending on your preference. Ensure everything is working before proceeding with any modifications.
78
87
79
88
**There is no deliverable for this step.**
80
89
81
-
### 7. Add a piece of functionality to the calculator
90
+
### 8. Add a piece of functionality to the calculator
82
91
83
92
You will add a new piece of calculator functionality [*in a new branch*](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging). Then, you will [open a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request?tool=webui) (PR) so that your teammates can review and approve your changes.
84
93
85
-
Choose one of the following functionality: (Coordinate with your teammates to ensure no two members implement the same functionality.)
86
-
1.**Backward Button**: Add a button that allows users to remove the last entered character in the calculator input field.
87
-
2.**Custom Pop-up for Invalid Expressions**: Display a pop-up window when the user enters an invalid expression.
88
-
3.**Brackets Support**: Add "(" and ")" buttons and ensure expressions with brackets are correctly handled.
89
-
4.**Expression History Display**: Show a list of previously calculated expressions in the frontend. The list should reset when the browser is refreshed.
90
-
5.**Backend Logging**: Log all expressions sent to the backend into a local file. The log should persist even after the browser is refreshed.
94
+
Each team member should choose one of the following features. Coordinate with your teammates to ensure no two members implement the same functionality.
95
+
96
+
1.**Backward Button**: Add a button that allows users to remove the last entered character in the calculator input field.
97
+
1.**Custom Pop-up for Invalid Expressions**: Display a pop-up window when the user enters an invalid expression.
98
+
1.**Brackets Support**: Add "(" and ")" buttons and ensure expressions with brackets are correctly handled.
99
+
1.**Expression History Display**: Show a list of previously calculated expressions in the frontend. The list should reset when the browser is refreshed.
100
+
1.**Backend Logging**: Log all expressions sent to the backend into a local file. The log should persist even after the browser is refreshed.
91
101
92
102
Use your PR message to clearly describe the changes you've made to the calculator app.
93
103
94
104
#### Turn in instructions
95
105
96
106
Please provide us a link to your PR.
97
107
98
-
### 8. Review at least two PRs
108
+
### 9. Review at least two PRs
99
109
100
110
Following the best practices we discussed in class, leave two reviews on your teammates' PRs. If there issues, continue to discuss in the comments until you're satisfied with the changes and able to approve the pull requests.
101
111
102
112
#### Turn in instructions
103
113
104
114
Please provide two or more links to your reviews.
105
115
106
-
### 9. Merge your reviewed PR
116
+
### 10. Merge your reviewed PR
107
117
108
118
Finally, once your PR has been approved, [merge it](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request).
0 commit comments