agenda.rs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. use crate::actions::{Action, Query, QueryMap, Step};
  2. use crate::github;
  3. use std::collections::HashMap;
  4. pub fn prioritization<'a>() -> Box<dyn Action> {
  5. let mut actions = Vec::new();
  6. let mut queries = Vec::new();
  7. // MCP/FCP queries
  8. queries.push(QueryMap {
  9. name: "mcp_new_not_seconded",
  10. query: github::Query {
  11. kind: github::QueryKind::List,
  12. filters: vec![("state", "open")],
  13. include_labels: vec!["major-change", "to-announce"],
  14. exclude_labels: vec![
  15. "proposed-final-comment-period",
  16. "finished-final-comment-period",
  17. "final-comment-period",
  18. "major-change-accepted",
  19. "t-libs",
  20. "t-libs-api",
  21. ],
  22. ordering: HashMap::new(),
  23. },
  24. });
  25. queries.push(QueryMap {
  26. name: "mcp_old_not_seconded",
  27. query: github::Query {
  28. kind: github::QueryKind::List,
  29. filters: vec![("state", "open")],
  30. include_labels: vec!["major-change"],
  31. exclude_labels: vec![
  32. "to-announce",
  33. "proposed-final-comment-period",
  34. "finished-final-comment-period",
  35. "final-comment-period",
  36. "t-libs",
  37. "t-libs-api",
  38. ],
  39. ordering: HashMap::new(),
  40. },
  41. });
  42. queries.push(QueryMap {
  43. name: "in_pre_fcp",
  44. query: github::Query {
  45. kind: github::QueryKind::List,
  46. filters: vec![("state", "open")],
  47. include_labels: vec!["proposed-final-comment-period"],
  48. exclude_labels: vec!["t-libs", "t-libs-api"],
  49. ordering: HashMap::new(),
  50. },
  51. });
  52. queries.push(QueryMap {
  53. name: "in_fcp",
  54. query: github::Query {
  55. kind: github::QueryKind::List,
  56. filters: vec![("state", "open")],
  57. include_labels: vec!["final-comment-period"],
  58. exclude_labels: vec!["t-libs", "t-libs-api"],
  59. ordering: HashMap::new(),
  60. },
  61. });
  62. queries.push(QueryMap {
  63. name: "mcp_accepted",
  64. query: github::Query {
  65. kind: github::QueryKind::List,
  66. filters: vec![("state", "all")],
  67. include_labels: vec!["major-change-accepted", "to-announce"],
  68. exclude_labels: vec!["t-libs", "t-libs-api"],
  69. ordering: HashMap::new(),
  70. },
  71. });
  72. queries.push(QueryMap {
  73. name: "fcp_finished",
  74. query: github::Query {
  75. kind: github::QueryKind::List,
  76. filters: vec![("state", "all")],
  77. include_labels: vec![
  78. "finished-final-comment-period",
  79. "disposition-merge",
  80. "to-announce",
  81. ],
  82. exclude_labels: vec!["t-libs", "t-libs-api"],
  83. ordering: HashMap::new(),
  84. },
  85. });
  86. actions.push(Query {
  87. repos: vec!["rust-lang/compiler-team"],
  88. queries,
  89. });
  90. let mut queries = Vec::new();
  91. queries.push(QueryMap {
  92. name: "in_pre_fcp",
  93. query: github::Query {
  94. kind: github::QueryKind::List,
  95. filters: vec![("state", "open")],
  96. include_labels: vec!["proposed-final-comment-period", "T-compiler"],
  97. exclude_labels: vec!["t-libs", "t-libs-api"],
  98. ordering: HashMap::new(),
  99. },
  100. });
  101. queries.push(QueryMap {
  102. name: "in_fcp",
  103. query: github::Query {
  104. kind: github::QueryKind::List,
  105. filters: vec![("state", "open")],
  106. include_labels: vec!["final-comment-period", "T-compiler"],
  107. exclude_labels: vec!["t-libs", "t-libs-api"],
  108. ordering: HashMap::new(),
  109. },
  110. });
  111. queries.push(QueryMap {
  112. name: "fcp_finished",
  113. query: github::Query {
  114. kind: github::QueryKind::List,
  115. filters: vec![("state", "all")],
  116. include_labels: vec![
  117. "finished-final-comment-period",
  118. "disposition-merge",
  119. "to-announce",
  120. ],
  121. exclude_labels: vec!["t-libs", "t-libs-api"],
  122. ordering: HashMap::new(),
  123. },
  124. });
  125. actions.push(Query {
  126. repos: vec!["rust-lang/rust"],
  127. queries,
  128. });
  129. let mut queries = Vec::new();
  130. queries.push(QueryMap {
  131. name: "in_pre_fcp",
  132. query: github::Query {
  133. kind: github::QueryKind::List,
  134. filters: vec![("state", "open")],
  135. include_labels: vec!["proposed-final-comment-period"],
  136. exclude_labels: vec!["t-libs", "t-libs-api"],
  137. ordering: HashMap::new(),
  138. },
  139. });
  140. queries.push(QueryMap {
  141. name: "in_fcp",
  142. query: github::Query {
  143. kind: github::QueryKind::List,
  144. filters: vec![("state", "open")],
  145. include_labels: vec!["final-comment-period"],
  146. exclude_labels: vec!["t-libs", "t-libs-api"],
  147. ordering: HashMap::new(),
  148. },
  149. });
  150. queries.push(QueryMap {
  151. name: "fcp_finished",
  152. query: github::Query {
  153. kind: github::QueryKind::List,
  154. filters: vec![("state", "all")],
  155. include_labels: vec![
  156. "finished-final-comment-period",
  157. "disposition-merge",
  158. "to-announce",
  159. ],
  160. exclude_labels: vec!["t-libs", "t-libs-api"],
  161. ordering: HashMap::new(),
  162. },
  163. });
  164. actions.push(Query {
  165. repos: vec!["rust-lang/rust-forge"],
  166. queries,
  167. });
  168. let mut queries = Vec::new();
  169. // beta nomination queries
  170. queries.push(QueryMap {
  171. name: "beta_nominated_t_compiler",
  172. query: github::Query {
  173. kind: github::QueryKind::List,
  174. filters: vec![],
  175. include_labels: vec!["beta-nominated", "T-compiler"],
  176. exclude_labels: vec!["beta-accepted"],
  177. ordering: HashMap::new(),
  178. },
  179. });
  180. queries.push(QueryMap {
  181. name: "beta_nominated_t_rustdoc",
  182. query: github::Query {
  183. kind: github::QueryKind::List,
  184. filters: vec![],
  185. include_labels: vec!["beta-nominated", "T-rustdoc"],
  186. exclude_labels: vec!["beta-accepted"],
  187. ordering: HashMap::new(),
  188. },
  189. });
  190. // stable nomination queries
  191. queries.push(QueryMap {
  192. name: "stable_nominated_t_compiler",
  193. query: github::Query {
  194. kind: github::QueryKind::List,
  195. filters: vec![],
  196. include_labels: vec!["stable-nominated", "T-compiler"],
  197. exclude_labels: vec!["stable-accepted"],
  198. ordering: HashMap::new(),
  199. },
  200. });
  201. queries.push(QueryMap {
  202. name: "stable_nominated_t_rustdoc",
  203. query: github::Query {
  204. kind: github::QueryKind::List,
  205. filters: vec![],
  206. include_labels: vec!["stable-nominated", "T-rustdoc"],
  207. exclude_labels: vec!["stable-accepted"],
  208. ordering: HashMap::new(),
  209. },
  210. });
  211. // prs waiting on team queries
  212. queries.push(QueryMap {
  213. name: "prs_waiting_on_team_t_compiler",
  214. query: github::Query {
  215. kind: github::QueryKind::List,
  216. filters: vec![("state", "open")],
  217. include_labels: vec!["S-waiting-on-team", "T-compiler"],
  218. exclude_labels: vec![],
  219. ordering: HashMap::new(),
  220. },
  221. });
  222. // issues of note queries
  223. queries.push(QueryMap {
  224. name: "issues_of_note_p_critical",
  225. query: github::Query {
  226. kind: github::QueryKind::Count,
  227. filters: vec![("state", "open")],
  228. include_labels: vec!["T-compiler", "P-critical"],
  229. exclude_labels: vec![],
  230. ordering: HashMap::new(),
  231. },
  232. });
  233. queries.push(QueryMap {
  234. name: "issues_of_note_unassigned_p_critical",
  235. query: github::Query {
  236. kind: github::QueryKind::Count,
  237. filters: vec![("state", "open"), ("no", "assignee")],
  238. include_labels: vec!["T-compiler", "P-critical"],
  239. exclude_labels: vec![],
  240. ordering: HashMap::new(),
  241. },
  242. });
  243. queries.push(QueryMap {
  244. name: "issues_of_note_p_high",
  245. query: github::Query {
  246. kind: github::QueryKind::Count,
  247. filters: vec![("state", "open")],
  248. include_labels: vec!["T-compiler", "P-high"],
  249. exclude_labels: vec![],
  250. ordering: HashMap::new(),
  251. },
  252. });
  253. queries.push(QueryMap {
  254. name: "issues_of_note_unassigned_p_high",
  255. query: github::Query {
  256. kind: github::QueryKind::Count,
  257. filters: vec![("state", "open"), ("no", "assignee")],
  258. include_labels: vec!["T-compiler", "P-high"],
  259. exclude_labels: vec![],
  260. ordering: HashMap::new(),
  261. },
  262. });
  263. queries.push(QueryMap {
  264. name: "issues_of_note_regression_from_stable_to_beta_p_critical",
  265. query: github::Query {
  266. kind: github::QueryKind::Count,
  267. filters: vec![("state", "open")],
  268. include_labels: vec!["regression-from-stable-to-beta", "P-critical"],
  269. exclude_labels: vec![],
  270. ordering: HashMap::new(),
  271. },
  272. });
  273. queries.push(QueryMap {
  274. name: "issues_of_note_regression_from_stable_to_beta_p_high",
  275. query: github::Query {
  276. kind: github::QueryKind::Count,
  277. filters: vec![("state", "open")],
  278. include_labels: vec!["regression-from-stable-to-beta", "P-high"],
  279. exclude_labels: vec![],
  280. ordering: HashMap::new(),
  281. },
  282. });
  283. queries.push(QueryMap {
  284. name: "issues_of_note_regression_from_stable_to_beta_p_medium",
  285. query: github::Query {
  286. kind: github::QueryKind::Count,
  287. filters: vec![("state", "open")],
  288. include_labels: vec!["regression-from-stable-to-beta", "P-medium"],
  289. exclude_labels: vec![],
  290. ordering: HashMap::new(),
  291. },
  292. });
  293. queries.push(QueryMap {
  294. name: "issues_of_note_regression_from_stable_to_beta_p_low",
  295. query: github::Query {
  296. kind: github::QueryKind::Count,
  297. filters: vec![("state", "open")],
  298. include_labels: vec!["regression-from-stable-to-beta", "P-low"],
  299. exclude_labels: vec![],
  300. ordering: HashMap::new(),
  301. },
  302. });
  303. queries.push(QueryMap {
  304. name: "issues_of_note_regression_from_stable_to_nightly_p_critical",
  305. query: github::Query {
  306. kind: github::QueryKind::Count,
  307. filters: vec![("state", "open")],
  308. include_labels: vec!["regression-from-stable-to-nightly", "P-critical"],
  309. exclude_labels: vec![],
  310. ordering: HashMap::new(),
  311. },
  312. });
  313. queries.push(QueryMap {
  314. name: "issues_of_note_regression_from_stable_to_nightly_p_high",
  315. query: github::Query {
  316. kind: github::QueryKind::Count,
  317. filters: vec![("state", "open")],
  318. include_labels: vec!["regression-from-stable-to-nightly", "P-high"],
  319. exclude_labels: vec![],
  320. ordering: HashMap::new(),
  321. },
  322. });
  323. queries.push(QueryMap {
  324. name: "issues_of_note_regression_from_stable_to_nightly_p_medium",
  325. query: github::Query {
  326. kind: github::QueryKind::Count,
  327. filters: vec![("state", "open")],
  328. include_labels: vec!["regression-from-stable-to-nightly", "P-medium"],
  329. exclude_labels: vec![],
  330. ordering: HashMap::new(),
  331. },
  332. });
  333. queries.push(QueryMap {
  334. name: "issues_of_note_regression_from_stable_to_nightly_p_low",
  335. query: github::Query {
  336. kind: github::QueryKind::Count,
  337. filters: vec![("state", "open")],
  338. include_labels: vec!["regression-from-stable-to-nightly", "P-low"],
  339. exclude_labels: vec![],
  340. ordering: HashMap::new(),
  341. },
  342. });
  343. queries.push(QueryMap {
  344. name: "issues_of_note_regression_from_stable_to_stable_p_critical",
  345. query: github::Query {
  346. kind: github::QueryKind::Count,
  347. filters: vec![("state", "open")],
  348. include_labels: vec!["regression-from-stable-to-stable", "P-critical"],
  349. exclude_labels: vec![],
  350. ordering: HashMap::new(),
  351. },
  352. });
  353. queries.push(QueryMap {
  354. name: "issues_of_note_regression_from_stable_to_stable_p_high",
  355. query: github::Query {
  356. kind: github::QueryKind::Count,
  357. filters: vec![("state", "open")],
  358. include_labels: vec!["regression-from-stable-to-stable", "P-high"],
  359. exclude_labels: vec![],
  360. ordering: HashMap::new(),
  361. },
  362. });
  363. queries.push(QueryMap {
  364. name: "issues_of_note_regression_from_stable_to_stable_p_medium",
  365. query: github::Query {
  366. kind: github::QueryKind::Count,
  367. filters: vec![("state", "open")],
  368. include_labels: vec!["regression-from-stable-to-stable", "P-medium"],
  369. exclude_labels: vec![],
  370. ordering: HashMap::new(),
  371. },
  372. });
  373. queries.push(QueryMap {
  374. name: "issues_of_note_regression_from_stable_to_stable_p_low",
  375. query: github::Query {
  376. kind: github::QueryKind::Count,
  377. filters: vec![("state", "open")],
  378. include_labels: vec!["regression-from-stable-to-stable", "P-low"],
  379. exclude_labels: vec![],
  380. ordering: HashMap::new(),
  381. },
  382. });
  383. queries.push(QueryMap {
  384. name: "p_critical_t_compiler",
  385. query: github::Query {
  386. kind: github::QueryKind::List,
  387. filters: vec![("state", "open")],
  388. include_labels: vec!["T-compiler", "P-critical"],
  389. exclude_labels: vec![],
  390. ordering: HashMap::new(),
  391. },
  392. });
  393. queries.push(QueryMap {
  394. name: "p_critical_t_rustdoc",
  395. query: github::Query {
  396. kind: github::QueryKind::List,
  397. filters: vec![("state", "open")],
  398. include_labels: vec!["T-rustdoc", "P-critical"],
  399. exclude_labels: vec![],
  400. ordering: HashMap::new(),
  401. },
  402. });
  403. queries.push(QueryMap {
  404. name: "beta_regressions_p_high",
  405. query: github::Query {
  406. kind: github::QueryKind::List,
  407. filters: vec![("state", "open")],
  408. include_labels: vec!["regression-from-stable-to-beta", "P-high"],
  409. exclude_labels: vec!["T-infra", "T-libs", "T-release", "T-rustdoc", "T-core"],
  410. ordering: HashMap::new(),
  411. },
  412. });
  413. queries.push(QueryMap {
  414. name: "nightly_regressions_unassigned_p_high",
  415. query: github::Query {
  416. kind: github::QueryKind::List,
  417. filters: vec![("state", "open"), ("no", "assignee")],
  418. include_labels: vec!["regression-from-stable-to-nightly", "P-high"],
  419. exclude_labels: vec!["T-infra", "T-libs", "T-release", "T-rustdoc", "T-core"],
  420. ordering: HashMap::new(),
  421. },
  422. });
  423. queries.push(QueryMap {
  424. name: "nominated_t_compiler",
  425. query: github::Query {
  426. kind: github::QueryKind::List,
  427. filters: vec![("state", "open")],
  428. include_labels: vec!["I-nominated", "T-compiler"],
  429. exclude_labels: vec![],
  430. ordering: HashMap::new(),
  431. },
  432. });
  433. actions.push(Query {
  434. repos: vec!["rust-lang/rust"],
  435. queries,
  436. });
  437. // retrieve some RFCs for the T-compiler agenda
  438. let mut queries = Vec::new();
  439. // https://github.com/rust-lang/rfcs/pulls?q=is%3Aopen+label%3AI-nominated+label%3AT-compiler
  440. queries.push(QueryMap {
  441. name: "nominated_rfcs_t_compiler",
  442. query: github::Query {
  443. kind: github::QueryKind::List,
  444. filters: vec![("state", "open")],
  445. include_labels: vec!["T-compiler", "I-nominated"],
  446. exclude_labels: vec![],
  447. ordering: HashMap::new(),
  448. },
  449. });
  450. actions.push(Query {
  451. repos: vec!["rust-lang/rfcs"],
  452. queries,
  453. });
  454. Box::new(Step {
  455. name: "prioritization_agenda",
  456. actions,
  457. })
  458. }
  459. pub fn lang<'a>() -> Box<dyn Action> {
  460. Box::new(Step {
  461. name: "lang_agenda",
  462. actions: vec![
  463. Query {
  464. repos: vec!["rust-lang/lang-team"],
  465. queries: vec![
  466. QueryMap {
  467. name: "pending_project_proposals",
  468. query: github::Query {
  469. kind: github::QueryKind::List,
  470. filters: vec![("state", "open"), ("is", "issue")],
  471. include_labels: vec!["major-change"],
  472. exclude_labels: vec!["charter-needed"],
  473. ordering: HashMap::new(),
  474. },
  475. },
  476. QueryMap {
  477. name: "pending_lang_team_prs",
  478. query: github::Query {
  479. kind: github::QueryKind::List,
  480. filters: vec![("state", "open"), ("is", "pull-request")],
  481. include_labels: vec![],
  482. exclude_labels: vec![],
  483. ordering: HashMap::new(),
  484. },
  485. },
  486. QueryMap {
  487. name: "scheduled_meetings",
  488. query: github::Query {
  489. kind: github::QueryKind::List,
  490. filters: vec![("state", "open"), ("is", "issue")],
  491. include_labels: vec!["meeting-proposal", "meeting-scheduled"],
  492. exclude_labels: vec![],
  493. ordering: HashMap::new(),
  494. },
  495. },
  496. ],
  497. },
  498. Query {
  499. repos: vec!["rust-lang/rfcs"],
  500. queries: vec![QueryMap {
  501. name: "rfcs_waiting_to_be_merged",
  502. query: github::Query {
  503. kind: github::QueryKind::List,
  504. filters: vec![("state", "open"), ("is", "pr")],
  505. include_labels: vec![
  506. "disposition-merge",
  507. "finished-final-comment-period",
  508. "T-lang",
  509. ],
  510. exclude_labels: vec![],
  511. ordering: HashMap::new(),
  512. },
  513. }],
  514. },
  515. Query {
  516. repos: vec![
  517. "rust-lang/rfcs",
  518. "rust-lang/rust",
  519. "rust-lang/reference",
  520. "rust-lang/lang-team",
  521. ],
  522. queries: vec![
  523. QueryMap {
  524. name: "p_critical",
  525. query: github::Query {
  526. kind: github::QueryKind::List,
  527. filters: vec![("state", "open")],
  528. include_labels: vec!["T-lang", "P-critical"],
  529. exclude_labels: vec![],
  530. ordering: HashMap::new(),
  531. },
  532. },
  533. QueryMap {
  534. name: "nominated",
  535. query: github::Query {
  536. kind: github::QueryKind::List,
  537. filters: vec![("state", "open")],
  538. include_labels: vec!["T-lang", "I-nominated"],
  539. exclude_labels: vec![],
  540. ordering: HashMap::new(),
  541. },
  542. },
  543. QueryMap {
  544. name: "proposed_fcp",
  545. query: github::Query {
  546. kind: github::QueryKind::List,
  547. filters: vec![("state", "open")],
  548. include_labels: vec!["T-lang", "proposed-final-comment-period"],
  549. exclude_labels: vec!["finished-final-comment-period"],
  550. ordering: HashMap::new(),
  551. },
  552. },
  553. QueryMap {
  554. name: "in_fcp",
  555. query: github::Query {
  556. kind: github::QueryKind::List,
  557. filters: vec![("state", "open")],
  558. include_labels: vec!["T-lang", "final-comment-period"],
  559. exclude_labels: vec!["finished-final-comment-period"],
  560. ordering: HashMap::new(),
  561. },
  562. },
  563. QueryMap {
  564. name: "finished_fcp",
  565. query: github::Query {
  566. kind: github::QueryKind::List,
  567. filters: vec![("state", "open")],
  568. include_labels: vec!["T-lang", "finished-final-comment-period"],
  569. exclude_labels: vec![],
  570. ordering: HashMap::new(),
  571. },
  572. },
  573. ],
  574. },
  575. ],
  576. })
  577. }
  578. pub fn lang_planning<'a>() -> Box<dyn Action> {
  579. Box::new(Step {
  580. name: "lang_planning_agenda",
  581. actions: vec![
  582. Query {
  583. repos: vec!["rust-lang/lang-team"],
  584. queries: vec![
  585. QueryMap {
  586. name: "pending_project_proposals",
  587. query: github::Query {
  588. kind: github::QueryKind::List,
  589. filters: vec![("state", "open"), ("is", "issue")],
  590. include_labels: vec!["major-change"],
  591. exclude_labels: vec!["charter-needed"],
  592. ordering: HashMap::new(),
  593. },
  594. },
  595. QueryMap {
  596. name: "pending_lang_team_prs",
  597. query: github::Query {
  598. kind: github::QueryKind::List,
  599. filters: vec![("state", "open"), ("is", "pr")],
  600. include_labels: vec![],
  601. exclude_labels: vec![],
  602. ordering: HashMap::new(),
  603. },
  604. },
  605. QueryMap {
  606. name: "proposed_meetings",
  607. query: github::Query {
  608. kind: github::QueryKind::List,
  609. filters: vec![("state", "open"), ("is", "issue")],
  610. include_labels: vec!["meeting-proposal"],
  611. exclude_labels: vec!["meeting-scheduled"],
  612. ordering: HashMap::new(),
  613. },
  614. },
  615. ],
  616. },
  617. Query {
  618. repos: vec!["rust-lang/lang-team"],
  619. queries: vec![QueryMap {
  620. name: "active_initiatives",
  621. query: github::Query {
  622. kind: github::QueryKind::List,
  623. filters: vec![("state", "open"), ("is", "issue")],
  624. include_labels: vec!["lang-initiative"],
  625. exclude_labels: vec![],
  626. ordering: HashMap::new(),
  627. },
  628. }],
  629. },
  630. ],
  631. })
  632. }