diff --git a/tools/agenda-generator/src/cli.rs b/tools/agenda-generator/src/cli.rs index 2b168d0..df471ba 100644 --- a/tools/agenda-generator/src/cli.rs +++ b/tools/agenda-generator/src/cli.rs @@ -17,6 +17,7 @@ arg_enum! { #[derive(Debug)] pub enum AgendaKind { Libs, + LibsACP, LibsAPI, PGEH, } diff --git a/tools/agenda-generator/src/generator.rs b/tools/agenda-generator/src/generator.rs index 6746134..5f5d69a 100644 --- a/tools/agenda-generator/src/generator.rs +++ b/tools/agenda-generator/src/generator.rs @@ -33,6 +33,41 @@ fn shorten(url: &str) -> String { } impl Generator { + pub fn libs_acp_agenda(mut self) -> Result { + writeln!( + &mut self.agenda, + "# Libs ACP Meeting {} + +###### tags: `Libs Meetings` `Minutes` + +**Attendees**: ... + +## Agenda + +- Triage +- Anything else? + +## Triage +", + chrono::Utc::now().format("%Y-%m-%d") + )?; + + GithubQuery::new("Ready for Review") + .labels(&["api-change-proposal"]) + .exclude_labels(&["initial-comment-period"]) + .repo("rust-lang/libs-team") + .with_checkboxes() + .write(&mut self)?; + + GithubQuery::new("Finished Comment Period") + .labels(&["api-change-proposal", "initial-comment-period"]) + .repo("rust-lang/libs-team") + .with_checkboxes() + .write(&mut self)?; + + writeln!(&mut self.agenda, "_Generated by [fully-automatic-rust-libs-team-triage-meeting-agenda-generator](https://github.com/rust-lang/libs-team/tree/main/tools/agenda-generator)_")?; + Ok(self.agenda) + } pub fn libs_api_agenda(mut self) -> Result { writeln!( &mut self.agenda, @@ -378,9 +413,14 @@ impl Generator { Ok(()) } - fn write_issues(&mut self, issues: &[Issue]) -> Result<()> { + fn write_issues(&mut self, issues: &[Issue], checkboxes: bool) -> Result<()> { for issue in issues.iter().rev() { - write!(self.agenda, " - {}", shorten(&issue.html_url))?; + if checkboxes { + write!(self.agenda, " - [ ] {}", shorten(&issue.html_url))?; + } + else { + write!(self.agenda, " - {}", shorten(&issue.html_url))?; + } for label in issue.labels.iter().filter(|s| s.starts_with("P-")) { write!(self.agenda, " `{}`", label)?; } @@ -450,6 +490,7 @@ struct GithubQuery { labels: Vec<&'static [&'static str]>, excluded_labels: Vec<&'static [&'static str]>, repos: Vec<&'static str>, + with_checkboxes: bool, sort: Option, count: Option, state: State, @@ -487,6 +528,7 @@ impl GithubQuery { labels: vec![], excluded_labels: vec![], repos: vec![], + with_checkboxes: false, sort: None, count: None, state: State::Open, @@ -508,6 +550,11 @@ impl GithubQuery { self } + fn with_checkboxes(&mut self) -> &mut Self { + self.with_checkboxes = true; + self + } + fn sort(&mut self, sort: Sort) -> &mut Self { self.sort = Some(sort); self @@ -583,7 +630,7 @@ impl GithubQuery { } else { &issues[..] }; - generator.write_issues(&issues)?; + generator.write_issues(&issues, self.with_checkboxes)?; empty = false; } diff --git a/tools/agenda-generator/src/main.rs b/tools/agenda-generator/src/main.rs index e77b7bd..03420df 100644 --- a/tools/agenda-generator/src/main.rs +++ b/tools/agenda-generator/src/main.rs @@ -11,6 +11,7 @@ fn main() -> eyre::Result<()> { let generator = Generator::default(); let agenda = match args.agenda { AgendaKind::Libs => generator.libs_agenda()?, + AgendaKind::LibsACP => generator.libs_acp_agenda()?, AgendaKind::LibsAPI => generator.libs_api_agenda()?, AgendaKind::PGEH => generator.error_handling_pg_agenda()?, };