Browse Source

Create lang agenda skeleton

Santiago Pastorino 4 years ago
parent
commit
40366c138f
3 changed files with 112 additions and 0 deletions
  1. 78 0
      src/agenda.rs
  2. 11 0
      src/bin/lang-agenda.rs
  3. 23 0
      templates/lang_agenda.tt

+ 78 - 0
src/agenda.rs

@@ -449,3 +449,81 @@ pub fn prioritization<'a>() -> Box<dyn Action> {
         actions,
     })
 }
+
+pub fn lang<'a>() -> Box<dyn Action> {
+    let mut actions = Vec::new();
+
+    let mut queries = Vec::new();
+
+    // https://github.com/rust-lang/rfcs/pulls?q=is%3Aopen+is%3Apr+label%3AT-lang
+    queries.push(QueryMap {
+        name: "newly_created_rfcs",
+        query: github::Query {
+            kind: github::QueryKind::List,
+            filters: vec![("state", "open"), ("is", "pr")],
+            include_labels: vec!["T-lang"],
+            exclude_labels: vec![],
+        },
+    });
+
+    //https://github.com/rust-lang/rfcs/pulls?q=is%3Aopen+is%3Apr+label%3AI-nominated+label%3AT-lang
+    queries.push(QueryMap {
+        name: "nominated_rfcs",
+        query: github::Query {
+            kind: github::QueryKind::List,
+            filters: vec![("state", "open"), ("is", "pr")],
+            include_labels: vec!["T-lang", "I-nominated"],
+            exclude_labels: vec![],
+        },
+    });
+
+    actions.push(Query {
+        repo: "rust-lang/rfcs",
+        queries,
+    });
+
+    let mut queries = Vec::new();
+
+    // https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AP-high+label%3AT-lang
+    queries.push(QueryMap {
+        name: "p_high_issues",
+        query: github::Query {
+            kind: github::QueryKind::List,
+            filters: vec![("state", "open")],
+            include_labels: vec!["T-lang", "P-high"],
+            exclude_labels: vec![],
+        },
+    });
+
+    // https://github.com/rust-lang/rust/pulls?q=is%3Aopen+is%3Apr+label%3AI-nominated+label%3AT-lang
+    queries.push(QueryMap {
+        name: "nominated_prs",
+        query: github::Query {
+            kind: github::QueryKind::List,
+            filters: vec![("state", "open"), ("is", "pr")],
+            include_labels: vec!["T-lang", "I-nominated"],
+            exclude_labels: vec![],
+        },
+    });
+
+    // https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3AI-nominated+label%3AT-lang+
+    queries.push(QueryMap {
+        name: "nominated_issues",
+        query: github::Query {
+            kind: github::QueryKind::List,
+            filters: vec![("state", "open")],
+            include_labels: vec!["T-lang", "I-nominated"],
+            exclude_labels: vec![],
+        },
+    });
+
+    actions.push(Query {
+        repo: "rust-lang/rust",
+        queries,
+    });
+
+    Box::new(Step {
+        name: "lang_agenda",
+        actions,
+    })
+}

+ 11 - 0
src/bin/lang-agenda.rs

@@ -0,0 +1,11 @@
+use triagebot::{agenda, logger};
+
+#[tokio::main]
+async fn main() {
+    dotenv::dotenv().ok();
+    logger::init();
+
+    let agenda = agenda::lang();
+
+    print!("{}", agenda.call().await);
+}

+ 23 - 0
templates/lang_agenda.tt

@@ -0,0 +1,23 @@
+{% import "_issues.tt" as issues %}
+
+# T-lang meeting agenda
+
+## Newly created RFCs
+
+{{-issues::render(issues=newly_created_rfcs, indent="  ", empty="No new RFCs this time.")}}
+
+## Nominated RFCs
+
+{{-issues::render(issues=nominated_rfcs, indent="  ", empty="No nominated RFCs this time.")}}
+
+## P-high issues
+
+{{-issues::render(issues=p_high_issues, indent="  ", empty="No P-high issues this time.")}}
+
+## Nominated PRs
+
+{{-issues::render(issues=nominated_prs, indent="  ", empty="No nominated PRs this time.")}}
+
+## Nominated issues
+
+{{-issues::render(issues=nominated_issues, indent="  ", empty="No nominated issues this time.")}}