Skip to content

Commit c24d863

Browse files
committed
Block acceptance and second of major change under active rfcbot FCP
1 parent 8a6d967 commit c24d863

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/handlers/major_change.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::fmt::Display;
22

33
use crate::errors::user_error;
44
use crate::jobs::Job;
5+
use crate::utils::is_issue_under_rfcbot_fcp;
56
use crate::zulip::api::Recipient;
67
use crate::{
78
config::MajorChangeConfig,
@@ -262,6 +263,13 @@ pub(super) async fn handle_command(
262263
return user_error!("Only team members can second issues.");
263264
}
264265

266+
// Verify that this issue isn't a rfcbot FCP
267+
if is_issue_under_rfcbot_fcp(&issue.repository().full_repo_name(), issue.number).await {
268+
return user_error!(
269+
"Cannot second a major change on an active [rfcbot](https://rfcbot.rs/) FCP."
270+
);
271+
}
272+
265273
let has_concerns = if let Some(concerns_label) = &config.concerns_label {
266274
issue.labels().iter().any(|l| &l.name == concerns_label)
267275
} else {
@@ -474,6 +482,7 @@ enum SecondedLogicError {
474482
at: DateTime<Utc>,
475483
},
476484
NoMajorChangeConfig,
485+
UnderRfcBotFcp,
477486
}
478487

479488
impl std::error::Error for SecondedLogicError {}
@@ -506,6 +515,7 @@ impl Display for SecondedLogicError {
506515
write!(f, "concerns label added at {at}")
507516
}
508517
SecondedLogicError::NoMajorChangeConfig => write!(f, "no `[major_change]` config"),
518+
SecondedLogicError::UnderRfcBotFcp => write!(f, "under rfcbot fcp"),
509519
}
510520
}
511521
}
@@ -679,6 +689,10 @@ async fn try_accept_mcp(
679689
open: issue.is_open()
680690
});
681691
}
692+
693+
if is_issue_under_rfcbot_fcp(&major_change.repo, major_change.issue).await {
694+
anyhow::bail!(SecondedLogicError::UnderRfcBotFcp);
695+
}
682696
}
683697

684698
if !issue.labels.iter().any(|l| l.name == config.accept_label) {

0 commit comments

Comments
 (0)