Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 9e65652

Browse files
authored
Merge pull request #9 from githubtraining/fix-links
Tell a cohesive story
2 parents bc93f0f + 39f1ba5 commit 9e65652

12 files changed

Lines changed: 115 additions & 52 deletions

config.yml

Lines changed: 84 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,33 +57,44 @@ steps:
5757
event: issues.closed
5858
link: '{{ repoUrl }}/issues/1'
5959
actions:
60+
- type: gate
61+
left: '%payload.issue.title%'
62+
operator: ===
63+
right: Welcome to this repository
64+
else:
65+
- type: respond
66+
with: e-unexpected.md
67+
data:
68+
expected: close the issue titled **Welcome to this repository**
6069
- type: createIssue
61-
title: Find the similar issue
62-
body: 01_crosslink.md
70+
title: Fix the sidebar
71+
body: 01_sidebar.md
72+
comments:
73+
- 01_crosslink.md
6374
action_id: similarIssue
6475
- type: createProjectBoard
6576
name: v1.0.0
6677
description: Planning for v1.0.0 release
6778
columns:
6879
- Backlog
69-
- Done
80+
- In progress
7081
action_id: projectBoard
7182
- type: octokit
7283
method: projects.createColumn
7384
project_id: '%actions.projectBoard.data.id%'
74-
name: In Progress
85+
name: Done
7586
owner: '%payload.repository.owner.login%'
7687
repo: '%payload.repository.name%'
77-
action_id: ipColumn
88+
action_id: doneColumn
7889
- type: octokit
7990
method: projects.createCard
8091
owner: '%payload.repository.owner.login%'
8192
repo: '%payload.repository.name%'
8293
content_id: '%actions.similarIssue.data.id%'
8394
content_type: Issue
84-
column_id: '%actions.ipColumn.data.id%'
95+
column_id: '%actions.doneColumn.data.id%'
8596
- type: createIssue
86-
title: There's something similar here
97+
title: Broken sidebar
8798
body: 01_the-similar-crosslink.md
8899
- type: closeIssue
89100
issue: Welcome
@@ -100,9 +111,19 @@ steps:
100111
link: '{{ repoUrl }}/issues/7'
101112
actions:
102113
- type: gate
103-
left: '(8)'
104-
operator: test
105-
right: '%payload.comment.body%'
114+
every: true
115+
gates:
116+
- left: '%payload.issue.title%'
117+
operator: ===
118+
right: Fix the sidebar
119+
- left: '(8)'
120+
operator: test
121+
right: '%payload.comment.body%'
122+
else:
123+
- type: respond
124+
with: e-unexpected.md
125+
data:
126+
expected: comment on the issue titled **Fix the sidebar** with the comment `#8`, the number of the similar issue
106127
- type: respond
107128
with: 02_find-commit.md
108129

@@ -113,9 +134,19 @@ steps:
113134
link: '{{ repoUrl }}/issues/7'
114135
actions:
115136
- type: gate
116-
left: '(312f87)'
117-
operator: test
118-
right: '%payload.comment.body%'
137+
every: true
138+
gates:
139+
- left: '%payload.issue.title%'
140+
operator: ===
141+
right: Fix the sidebar
142+
- left: '(312f87)'
143+
operator: test
144+
right: '%payload.comment.body%'
145+
else:
146+
- type: respond
147+
with: e-unexpected.md
148+
data:
149+
expected: comment on the issue titled **Fix the sidebar** with the comment `312f872f79e50d505f02be5ddc97b3f7504d0189`, the SHA of the commit we're looking for
119150
- type: respond
120151
with: 03_context.md
121152
data:
@@ -133,36 +164,55 @@ steps:
133164
right: '%payload.project_card.content_url%'
134165
else:
135166
- type: respond
136-
with: e-wrong-pr.md
167+
with: e-unexpected.md
168+
issue: Fix the sidebar
137169
data:
138-
commit: 312f87
139-
issue: Find the similar issue
170+
expected: add pull request \#5 to the Done column of the v1.0.0 project
140171
- type: respond
141172
with: 04_find-broken-build.md
142-
issue: Find the similar issue
173+
issue: Fix the sidebar
143174

144175
# Step 5:
145176
- title: Assign yourself
146177
description: Assign yourself to the pull request with a broken build
147178
event: pull_request.assigned
148179
link: '{{ repoUrl }}/issues/7'
149180
actions:
181+
- type: gate
182+
left: '%payload.pull_request.title%'
183+
operator: ===
184+
right: Add Git tips
185+
else:
186+
- type: respond
187+
with: e-unexpected.md
188+
data:
189+
expected: 'assign yourself to the pull request titled **Add Git tips**'
150190
- type: respond
151191
with: 05_fix-build.md
152192

153193
# Step 6: Something to do with tests
154194
- title: Fix the broken build
155195
description: Fix the broken build in the pull request with a new commit
156-
event: push
196+
event: pull_request.synchronize
157197
link: '{{ repoUrl }}/pull/6'
158198
actions:
159199
- type: getFileContents
160200
filename: docs/git-tips.md
161201
action_id: fileContents
162202
- type: gate
163-
left: '(tricks)'
164-
operator: test
165-
right: '%actions.fileContents%'
203+
every: true
204+
gates:
205+
- left: '%payload.pull_request.title%'
206+
operator: ===
207+
right: Add Git tips
208+
- left: '(tricks)'
209+
operator: test
210+
right: '%actions.fileContents%'
211+
else:
212+
- type: respond
213+
with: e-unexpected.md
214+
data:
215+
expected: edit `docs/git-tips.md` on the `add-git-tips` branch so that the word "tricks" is properly spelled
166216
- type: createStatus
167217
state: success
168218
sha: '%payload.head_commit.id%'
@@ -173,9 +223,21 @@ steps:
173223
# Step 7: Merge pull request
174224
- title: Merge
175225
description: Merge the final pull request
176-
event: push
226+
event: pull_request.closed
177227
link: '{{ repoUrl }}/pull/6'
178228
actions:
229+
- type: gate
230+
every: true
231+
gates:
232+
- left: '%payload.pull_request.merged%'
233+
- left: '%payload.pull_request.title%'
234+
operator: ===
235+
right: Add Git tips
236+
else:
237+
- type: respond
238+
with: e-unexpected.md
239+
data:
240+
expected: merge the pull request titled **Add Git tips**
179241
- type: createIssue
180242
title: Congratulations!
181243
body: 07_congratulations.md

responses/00_add-navigation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
This pull request introduces navigation to the documentation.
44

5+
_Note: in a step in this course, you'll be asked to perform the steps below. They're listed here for your convenience._
6+
57
### :keyboard: Activity: Add to v1.0.0 project
68

79
1. Click on **Projects** on the right side of this pull request.
810
1. Choose the `v1.0.0` project from the list. You'll then see it's _Awaiting triage_
9-
1. Click on the project drop down, and place it into the **In Progress** column.
11+
1. Click on the project drop down, and place it into the **Done** column.
1012

1113
I'll respond back in the original issue where you were asked to do this.

responses/00_existing-welcome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Welcome!
22

3-
Welcome to the course! We're going to walk through some strategies for dealing with large repositories. This is a similar issue to #1, but I'll let you decide if we should keep it or not.
3+
Welcome to the course! We're going to walk through some strategies for dealing with large repositories. This is a similar issue to #1. Please close this issue.

responses/00_welcome-issue.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Welcome!
22

3-
Welcome to this Learning Lab course about working in large repositories. For example, you could be working in repositories with a lot of history. Or, working with many collaborators. No matter how your repository is "large", it's important to know how to navigate your workspace.
3+
Welcome to this Learning Lab course about finding your way through the history of GitHub repositories. For example, you could be working in repositories with a lot of history, many collaborators, or many files.
44

55
Before you take this course, you may want to go through the [Introduction to GitHub](https://lab.github.com/githubtraining/introduction-to-github) course on Learning Lab.
66

@@ -12,7 +12,9 @@ In this course, you'll learn how to do lots of things, like:
1212

1313
### Cross-linking issues and pull requests
1414

15-
GitHub has special capabilities to help reference other information on GitHub. For example, if someone references a GitHub issue or pull request from another issue or pull request, a link is created. At the same time, a cross-reference is created in the other issue. This two-way reference helps people track relationships of information across GitHub.
15+
GitHub has special capabilities to help reference other information on GitHub. For example, when you reference another issue or pull request by number, that number will be hyperlinked. At the same time, a cross-reference is created in the linked issue or pull request. This two-way reference helps people track the relationship of information across GitHub.
16+
17+
![a screenshot of an issue linking to a PR, and a PR with a cross-reference to the issue](https://user-images.githubusercontent.com/16547949/67594663-d9710900-f732-11e9-8df8-d3173d952bd5.png)
1618

1719
## Step 1: Find an issue
1820

responses/01_crosslink.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
When you're working in a repository, you might want to find other issues or pull requests. Maybe someone has told you about a conversation, but they didn't send you a direct link. Or, maybe you remember an issue from the past but you don't know exactly where it is.
44

5-
Next, we'll practice finding issues and creating crosslinks to improve discoverability later.
5+
In this case, we want to see if there's another reference to the broken sidebar somewhere on this repository, and track down any work that's been attempted related to this. Let's see what we can find out!
66

77
### Finding issues and pull requests
88

@@ -19,5 +19,8 @@ When you want to create a crosslink, try typing the title of an issue or pull re
1919
### :keyboard: Activity: Find and link to a related issue
2020

2121
1. Please find the issue that is similar to this one
22-
- This does _not_ mean that the issue is referenced, like in the last step - you should go look in the [Issues]({{ repoURL }}/issues) tab to find an issue with a similar title
23-
2. Comment in this issue with a reference to the related issue with a short description
22+
- This does _not_ mean that the issue is referenced, like in the last step. This time, we're looking for a related issue that hasn't been connected to this one in any way.
23+
- Try looking in the [Issues]({{ repoUrl }}/issues) tab to find an issue with a similar title to this one.
24+
2. Comment in this issue with a reference to the related issue and a short description, something along the lines of "this is a duplicate of issue #(number)".
25+
26+
I'll respond when you comment on this issue.

responses/01_sidebar.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_Note: the content of this comment simulates common usage of issues as a way to request features of report bugs. Scroll down to the next comment in this issue for your instructions._
2+
3+
There's no sidebar! Is this user error or is it actually missing?
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1 @@
1-
# How to find issues and pull requests
2-
3-
When you're working in a repository, you might want to find other issues or pull requests. Maybe someone has told you about a conversation, but they didn't send you a direct link. Or, maybe you remember an issue from the past but you don't know exactly where it is.
4-
5-
### Finding conversations
6-
7-
You can read all about the different ways to search in the [GitHub Help documentation](https://help.github.com/en/articles/searching-issues-and-pull-requests#search-by-open-or-closed-state).
8-
9-
### Creating Links
10-
11-
To learn about creating references, check out [GitHub's documentation](https://help.github.com/en/articles/autolinked-references-and-urls).
1+
I think this project would be better if it had a sidebar.

responses/02_find-commit.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Great job finding the duplicate issue! Feel free to close the other issue as a duplicate of this one, but I'll leave it up to you. Let's move on to finding out if these issues ever led to a sidebar being added to our project!
2+
13
# Finding commits
24

35
An important part of version control is the ability to look into the past. By using `git blame`, and finding the story behind a commit, we're able to do more than _blame_ people for code. We're able to see the story around why a commit was made - what is the associated pull request? Who approved the pull request? What tests were run on that commit before it was merged?

responses/03_context.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Thanks for finding that commit! We now know that the sidebar was indeed added, and it was done in that commit. Let's see if we can dig a little deeper to find out if any planning or conversation occurred around this change.
2+
13
# Context
24

35
As we've already seen, conversations in issues and pull requests can reference other work.
@@ -27,17 +29,17 @@ When you're looking at a commit on GitHub, you can see a lot of information. Fro
2729

2830
## Step 4: Give more context
2931

30-
In the story above, you might want to `@mention` the authors involved in the article. You may want to find them in person, or set up another way to collaborate. In this case, we want to collate the spread out information that you found through the commit.
32+
To help others find relevant context, we want to collate the information that you found in the prior steps.
3133

3234
![a screenshot of this issue with the projects section highlighted on the right, and a second screenshot of v1.0.0 project](https://user-images.githubusercontent.com/16547949/67590688-b0984600-f729-11e9-8d46-cc243d666331.png)
3335

34-
You'll notice that this issue is part of [Project v1.0.0]({{ repoUrl }}/projects/1). Let's add the related pull request to the same project.
36+
One way we can do this, is by using [GitHub Projects](https://help.github.com/en/github/managing-your-work-on-github/about-project-boards). You'll notice that this issue is part of [Project v1.0.0]({{ repoUrl }}/projects/1), which tells us that the sidebar is part of the work related to our version 1.0.0 release. Let's add the related pull request to the same project so that the two artifacts can be tracked in tandem.
3537

3638
### :keyboard: Activity: Use a project to track related efforts
3739

3840
1. Go back to {{ commitId }}.
3941
1. Click the link to the related pull request.
4042
1. In the pull request, click on **Projects** on the right side, and choose the `v1.0.0` project from the list.
41-
1. When the PR is added to the project, you'll see it's _Awaiting triage_, let's triage it! Click on the project drop down, and place it into the **In Progress** column.
43+
1. When the PR is added to the project, you'll see it's _Awaiting triage_, let's triage it! Click on the project drop down, and place it into the **Done** column.
4244

43-
I'll respond in this issue when you've added the pull request to the In Progress column of the v1.0.0 project.
45+
I'll respond in this issue when you've added the pull request to the Done column of the v1.0.0 project.

responses/07_congratulations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Great job! In this course, you've learned a lot about finding and sharing information. Within a GitHub repository, you can find history about what changes were made, and more importantly, _why_ changes were made.
44

5-
If you'd like to see this project on GitHub Pages, go to the [Settings tab]({{ repoURL }}/settings) of this repository and scroll down. Then, under **GitHub Pages**, select the **`master` branch `/docs` folder** as the source.
5+
If you'd like to see this project on GitHub Pages, go to the [Settings tab]({{ repoUrl }}/settings) of this repository and scroll down. Then, under **GitHub Pages**, select the **`master` branch `/docs` folder** as the source.
66

77
Want to keep learning? Feel free to [check out our other courses]({{ host }}/courses).
88

0 commit comments

Comments
 (0)