Skip to content

Commit 17ba81c

Browse files
authored
Merge pull request #142 from nikomatsakis/see-also
Whooops... "see also" for real
2 parents c669644 + 296389c commit 17ba81c

File tree

6 files changed

+86
-51
lines changed

6 files changed

+86
-51
lines changed

mdbook-goals/src/gh/issues.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ pub fn fetch_issue(repository: &Repository, issue: u64) -> anyhow::Result<Existi
122122
let output = Command::new("gh")
123123
.arg("-R")
124124
.arg(&repository.to_string())
125+
.arg("issue")
125126
.arg("view")
126127
.arg(&format!("{issue}"))
127128
.arg("--json")

mdbook-goals/src/json.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,13 @@ fn checkboxes(issue: &ExistingGithubIssue) -> anyhow::Result<Progress> {
150150
let issue_urls = c["issues"].split(&[',', ' ']).filter(|s| !s.is_empty());
151151

152152
for issue_url in issue_urls {
153-
let Some(c) = re::SEE_ALSO_ISSUE.captures(issue_url) else {
154-
anyhow::bail!("invalid issue URL `{issue_url}`")
153+
let c = match (
154+
re::SEE_ALSO_ISSUE1.captures(issue_url),
155+
re::SEE_ALSO_ISSUE2.captures(issue_url),
156+
) {
157+
(Some(c), _) => c,
158+
(None, Some(c)) => c,
159+
(None, None) => anyhow::bail!("invalid issue URL `{issue_url}`"),
155160
};
156161
let repository = Repository::new(&c["org"], &c["repo"]);
157162
let issue_number = c["issue"].parse::<u64>()?;

mdbook-goals/src/re.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ lazy_static! {
4141

4242
lazy_static! {
4343
pub static ref SEE_ALSO_QUERY: Regex =
44-
Regex::new(r"^\| *See also *\| (?P<issues>[^, ]+,|[^, ] )+ *\| *$").unwrap();
44+
Regex::new(r"^\| *See also *\|(?P<issues>[^|]+)\| *$").unwrap();
4545
}
4646

4747
lazy_static! {
48-
pub static ref SEE_ALSO_ISSUE: Regex = Regex::new(r"(?P<org>[^#/]*)/(?P<repo>[^#/]*)#(?P<issue>[0-9]+)|https://github.com/(?P<org>[^#/]*)/(?P<repo>[^#/]*)/issues/(?P<issue>[0-9]+)").unwrap();
48+
pub static ref SEE_ALSO_ISSUE1: Regex =
49+
Regex::new(r"(?P<org>[^#/]*)/(?P<repo>[^#/]*)#(?P<issue>[0-9]+)").unwrap();
50+
}
51+
52+
lazy_static! {
53+
pub static ref SEE_ALSO_ISSUE2: Regex =
54+
Regex::new(r"https://github.com/(?P<org>[^#/]*)/(?P<repo>[^#/]*)/issues/(?P<issue>[0-9]+)")
55+
.unwrap();
4956
}

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@
3131

3232
* [Overall setup](./admin/setup.md)
3333
* [Mdbook plugin details](./admin/mdbook_plugin.md)
34-
* [Commands you can run](./admin/commands.md)
34+
* [Commands you can run](./admin/commands.md)
35+
* [Creating tracking issues](./admin/issues.md)

src/admin/issues.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Creating tracking issues
2+
3+
Usage:
4+
5+
```
6+
> cargo run -- issues
7+
```
8+
9+
The `issues` command is used to create tracking issues at the start of a project goal session. When you first run it, it will simply tell you what actions it plans to take.
10+
11+
To actually commit and create the issues, supply the `--commit` flag:
12+
13+
```
14+
> cargo run -- issues --commit
15+
```
16+
17+
This will also edit the goal documents to include a link to each created tracking issue. You should commit those edits.
18+
19+
You can later re-run the command and it will not repeat actions it has already taken.c

src/how_to/report_status.md

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,76 @@
11
# Report status
22

3-
Every accepted project goal has an associated tracking issue.
3+
Every accepted project goal has an associated tracking issue. These are created [automatically by the project-goals admin tool](../admin/issues.md). Your job as a project goal owner is to provide regular status updates in the form of a comment indicating how things are going. These will be collected into regular blog posts on the Rust blog as well as being promoted in other channels.
44

5-
Owners are expected to provide regular status updates in the form of a comment indicating how things are going.
5+
## Updating the progress bar
66

7-
## Documenting your plan and your progress
8-
9-
To help users
7+
When we display the status of goals, we include a progress bar based on your documented plan. We recommend you keep this up to date. You can mix and match any of the following ways to list steps.
108

119
### Checkboxes
1210

13-
The deafult
14-
15-
### Search queries
11+
The first option is to add checkboxes into the top comment on the tracking issue. Simply add boxes like `* [ ]` or `* [x]` for a completed item. The tool will count the number of checkboxes and use that to reflect progress. Your tracking issue will be pre-propulated with checkboxes based on the goal doc, but feel free to edit them.
1612

17-
## Status updates are reported out
13+
Best practice is to start with a high level list of tasks:
1814

19-
The status updates from the tracking issues are used to author a blog post for Inside Rust on a monthly basis.
20-
If status updates are missing, the blog post will indicate that there is no status update.
21-
This will also prompt the project to reach out and check on the progress of the goal.
22-
If goal progress is slow for some reason -- maybe life intervened and you were not able to work on the goal --
23-
it is much better to leave a status report to that effect than to say nothing at all.
15+
```
16+
* [ ] Author code
17+
* [ ] Author RFC
18+
* [ ] Accept RFC
19+
* [ ] Test
20+
* [ ] Stabilize
21+
```
2422

25-
## Goals without updates can be paused
23+
each time you provide a status update, check off the items that are done, and add new items with more detailed to-do items that represent your next steps.
2624

27-
If goals do not receive updates for an extended period of time, they may be marked as **paused**.
28-
That's not meant as a judgment: things happen. It's just an indicator of the status.
29-
You can also resume work again!
25+
### Search queries
3026

31-
## Bot interactions
27+
For larger project goals, it can be more convenient to track progress via github issues. You can do that by removing all the checkboxes from your issue and instead adding a "Tracked issues" line into the metadata table on your tracking issue. It should look like this:
3228

33-
**Status:** Halluncinated. We need to author this code.
29+
```
30+
| Metadata | |
31+
| -------- | --- |
32+
| Owner(s) | ... |
33+
| Team(s) | ... |
34+
| Goal document | ... |
35+
| Tracked issues | [rust-lang/rust label:A-edition-2024 label:C-tracking-issue -label:t-libs](...) |
36+
```
3437

35-
To aid in this process, the Rust triagebot will ping owners around the end of the month.
36-
Pings will be placed as a comment on the tracking issue.
37-
Owners should leave a comment in response; the bot will then hide its comment to avoid clutter.
38+
The first 3 lines should already exist. The last line is the one you have to add. The "value" column should have a markdown link, the contents of which begin with a repo name and then search parameters in Github's format. The tool will conduct the search and count the number of open vs closed issues. The `(...)` part of the link should be to github so that users can click to do the search on their own.
3839

39-
## How to write a status update
40+
You can find an example on the [Rust 2024 Edition tracking issue](https://github.com/rust-lang/rust-project-goals/issues/117).
4041

41-
Status updates should be written for general Rust contributors.
42-
They will be posted to the [Inside Rust](https://blog.rust-lang.org/inside-rust/)
43-
Status updates should include the following information:
42+
### Use "See also" to refer to other tracking issues
4443

45-
* What happened since the last update
46-
* Key decisions made
47-
* Milestones achieved
48-
* Current plans
49-
* What is the milestone you are working towards
50-
* What is happening right now?
51-
* Help wanted (if any)
52-
* Status updates are a great place to highlight requests for help or contribution
44+
If you already have a tracking issue elsewhere, just add a "See also" line into your metadata. The value should be a comma-or-space-separated list of URLs or `org/repo#issue` github references:
5345

54-
## Status update template
46+
```
47+
| Metadata | |
48+
| -------- | --- |
49+
| Owner(s) | ... |
50+
| Team(s) | ... |
51+
| Goal document | ... |
52+
| See also | rust-lang/rust#123 |
53+
```
5554

56-
Here is a template you can use
55+
We will recursively open up the "see also" issue and extract checkboxes (or search queries / see-also tags) from there.
5756

58-
```
59-
### Since the last update...
57+
### Binary issues
6058

61-
*Describe any key decisions or events since the last update.*
59+
If we don't find any of the above, we will consider your issue either 0% done if it is not yet closed or 100% done if it is.
6260

63-
### Up next
61+
## Status update comments
6462

65-
*Describe the next milestone you are working towards.*
63+
Status updates are posted as comments on the Github tracking issue. You will receive regular pings on Zulip to author status updates periodically. It's a good idea to take the opportunity to update your [progress checkboxes](#checkboxes) as well.
6664

67-
### Help wanted
65+
There is no strict format for these updates but we recommend including the following information:
6866

69-
*Describe ways that contributors can help (if any, feel free to delete if contribution is not needed.)*
67+
* What happened since the last update? Were any key decisions made or milestones achieved?
68+
* What is the next step to get done?
69+
* Are you blocked on anyone or anything?
70+
* Is there any opportunity to others to pitch in and help out?
7071

71-
*Ideal here is to link to an issue with contribution instructions.*
72-
```
72+
## Closing the issue
7373

74+
Closing the tracking issue is a signal that you are no longer working on it. This can be because you've achieved your goal or because you have decided to focus on other things. Also, tracking issues will automatically be closed at the end of the project goal period.
7475

76+
When you close an issue, the state of your [checkboxes](#checkboxes) makes a difference. If they are 100% finished, the goal will be listed as completed. If there are unchecked items, the assumption is that the goal is only partly done, and it will be listed as unfinished. So make sure to check the boxes if the goal is done!

0 commit comments

Comments
 (0)