Skip to content

agenda generator for acp meeting #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/agenda-generator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ arg_enum! {
#[derive(Debug)]
pub enum AgendaKind {
Libs,
LibsACP,
LibsAPI,
PGEH,
}
Expand Down
53 changes: 50 additions & 3 deletions tools/agenda-generator/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,41 @@ fn shorten(url: &str) -> String {
}

impl Generator {
pub fn libs_acp_agenda(mut self) -> Result<String> {
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<String> {
writeln!(
&mut self.agenda,
Expand Down Expand Up @@ -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)?;
}
Expand Down Expand Up @@ -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<Sort>,
count: Option<usize>,
state: State,
Expand Down Expand Up @@ -487,6 +528,7 @@ impl GithubQuery {
labels: vec![],
excluded_labels: vec![],
repos: vec![],
with_checkboxes: false,
sort: None,
count: None,
state: State::Open,
Expand All @@ -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
Expand Down Expand Up @@ -583,7 +630,7 @@ impl GithubQuery {
} else {
&issues[..]
};
generator.write_issues(&issues)?;
generator.write_issues(&issues, self.with_checkboxes)?;

empty = false;
}
Expand Down
1 change: 1 addition & 0 deletions tools/agenda-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?,
};
Expand Down