Skip to content

Commit 2083b33

Browse files
authored
Merge pull request #1345 from sladyn98/multi-query-repo
Add multi-repo query support
2 parents 6409629 + 0fc0b4d commit 2083b33

File tree

4 files changed

+245
-124
lines changed

4 files changed

+245
-124
lines changed

lang-agenda.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Triage meeting DATE
3+
tags: triage-meeting
4+
---
5+
6+
# T-lang meeting agenda
7+
8+
* Meeting date: DATE
9+
10+
## Attendance
11+
12+
* Team members:
13+
* Others:
14+
15+
## Meeting roles
16+
17+
* Action item scribe:
18+
* Note-taker:
19+
20+
## Scheduled meetings
21+
- "Rust language "guiding principles"" [lang-team#91](https://github.com/rust-lang/lang-team/issues/91)
22+
- "Generators planning" [lang-team#92](https://github.com/rust-lang/lang-team/issues/92)
23+
- "May updates" [lang-team#93](https://github.com/rust-lang/lang-team/issues/93)
24+
25+
## Action item review
26+
27+
* [Action items list](https://hackmd.io/gstfhtXYTHa3Jv-P_2RK7A)
28+
29+
## Pending proposals
30+
### "MCP: Allowing the compiler to eagerly drop values" lang-team#86
31+
32+
**Link:** https://github.com/rust-lang/lang-team/issues/86
33+
34+
35+
36+
## Nominated RFCs
37+
### "RFC: Overconstraining and omitting `unsafe` in impls of `unsafe` trait methods" rfcs#2316
38+
39+
**Link:** https://github.com/rust-lang/rfcs/pull/2316
40+
41+
### "Calling methods on generic parameters of const fns" rfcs#2632
42+
43+
**Link:** https://github.com/rust-lang/rfcs/pull/2632
44+
45+
46+
47+
## P-high issues on rust-lang/rust
48+
### "`fn() -> Out` is a valid type for unsized types `Out`, and it implements `FnOnce<(), Output = Out>`" rust#82633
49+
50+
**Link:** https://github.com/rust-lang/rust/issues/82633
51+
52+
### "Closures are unsound: 'static closures with non-'static return types." rust#84366
53+
54+
**Link:** https://github.com/rust-lang/rust/issues/84366
55+
56+
### "Functions, closures, and HRTB-trait-objects can implement traits such that validity of associated types is never checked." rust#84533
57+
58+
**Link:** https://github.com/rust-lang/rust/issues/84533
59+
60+
### "HRTBs are unsound: HRTB on subtrait provides HTRB on supertrait with weaker implied bounds." rust#84591
61+
62+
**Link:** https://github.com/rust-lang/rust/issues/84591
63+
64+
### "A `Pin` unsoundness involving an `impl DerefMut for Pin<&dyn LocalTrait>`" rust#85099
65+
66+
**Link:** https://github.com/rust-lang/rust/issues/85099
67+
68+
69+
70+
## Nominated PRs and issues
71+
### "Tracking issue for RFC 2523, `#[cfg(version(..))]`" rust#64796
72+
73+
**Link:** https://github.com/rust-lang/rust/issues/64796
74+
75+
### "Stabilize "RangeFrom" patterns" rust#83918
76+
77+
**Link:** https://github.com/rust-lang/rust/pull/83918
78+
79+
### "Uplift the invalid_atomic_ordering lint from clippy to rustc" rust#84039
80+
81+
**Link:** https://github.com/rust-lang/rust/pull/84039
82+
83+
### "Deny float matches" rust#84045
84+
85+
**Link:** https://github.com/rust-lang/rust/pull/84045
86+
87+
### "ICE when reifying function pointers to copy / copy_nonoverlapping using an if" rust#84297
88+
89+
**Link:** https://github.com/rust-lang/rust/issues/84297
90+
91+
### "Add `expr202x` macro pattern" rust#84364
92+
93+
**Link:** https://github.com/rust-lang/rust/pull/84364
94+
95+
### "Allow struct and enum to contain inner attrs" rust#84414
96+
97+
**Link:** https://github.com/rust-lang/rust/pull/84414
98+
99+
### "stabilize member constraints" rust#84701
100+
101+
**Link:** https://github.com/rust-lang/rust/pull/84701
102+
103+
### "implement `Default` for all arrays" rust#84838
104+
105+
**Link:** https://github.com/rust-lang/rust/pull/84838
106+
107+
### "add back support for inner attributes on non-block expressions?" rust#84879
108+
109+
**Link:** https://github.com/rust-lang/rust/issues/84879
110+
111+
### "rustc: Allow safe #[target_feature] on wasm" rust#84988
112+
113+
**Link:** https://github.com/rust-lang/rust/pull/84988
114+
115+
### "Re-add support for parsing (and pretty-printing) inner-attributes in match body" rust#85193
116+
117+
**Link:** https://github.com/rust-lang/rust/pull/85193
118+
119+
### "Stabilize RFC 2345: Allow panicking in constants" rust#85194
120+
121+
**Link:** https://github.com/rust-lang/rust/issues/85194
122+
123+
### "Ignore derived Clone and Debug implementations during dead code analysis" rust#85200
124+
125+
**Link:** https://github.com/rust-lang/rust/pull/85200
126+
127+
### "Check for union field accesses in THIR unsafeck" rust#85263
128+
129+
**Link:** https://github.com/rust-lang/rust/pull/85263
130+
131+
### "RFC: Overconstraining and omitting `unsafe` in impls of `unsafe` trait methods" rfcs#2316
132+
133+
**Link:** https://github.com/rust-lang/rfcs/pull/2316
134+
135+
### "Calling methods on generic parameters of const fns" rfcs#2632
136+
137+
**Link:** https://github.com/rust-lang/rfcs/pull/2632
138+
139+

src/actions.rs

Lines changed: 77 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct Step<'a> {
1818
}
1919

2020
pub struct Query<'a> {
21-
pub repo: &'a str,
21+
pub repos: Vec<&'a str>,
2222
pub queries: Vec<QueryMap<'a>>,
2323
}
2424

@@ -57,77 +57,87 @@ impl<'a> Action for Step<'a> {
5757
let mut context = Context::new();
5858
let mut results = HashMap::new();
5959

60-
for Query { repo, queries } in &self.actions {
61-
let repository = Repository {
62-
full_name: repo.to_string(),
63-
};
64-
65-
for QueryMap { name, query } in queries {
66-
match query.kind {
67-
github::QueryKind::List => {
68-
let issues_search_result = repository.get_issues(&gh, &query).await;
69-
70-
match issues_search_result {
71-
Ok(issues) => {
72-
let issues_decorator: Vec<_> = issues
73-
.iter()
74-
.map(|issue| IssueDecorator {
75-
title: issue.title.clone(),
76-
number: issue.number,
77-
html_url: issue.html_url.clone(),
78-
repo_name: repository
79-
.full_name
80-
.split("/")
81-
.last()
82-
.expect("Failed to split repository name")
83-
.to_string(),
84-
labels: issue
85-
.labels
86-
.iter()
87-
.map(|l| l.name.as_ref())
88-
.collect::<Vec<_>>()
89-
.join(", "),
90-
assignees: issue
91-
.assignees
92-
.iter()
93-
.map(|u| u.login.as_ref())
94-
.collect::<Vec<_>>()
95-
.join(", "),
96-
})
97-
.collect();
98-
99-
results
100-
.entry(*name)
101-
.or_insert(Vec::new())
102-
.extend(issues_decorator);
103-
}
104-
Err(err) => {
105-
eprintln!("ERROR: {}", err);
106-
err.chain()
107-
.skip(1)
108-
.for_each(|cause| eprintln!("because: {}", cause));
109-
std::process::exit(1);
110-
}
111-
}
112-
}
60+
for Query { repos, queries} in &self.actions {
11361

114-
github::QueryKind::Count => {
115-
let count = repository.get_issues_count(&gh, &query).await;
62+
for repo in repos {
63+
let repository = Repository {
64+
full_name: repo.to_string(),
65+
};
11666

117-
match count {
118-
Ok(count) => {
119-
context.insert(*name, &count);
67+
for QueryMap { name, query } in queries {
68+
match query.kind {
69+
github::QueryKind::List => {
70+
let issues_search_result = repository.get_issues(&gh, &query).await;
71+
72+
match issues_search_result {
73+
Ok(issues) => {
74+
let issues_decorator: Vec<_> = issues
75+
.iter()
76+
.map(|issue| IssueDecorator {
77+
title: issue.title.clone(),
78+
number: issue.number,
79+
html_url: issue.html_url.clone(),
80+
repo_name: repository
81+
.full_name
82+
.split("/")
83+
.last()
84+
.expect("Failed to split repository name")
85+
.to_string(),
86+
labels: issue
87+
.labels
88+
.iter()
89+
.map(|l| l.name.as_ref())
90+
.collect::<Vec<_>>()
91+
.join(", "),
92+
assignees: issue
93+
.assignees
94+
.iter()
95+
.map(|u| u.login.as_ref())
96+
.collect::<Vec<_>>()
97+
.join(", "),
98+
})
99+
.collect();
100+
101+
results
102+
.entry(*name)
103+
.or_insert(Vec::new())
104+
.extend(issues_decorator);
105+
}
106+
Err(err) => {
107+
eprintln!("ERROR: {}", err);
108+
err.chain()
109+
.skip(1)
110+
.for_each(|cause| eprintln!("because: {}", cause));
111+
std::process::exit(1);
112+
}
120113
}
121-
Err(err) => {
122-
eprintln!("ERROR: {}", err);
123-
err.chain()
124-
.skip(1)
125-
.for_each(|cause| eprintln!("because: {}", cause));
126-
std::process::exit(1);
114+
}
115+
116+
github::QueryKind::Count => {
117+
let count = repository.get_issues_count(&gh, &query).await;
118+
119+
match count {
120+
Ok(count) => {
121+
122+
let result = if let Some(value) = context.get(*name) {
123+
value.as_u64().unwrap() + count as u64
124+
} else {
125+
count as u64
126+
};
127+
128+
context.insert(*name, &result);
129+
}
130+
Err(err) => {
131+
eprintln!("ERROR: {}", err);
132+
err.chain()
133+
.skip(1)
134+
.for_each(|cause| eprintln!("because: {}", cause));
135+
std::process::exit(1);
136+
}
127137
}
128138
}
129-
}
130-
};
139+
};
140+
}
131141
}
132142
}
133143

0 commit comments

Comments
 (0)