Skip to content

Commit 5a6cb5b

Browse files
authored
Merge pull request #303 from lqd/monthly-fixes
A handful of monthly post fixes
2 parents f11225b + a80d0dc commit 5a6cb5b

File tree

6 files changed

+25
-30
lines changed

6 files changed

+25
-30
lines changed

crates/rust-project-goals-cli-llm/src/updates.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async fn prepare_goals(
125125
let details_summary = match comments.len() {
126126
0 => String::from("No detailed updates available."),
127127
1 => String::from("1 detailed update available."),
128-
len => format!("{len} detailed updates availabled."),
128+
len => format!("{len} detailed updates available."),
129129
};
130130
result.push(UpdatesGoal {
131131
title: title.clone(),
@@ -162,7 +162,9 @@ fn tldr(
162162
_issue_id: &IssueId,
163163
comments: &mut Vec<ExistingGithubComment>,
164164
) -> anyhow::Result<Option<String>> {
165-
let Some(index) = comments.iter().position(|c| c.body.starts_with(TLDR)) else {
165+
// `comments` are sorted by creation date in an ascending order, so we look for the most recent
166+
// TL;DR comment from the end.
167+
let Some(index) = comments.iter().rposition(|c| c.body.starts_with(TLDR)) else {
166168
return Ok(None);
167169
};
168170

@@ -194,10 +196,11 @@ fn help_wanted(
194196
while lines.peek().is_some() {
195197
while let Some(line) = lines.next() {
196198
if let Some(c) = HELP_WANTED.captures(line) {
197-
help_wanted.push(HelpWanted {
198-
text: c["text"].to_string(),
199-
});
200-
break;
199+
let text = c["text"].trim().to_string();
200+
if !text.is_empty() {
201+
help_wanted.push(HelpWanted { text });
202+
break;
203+
}
201204
}
202205
}
203206

crates/rust-project-goals/src/re.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn is_just(re: &Regex, s: &str) -> bool {
104104
lazy_static! {
105105
/// If a line within a comment begins with this text, it will be considered a request for help
106106
pub static ref HELP_WANTED: Regex =
107-
Regex::new(r"^(?i:help wanted:|\*\*help wanted:\*\*) (?P<text>.*)")
107+
Regex::new(r"^[*-]?\s*(?i:help wanted:|\*\*help wanted:\*\*) (?P<text>.*)")
108108
.unwrap();
109109
}
110110

src/2025h1/cargo-script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| Point of contact | @epage |
66
| Teams | <!-- TEAMS WITH ASKS --> |
77
| Task owners | <!-- TASK OWNERS --> |
8-
| Status | Proposed |
8+
| Status | Accepted |
99
| Tracking issue | [rust-lang/rust-project-goals#119] |
1010
| Zulip channel | N/A (an existing stream can be re-used or new streams can be created on request) |
1111

src/admin/author_updates.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ Triagebot can ping project-goal owners for updates. To use it, go to Zulip and e
88
@triagebot ping-goals 14 Oct-21
99
```
1010

11-
The first number (14) is a threshold, it is typically set to the current day of the month (e.g., the above command assumes it is Oct 14). It means "if they have posted a comment in the last 14 days, don't bug them".
11+
The first number (14) is a threshold, it is typically set to the current day of the month (e.g., the above command assumes it is Oct 14). It means "if they have posted a comment in the last 14 days, don't bug them".
1212

1313
The second string ("Oct-21") is the deadline for updates to be included.
1414

1515
We need to improve this UI.
1616

1717
## Filling out the template
1818

19-
Run the `cargo rpg updates` command to create the blog post template. If running from within vscode, the `--vscode` command will open the result in a fresh tab, which is convenient. Otherwise, use `--output-file $file.md` to create a new file.
20-
21-
The template will be filled in with the list of flagship goals. Each flagship goal will have their [Why this goal?](./merge_rfc.md#author-the-why-this-goal-sections-for-the-flagship-goals) section auto-inserted from the corresponding tracking issue.
22-
23-
The template will also include the detailed list of updates in a `<details>` section as well as any TL;DR comments left by users.
24-
25-
The update template itself is maintained with handlebars, you will find it [here](https://github.com/rust-lang/rust-project-goals/blob/main/templates/updates.hbs).
26-
27-
28-
19+
After the updates have been published, they can be summarized in a monthly blog post, as described in [this dedicated chapter](./updates.md).

src/admin/updates.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ Usage:
66
> cargo rpg updates --help
77
```
88

9-
The `updates` command generates the starting point for a monthly blog post. The output is based on the handlebars templates found in the `templates` directory. The command you probably want most often is something like this
9+
Run the `cargo rpg updates` command to create the blog post template. If running from within vscode, the `--vscode` command will open the result in a fresh tab, which is convenient. Otherwise, use `--output-file $file.md` to create a new file.
1010

11-
```
12-
> cargo rpg updates YYYYhN --vscode
13-
```
11+
The template will be filled in with the list of flagship goals. Each flagship goal will have their [Why this goal?](./merge_rfc.md#author-the-why-this-goal-sections-for-the-flagship-goals) section auto-inserted from the corresponding tracking issue.
12+
13+
The template will also include the detailed list of updates in a `<details>` section as well as any TL;DR comments left by users.
1414

15-
which will open the blogpost in a tab in VSCode. This makes it easy to copy-and-paste over to the main Rust blog.
15+
The update template itself is maintained with handlebars, you will find it [here](https://github.com/rust-lang/rust-project-goals/blob/main/templates/updates.hbs).
1616

17-
## Blog post starting point
1817

19-
The blog post starting point is based on the handlebars template in `templates/updates.hbs`.
18+
This command can also take optional dates to control which comments and updates in the given date range are included in the blog post. This is usually needed to correctly set the starting date right after the previous month's blog post.
2019

21-
## Configuring the LLM
20+
For example,
2221

23-
The `updates` command makes use of an LLM hosted on AWS Bedrock to summarize people's comments. You will need to run `aws configure` and login with some default credentials. You can skip the LLM by providing the `--quick` command-line option, but then you have to generate your own text, which can be pretty tedious.
22+
```
23+
> cargo rpg updates 2025h1 2025-03-01
24+
```

templates/updates.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Rust project is currently working towards a [slate of {{goal_count}} project
77

88
<!-- markdown separator -->
99

10-
**Why this goal?** {{why_this_goal}}
10+
**Why this goal?** {{{why_this_goal}}}
1111

1212
**What has happened?** {{{tldr}}}
1313

@@ -33,7 +33,7 @@ The Rust project is currently working towards a [slate of {{goal_count}} project
3333
{{#each help_wanted}}
3434

3535
<!-- markdown separator -->
36-
![Help wanted](https://img.shields.io/badge/Help%20wanted-yellow) {{{text}}}
36+
*Help wanted:* {{{text}}}
3737
<!-- markdown separator -->
3838

3939
{{/each}}

0 commit comments

Comments
 (0)