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/contributing/hands-on.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,25 @@ nav_order: 1
7
7
1. TOC
8
8
{:toc}
9
9
10
+
## What is a hands-on?
11
+
12
+
[Lessons accompanying Git-Mastery App](https://nus-cs2103-ay2526s1.github.io/website/se-book-adapted/git-trail/index.html) contains hands-on practicals for students to get 'hands-on' experience of the Git concepts covered by the lesson. Some of those hands-on practicals need to set up a 'sandbox' containing the required folders, files, repos before the student can do the practical. Git-Mastery app can set up that sandbox for students so that they can get to the 'practical' part more easily (we refer to this as 'downloading' the hands-on), without having to set up the sandbox manually. For example, a student can run `gitmastery download <hands-on name>` (e.g., `gitmastery download hp-init-repo`) to set up the sandbox for a specific hands-on practical.
13
+
14
+
Some examples of how Git-Mastery app helps to create the sandbox for a hands-on practical can be seen in [this Git Tour](https://nus-cs2103-ay2526s1.github.io/website/book/gitAndGithub/trail/recordingFolderHistory/index.html) (see T1L3, T1L4).
15
+
10
16
## Before contributing
11
17
12
-
If you are proposing a new hands-on (i.e., not implementing an [already approved hands-on proposal](https://github.com/git-mastery/exercises/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22hands-on%20discussion%22%20label%3A%22help%20wanted%22)) make sure that you have done the following:
18
+
New contributors are recommended to start by implementing an [already approved hands-on proposal]((https://github.com/git-mastery/exercises/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22hands-on%20discussion%22%20label%3A%22help%20wanted%22)).
19
+
20
+
If you are proposing a new hands-on instead, make sure that you have done the following:
13
21
14
22
-[ ] Create an [hands-on discussion](https://github.com/git-mastery/exercises/issues/new?template=hands_on_discussion.yaml)
15
23
-[ ] Obtain approval on the hands-on
16
24
-[ ] File a [remote repository request](https://github.com/git-mastery/exercises/issues/new?template=request_exercise_repository.yaml)
17
25
18
-
## Create a new hands-on
26
+
## Implementing a hands-on
19
27
20
-
Use the provided `new.sh` script to generate the scaffolding for a new exercise:
28
+
First, run the provided `new.sh` script to generate the scaffolding for a new hands-on sandbox:
21
29
22
30
```bash
23
31
./new.sh
@@ -37,17 +45,16 @@ Then, the script will prompt you for:
37
45
38
46
Refer to the [hands-on structure document](/developers/docs/architecture/hands-on-structure) for more information about the folder structure generated.
39
47
40
-
## Download setup
41
48
42
-
Hands-on downloads are all single-file stored in `hands_on/`. The `<handson name>.py` contains the instructions to setup the local repository.
49
+
Each hands-on is implemented as a singlefile `hands_on/<hands-on name>.py`, containing the instructions to set up the hands-on sandbox .
43
50
44
51
{: .reference }
45
52
46
-
For more information about how Git-Mastery downloads hands-on, refer to the [Download Workflow](/developers/docs/architecture/download-workflow)
53
+
For more information about how Git-Mastery downloads a hands-on, refer to the [Download Workflow](/developers/docs/architecture/download-workflow)
47
54
48
55
{: .note }
49
56
50
-
> `exercises` comes with a set of utility functions in the `exercise_utils` module that are made available during the download flow. They provide simple wrappers around common functionality such as `exercise_utils.cli.run_command` to invoke any command and `exercise_utils.file.create_or_update_file` to create or update a given file.
57
+
> `exercises`repo comes with a set of utility functions in the `exercise_utils` module that are made available during the download flow. They provide simple wrappers around common functionality such as `exercise_utils.cli.run_command` to invoke any command and `exercise_utils.file.create_or_update_file` to create or update a given file.
51
58
>
52
59
> For the full list of utility functions, refer [here](/developers/docs/tooling/exercise-utils).
53
60
@@ -57,26 +64,26 @@ These are some references for download setups for other exercises:
1. Any operations should use OSagnostic options (e.g. opting to use `shutil.rmtree` over `run_command(["rm"])`)
63
-
2. For any commands that require `gh` (Github CLI), make sure that the `__requires_github__` variable in the download setup is set to `True` so that the app will automatically check that the student has correctly setup Github CLI
69
+
1. Any operations should use OS-agnostic options (e.g. opting to use `shutil.rmtree` over `run_command(["rm"])`)
70
+
2. For any commands that require `gh` (GitHub CLI), make sure that the `__requires_github__` variable in the download setup is set to `True` so that the app will automatically check that the student has correctly setup Github CLI
64
71
65
72
### Testing downloads
66
73
67
74
To test that your download script works, we have provided a script to simulate the download process in this repository for you to verify.
68
75
69
76
```bash
70
-
./test-download.sh <your hands-on name>
77
+
./test-download.sh <hands-on name>
71
78
```
72
79
73
-
You can find the downloaded repository under the `test-downloads/` folder.
80
+
You can find the sandbox created by the script under the `test-downloads/` folder. Check it manually to verify it is as expected.
74
81
75
82
## Submitting the hands-on for review
76
83
77
84
Create a pull request from your fork using the provided pull request template.
0 commit comments