forked from jtr13/cc20
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappendix_pull_request_tutorial.Rmd
More file actions
115 lines (72 loc) · 4.74 KB
/
appendix_pull_request_tutorial.Rmd
File metadata and controls
115 lines (72 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Tutorial for Pull Request Mergers
## Check branch
PR should be submitted from a **non-master** branch.
<img src="resources/tutorial_pull_request_mergers/1.png" width="700">
<br/>
If PR was submitted from the **master** branch, you can link to this explanation of what to do to fix it:
https://edav.info/github#fixing-mistakes.
<br/>
<img src="resources/tutorial_pull_request_mergers/2.png" width="700">
<br/>
## Check `.Rmd` file
### Examine files that were added or modified
<img src="resources/tutorial_pull_request_mergers/files_changed.png" width="700">
<br/><br/>
### Check `.Rmd` filename format
- Each group can only submit ONE `Rmd` file.
- The `.Rmd` file should be in the root directory on the branch.
- Project name should be the same as the root directory name of the branch, and should be words only and joined with underscores, no white space.
- **All letters must be lowercase.**
- No YAML header including the --- line.
- The second line should be blank, followed by your name(s).
- The first line starts with a **single hashtag `#`**, followed by a **single whitespace**, and then the title.
- There should be no additional single hashtag headers in the chapter. (If there are, new chapters will be created.)
- If contributors have included a setup chunk in `.Rmd` file, please notify them to remove the label setup in the chunk.
<br/>i.e. use `{r, include=FALSE}` instead of `{r setup, include=FALSE}`.
<br/>[See sample `.Rmd`](https://github.com/jtr13/cc20/blob/master/sample_project.Rmd)
### Additional checks
- The `.Rmd` file should not contain any `write` functions, `setwd()`, or `getwd()`.
- If there's anything else that looks odd but you're not sure, assign `jtr13` to review and explain the issue.
### Check additional resources
- All of the additional resources should be in the `resources/<project_name>/` folder.
- References to those files must contain `resources/<project_name>/` in the path, such as: ``
### Request a change if `.Rmd` file is invalid
If there is any requirement that a request does not meet, request a change and add reasons why the pull request cannot be merged.
<img src="resources/tutorial_pull_request_mergers/check_format.png" width="700">
<img src="resources/tutorial_pull_request_mergers/request_change_lines.png" width="700">
<img src="resources/tutorial_pull_request_mergers/request_change_files.png" width="700">
<img src="resources/tutorial_pull_request_mergers/request_change_submit_review.png" width="700">
Then, add a `changes requested` label to this pull request.
Your job for this pull request is done for now. Once contributors fix their requests, review again and either move forward with the merge or explain what changes still need to be made.
<br/>
## Update `_bookdown.yml`
### Add files names to `_bookdown.yml` in PR's `branch`
- Access the PR branch:
<img src="resources/tutorial_pull_request_mergers/3.png" width="700">
- Make sure you are on the PR branch by checking that the PR branch name is shown (not `master`):
<img src="resources/tutorial_pull_request_mergers/4.png" width="700">
- Open the `_bookdown.yml` file.
- Add the names of `.Rmd` file after rmd_files.
<br/>i.e. `rmd_files['file1.Rmd','file2.Rmd']`
<img src="resources/tutorial_pull_request_mergers/yml_1.png" width="800">
<br/><br/>
- Save the edited version.
### Add chapter names to `.Rmd` for every first article in each chapter (Chapter Organization)
**If you are a PR pull request helper, you do not need to do this.**
For every first article of each part, add the chapter name on the top of the `.Rmd` file, then propose changes. The example is like this.
<img src="resources/tutorial_pull_request_mergers/chap_1.png" width="800">
<br/><br/>
## Merge `branch` into `jtr13:master` and resolve conflicts
After you finish all the checks and get the qualified files, we can merge the `branch` to `jtr13:master`.
There are two more things we need to do for merging the `branch`.
### Resolve conflicts
<br/>When there are conflicts between files in `jtr13:master` and `branch`, conflicts will occur. The conflicts look like this.
<img src="https://docs.github.com/assets/images/help/pull_requests/view-merge-conflict-with-markers.png" width="700">
<br/><br/>
<br/>Figure source: https://docs.github.com/assets/images/help/pull_requests/view-merge-conflict-with-markers.png
<br/>To resolve the conflicts, you just need to **delete** the lines with `<<<<<<< xxxx`, `=======` and `>>>>>>>> master`.
### Merge PR and leave a comment
Now comes the final step. We go back to the conversation tab of the pull requests page, for example:
https://github.com/jtr13/cc20/pull/23#issuecomment-728506101
Leave comments for congratulations 🎉 (type `:tada:`) and then click on the green button for merge.
<br/>