Skip to content

Commit 9b51b25

Browse files
committed
Add opt-in config for taking review preferences into account
1 parent 76b673c commit 9b51b25

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/config.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ pub(crate) struct PingTeamConfig {
9292
pub(crate) label: Option<String>,
9393
}
9494

95+
#[derive(PartialEq, Eq, Debug, serde::Deserialize)]
96+
#[serde(deny_unknown_fields)]
97+
pub(crate) struct AssignReviewPrefsConfig {}
98+
9599
#[derive(PartialEq, Eq, Debug, serde::Deserialize)]
96100
#[serde(deny_unknown_fields)]
97101
pub(crate) struct AssignConfig {
@@ -111,6 +115,9 @@ pub(crate) struct AssignConfig {
111115
pub(crate) owners: HashMap<String, Vec<String>>,
112116
#[serde(default)]
113117
pub(crate) users_on_vacation: HashSet<String>,
118+
/// Should review preferences be taken into account when deciding who to assign to a PR?
119+
#[serde(default)]
120+
pub(crate) review_prefs: Option<AssignReviewPrefsConfig>,
114121
}
115122

116123
impl AssignConfig {
@@ -656,6 +663,7 @@ mod tests {
656663
adhoc_groups: HashMap::new(),
657664
owners: HashMap::new(),
658665
users_on_vacation: HashSet::from(["jyn514".into()]),
666+
review_prefs: None,
659667
}),
660668
note: Some(NoteConfig { _empty: () }),
661669
ping: Some(PingConfig { teams: ping_teams }),
@@ -736,6 +744,7 @@ mod tests {
736744
adhoc_groups: HashMap::new(),
737745
owners: HashMap::new(),
738746
users_on_vacation: HashSet::new(),
747+
review_prefs: None,
739748
}),
740749
note: None,
741750
ping: None,

0 commit comments

Comments
 (0)