Skip to content

Commit 7e63174

Browse files
MetOffice#45 Add in mermaid diagrams showing various workflows
1 parent d20a432 commit 7e63174

File tree

3 files changed

+117
-4
lines changed

3 files changed

+117
-4
lines changed

episodes/04-review.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@ exercises: 10
2020

2121
In this section we will explore how to properly review
2222
code and suggest changes if necessary.
23+
Both science and code reviews happen in a Pull Request.
24+
The general process is outlined in the diagram below:
25+
26+
```mermaid
27+
sequenceDiagram
28+
accDescr {A sequence diagram showing the process of reviewing.}
29+
autonumber
30+
actor Developer
31+
actor Reviewer
32+
33+
Developer->>Reviewer: Request a reviewer
34+
Reviewer->>Reviewer: #32;
35+
Note over Reviewer: Add the reviewer<br/>to the pull request
36+
Reviewer->>Reviewer: #32;
37+
Note over Reviewer: Perform the review
38+
loop
39+
Reviewer->>Developer: Submit the review
40+
Developer->>Developer: #32;
41+
Note over Developer: Respond to each<br/>review comment
42+
Developer->>Reviewer: Re-request a review
43+
Reviewer->>Reviewer: #32;
44+
Note over Reviewer: Respond to each review<br/>comment response
45+
end
46+
Reviewer->>Developer: Approve the pull request
47+
```
48+
2349
Make sure you know who is in your pair.
2450
Find your colleagues open PR on the `git-training-demo`
2551
repository using the Pull Requests tab

episodes/05-forks.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,60 @@ on your local `main` branch.
278278

279279
:::
280280

281+
## Summary Diagram
282+
283+
The workflow for forking is similar to that for branching.
284+
There are only a few differences after you've set up your fork
285+
for the first time:
286+
287+
- You should open Issues on the upstream repository not your fork.
288+
- After merging in a PR on the upstream repository you need the
289+
added step of syncing your forks `main` branch.
290+
291+
```mermaid
292+
sequenceDiagram
293+
accDescr {A sequence diagram showing the steps for using
294+
Forks with the branching model.}
295+
autonumber
296+
participant UM as upstream main
297+
participant GHM as origin main
298+
participant GHF as origin feature
299+
participant M as main
300+
UM ->> UM: #f
301+
Note over UM: Open an Issue for the change
302+
UM -->> GHM: #f
303+
Note right of UM: First time: Fork the repository
304+
GHM -->> M: #f
305+
Note right of GHM: First time: git clone<br/>Then: git pull
306+
create participant F as feature
307+
M ->> F: Create a feature branch:<br/>git switch -c feature
308+
loop
309+
F ->> F: #f
310+
Note over F: Develop changes:<br/>git add<br/>git commit
311+
end
312+
F -->> GHF: #f
313+
Note left of F: Push to GitHub: git push<br/>The first push creates origin feature!
314+
destroy GHF
315+
GHF -->> UM: #f
316+
Note left of GHF: Pull Request and then Merge.<br/>Delete origin feature branch.
317+
UM -->> GHM: #f
318+
Note right of UM: Sync your fork
319+
GHM -->> M: #f
320+
Note right of GHM: git pull
321+
Note over F: Delete branch:<br/>git branch -d feature
322+
box Upstream Remote - GitHub
323+
participant UM
324+
end
325+
box Fork Remote - GitHub
326+
participant GHM
327+
participant GHF
328+
end
329+
box Fork - Local
330+
participant M
331+
participant F
332+
end
333+
```
334+
281335
:::::::::::::::::::::::::::::::::::::::: keypoints
282336

283337
- A fork is a server side, in our case GitHub, copy

episodes/Break.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,42 @@ You've now used the Feature Branch model to:
1111
3. Create a branch to develop your changes on
1212
4. Make changes to your working copy
1313
5. Open a Pull Request
14-
6. Review changes
15-
7. Respond to review
16-
8. Merge the Pull Request and close the Issue
17-
9. Tidy up your branches
14+
6. Respond to review
15+
7. Update your local copy and tidy up your branches
16+
17+
```mermaid
18+
sequenceDiagram
19+
accDescr {A sequence diagram showing the steps for the branching model.}
20+
autonumber
21+
participant GHM as origin main
22+
participant GHF as origin feature
23+
participant M as main
24+
GHM -->> GHM: #f
25+
Note over GHM: Open an Issue for the change
26+
GHM -->> M: #f
27+
Note right of GHM: First time: git clone<br/>Then: git pull
28+
create participant F as feature
29+
M ->> F: Create a feature branch:<br/>git switch -c feature
30+
loop
31+
F ->> F: #f
32+
Note over F: Develop changes:<br/>git add<br/>git commit
33+
end
34+
F -->> GHF: #f
35+
Note left of F: Push to GitHub: git push<br/>The first push creates origin feature!
36+
destroy GHF
37+
GHF ->> GHM: #f
38+
Note left of GHF: Pull Request and then Merge.<br/>Delete origin feature branch.
39+
GHM -->> M: #f
40+
Note right of GHM: git pull
41+
Note over F: Delete branch:<br/>git branch -D feature
42+
box GitHub Remote
43+
participant GHM
44+
participant GHF
45+
end
46+
box Local
47+
participant M
48+
participant F
49+
end
50+
```
1851

1952
Take a break - get up and move about.

0 commit comments

Comments
 (0)