Skip to content

Commit 03d9c84

Browse files
committed
Add more details to relevant FCPs steps
1 parent 36e5c27 commit 03d9c84

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

src/actions.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use tera::{Context, Tera};
99
use crate::{
1010
github::{self, GithubClient, Repository},
1111
http_client::{CompilerMeeting, HttpClient},
12+
rfcbot,
1213
};
1314

1415
#[async_trait]
@@ -54,12 +55,22 @@ pub struct IssueDecorator {
5455
pub mcp_details: Option<MCPDetails>,
5556
}
5657

58+
#[derive(Serialize, Deserialize, Debug)]
59+
pub struct FCPConcernDetails {
60+
pub name: String,
61+
pub reviewer_login: String,
62+
pub concern_url: String,
63+
}
64+
5765
#[derive(Serialize, Deserialize, Debug)]
5866
pub struct FCPDetails {
5967
pub bot_tracking_comment_html_url: String,
6068
pub bot_tracking_comment_content: String,
6169
pub initiating_comment_html_url: String,
6270
pub initiating_comment_content: String,
71+
pub disposition: String,
72+
pub pending_reviewers: Vec<rfcbot::Reviewer>,
73+
pub concerns: Vec<FCPConcernDetails>,
6374
}
6475

6576
#[derive(Serialize, Deserialize, Debug)]
@@ -130,6 +141,7 @@ impl<'a> Action for Step<'a> {
130141
let query = query.clone();
131142
handles.push(tokio::task::spawn(async move {
132143
let _permit = semaphore.acquire().await?;
144+
let fcps_groups = ["proposed_fcp", "in_pre_fcp", "in_fcp"];
133145
let mcps_groups = [
134146
"mcp_new_not_seconded",
135147
"mcp_old_not_seconded",
@@ -140,7 +152,7 @@ impl<'a> Action for Step<'a> {
140152
let issues = query
141153
.query(
142154
&repository,
143-
name == "proposed_fcp",
155+
fcps_groups.contains(&name.as_str()),
144156
mcps_groups.contains(&name.as_str())
145157
&& repository.full_name.contains("rust-lang/compiler-team"),
146158
&gh,

src/github.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,9 @@ impl<'q> IssuesQuery for Query<'q> {
17121712
.with_context(|| "Unable to get issues.")?;
17131713

17141714
let fcp_map = if include_fcp_details {
1715-
crate::rfcbot::get_all_fcps().await?
1715+
crate::rfcbot::get_all_fcps()
1716+
.await
1717+
.with_context(|| "Unable to get all fcps from rfcbot.")?
17161718
} else {
17171719
HashMap::new()
17181720
};
@@ -1750,6 +1752,29 @@ impl<'q> IssuesQuery for Query<'q> {
17501752
bot_tracking_comment_content,
17511753
initiating_comment_html_url: init_comment.html_url.clone(),
17521754
initiating_comment_content: quote_reply(&init_comment.body),
1755+
disposition: fcp
1756+
.fcp
1757+
.disposition
1758+
.as_deref()
1759+
.unwrap_or("<unknown>")
1760+
.to_string(),
1761+
pending_reviewers: fcp
1762+
.reviews
1763+
.iter()
1764+
.filter_map(|r| (!r.approved).then(|| r.reviewer.clone()))
1765+
.collect(),
1766+
concerns: fcp
1767+
.concerns
1768+
.iter()
1769+
.map(|c| crate::actions::FCPConcernDetails {
1770+
name: c.name.clone(),
1771+
reviewer_login: c.reviewer.login.clone(),
1772+
concern_url: format!(
1773+
"{}#issuecomment-{}",
1774+
issue.html_url, c.comment.id
1775+
),
1776+
})
1777+
.collect(),
17531778
})
17541779
} else {
17551780
None

0 commit comments

Comments
 (0)