Skip to content

Commit 4bb661b

Browse files
committed
filter out FCPs that aren't blocked
1 parent 51b0228 commit 4bb661b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/agenda-generator/src/generator.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::Result;
2-
use chrono::NaiveDateTime;
2+
use chrono::{Duration, NaiveDateTime};
33
use itertools::Itertools;
44
use reqwest::header::{AUTHORIZATION, USER_AGENT};
55
use serde::de::{DeserializeOwned, Deserializer};
@@ -207,6 +207,14 @@ impl Generator {
207207
let mut fcps: Vec<FcpWithInfo> =
208208
reqwest::blocking::get("https://rfcbot.rs/api/all")?.json()?;
209209
fcps.retain(|fcp| fcp.issue.labels.contains(&label));
210+
let waiting_on_author = "S-waiting-on-author".to_string();
211+
fcps.retain(|fcp| !fcp.issue.labels.contains(&waiting_on_author));
212+
let now = chrono::Utc::now().naive_utc();
213+
fcps.retain(|fcp| {
214+
let created = fcp.status_comment.created_at;
215+
let updated = fcp.status_comment.updated_at;
216+
(now - created) > Duration::weeks(4) && (now - updated) > Duration::days(5)
217+
});
210218

211219
let reviewer_count = fcps
212220
.iter()
@@ -220,7 +228,6 @@ impl Generator {
220228
.map(|fcp| fcp.issue.repository.as_str())
221229
.collect::<BTreeSet<_>>();
222230

223-
224231
writeln!(self.agenda, "### FCPs")?;
225232
writeln!(self.agenda,)?;
226233
writeln!(self.agenda, "{} open T-libs-api FCPs:", fcps.len())?;

0 commit comments

Comments
 (0)