Skip to content

Commit dc256eb

Browse files
author
Niko Matsakis
committed
include things that say "help wanted" in the
tl;dr in the "help wanted" section
1 parent 671a0cd commit dc256eb

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ pub struct UpdatesGoal {
7373
/// True if the issue is closed.
7474
pub is_closed: bool,
7575

76+
/// True if there are "help wanted" comments OR the TL;DR includes a help wanted request.
77+
pub has_help_wanted: bool,
78+
7679
/// If there are comments that include ["help wanted"](`rust_project_goals::re::HELP_WANTED`)
7780
/// comments, those comments are included here.
7881
pub help_wanted: Vec<HelpWanted>,

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,17 @@ async fn prepare_goals(
116116

117117
let tldr = tldr(&issue_id, &mut comments)?;
118118

119-
let help_wanted = help_wanted(&issue_id, &comments)?;
119+
let (has_help_wanted, help_wanted) = help_wanted(&issue_id, &tldr, &comments)?;
120120

121121
let why_this_goal = why_this_goal(&issue_id, issue)?;
122122

123-
progress_bar::print_progress_bar_info(
124-
&format!("Issue #{number}", number = issue.number),
125-
&format!("tldr={}, c={}", tldr.is_some(), comments.len()),
126-
progress_bar::Color::Green,
127-
progress_bar::Style::Bold,
128-
);
129-
130123
result.push(UpdatesGoal {
131124
title: title.clone(),
132125
issue_number: issue.number,
133126
issue_assignees: comma(&issue.assignees),
134127
issue_url: issue_id.url(),
135128
progress,
129+
has_help_wanted,
136130
help_wanted,
137131
is_closed: issue.state == GithubIssueState::Closed,
138132
num_comments: comments.len(),
@@ -162,12 +156,15 @@ fn tldr(
162156
/// Search for comments that talk about help being wanted and extract that
163157
fn help_wanted(
164158
_issue_id: &IssueId,
159+
tldr: &Option<String>,
165160
comments: &[ExistingGithubComment],
166-
) -> anyhow::Result<Vec<HelpWanted>> {
161+
) -> anyhow::Result<(bool, Vec<HelpWanted>)> {
167162
use std::fmt::Write;
168163

169164
let mut help_wanted = vec![];
170165

166+
let tldr_has_help_wanted = tldr.as_deref().unwrap_or("").lines().any(|line| HELP_WANTED.is_match(line));
167+
171168
for comment in comments {
172169
let mut lines = comment.body.split('\n').peekable();
173170

@@ -194,7 +191,7 @@ fn help_wanted(
194191
}
195192
}
196193

197-
Ok(help_wanted)
194+
Ok((tldr_has_help_wanted || !help_wanted.is_empty(), help_wanted))
198195
}
199196

200197
fn why_this_goal(

templates/updates.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The Rust project is currently working towards a [slate of 26 project goals](http
1919
## Goals looking for help
2020

2121
{{#each other_goals}}
22-
{{#if help_wanted}}
22+
{{#if has_help_wanted}}
2323
{{>introduce_goal}}
2424

2525
<!-- markdown separator -->
@@ -43,7 +43,7 @@ The Rust project is currently working towards a [slate of 26 project goals](http
4343
## Other goal updates
4444

4545
{{#each other_goals}}
46-
{{#if help_wanted}}
46+
{{#if has_help_wanted}}
4747
{{else}}
4848
{{>introduce_goal}}
4949

0 commit comments

Comments
 (0)