Browse Source

Add planning meeting agenda for types

Jack Huey 1 năm trước cách đây
mục cha
commit
bbbfa33e52
4 tập tin đã thay đổi với 120 bổ sung1 xóa
  1. 63 0
      src/agenda.rs
  2. 23 0
      src/bin/types.rs
  3. 5 1
      templates/_issues_heading.tt
  4. 29 0
      templates/types_planning_agenda.tt

+ 63 - 0
src/agenda.rs

@@ -591,6 +591,69 @@ pub fn lang_planning<'a>() -> Box<dyn Action + Send + Sync> {
     })
 }
 
+pub fn types_planning<'a>() -> Box<dyn Action + Send + Sync> {
+    Box::new(Step {
+        name: "types_planning_agenda",
+        actions: vec![
+            Query {
+                repos: vec![("rust-lang", "types-team")],
+                queries: vec![
+                    QueryMap {
+                        name: "roadmap_tracking_issues",
+                        kind: QueryKind::List,
+                        query: Arc::new(github::Query {
+                            filters: vec![("state", "open"), ("is", "issue")],
+                            include_labels: vec!["roadmap-tracking-issue"],
+                            exclude_labels: vec![],
+                        }),
+                    },
+                    QueryMap {
+                        name: "deep_dive_proposals",
+                        kind: QueryKind::List,
+                        query: Arc::new(github::Query {
+                            filters: vec![("state", "open"), ("is", "issue")],
+                            include_labels: vec!["deep-dive-proposal"],
+                            exclude_labels: vec![],
+                        }),
+                    },
+                    QueryMap {
+                        name: "major_changes",
+                        kind: QueryKind::List,
+                        query: Arc::new(github::Query {
+                            filters: vec![("state", "open"), ("is", "issue")],
+                            include_labels: vec!["major-change"],
+                            exclude_labels: vec![],
+                        }),
+                    },
+                ],
+            },
+            Query {
+                repos: vec![("rust-lang", "rust")],
+                queries: vec![
+                    QueryMap {
+                        name: "nominated_issues",
+                        kind: QueryKind::List,
+                        query: Arc::new(github::Query {
+                            filters: vec![("state", "open"), ("is", "issue")],
+                            include_labels: vec!["I-types-nominated"],
+                            exclude_labels: vec![],
+                        }),
+                    },
+                    QueryMap {
+                        name: "types_fcps",
+                        kind: QueryKind::List,
+                        query: Arc::new(github::Query {
+                            filters: vec![("state", "open")],
+                            include_labels: vec!["T-types", "proposed-final-comment-period"],
+                            exclude_labels: vec![],
+                        }),
+                    },
+                ],
+            },
+        ],
+    })
+}
+
 // Things to add (maybe):
 // - Compiler RFCs
 // - P-high issues

+ 23 - 0
src/bin/types.rs

@@ -0,0 +1,23 @@
+use triagebot::agenda;
+
+#[tokio::main(flavor = "current_thread")]
+async fn main() -> anyhow::Result<()> {
+    dotenv::dotenv().ok();
+    tracing_subscriber::fmt::init();
+
+    let args: Vec<String> = std::env::args().collect();
+    if args.len() == 2 {
+        match &args[1][..] {
+            "planning" => {
+                let agenda = agenda::types_planning();
+                print!("{}", agenda.call().await?);
+                return Ok(());
+            }
+            _ => {}
+        }
+    }
+
+    eprintln!("Usage: types (planning)");
+
+    Ok(())
+}

+ 5 - 1
templates/_issues_heading.tt

@@ -1,10 +1,14 @@
 {% import "_issue.tt" as issue %}
 
-{% macro render(issues, heading="###", empty="No issues this time.") %}
+{% macro render(issues, heading="###", empty="No issues this time.", split_url=true) %}
 {%- for issue in issues %}
+{% if split_url %}
 {{heading}} "{{issue.title}}" {{issue.repo_name}}#{{issue.number}}
 
 **Link:** {{issue.html_url}}
+{% else %}
+{{heading}} [{{issue.title}}]({{issue.html_url}})
+{% endif %}
 {%else%}
 
 None.

+ 29 - 0
templates/types_planning_agenda.tt

@@ -0,0 +1,29 @@
+{% import "_issues_heading.tt" as issues_heading %}
+{% import "_issues.tt" as issues %}
+---
+title: {{CURRENT_DATE}} Planning meeting
+tags: weekly-meeting, T-types
+date: {{CURRENT_DATE}}
+---
+
+# T-types planning meeting agenda
+
+## Updates
+
+{{-issues_heading::render(issues=roadmap_tracking_issues,split_url=false)}}
+
+## Nominated issues
+
+{{-issues_heading::render(issues=nominated_issues,split_url=false)}}
+
+## Types FCPs
+
+{{-issues_heading::render(issues=types_fcps,split_url=false)}}
+
+## Major change proposals
+
+{{-issues_heading::render(issues=major_changes,split_url=false)}}
+
+## Deep dive planning
+
+{{-issues_heading::render(issues=deep_dive_proposals,split_url=false)}}