Skip to content

Commit

Permalink
Pluralize merge-conflicts
Browse files Browse the repository at this point in the history
Personal preference, felt better this way.
  • Loading branch information
ehuss committed Nov 23, 2024
1 parent e4d1bc2 commit 90b7023
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) struct Config {
pub(crate) validate_config: Option<ValidateConfig>,
pub(crate) pr_tracking: Option<ReviewPrefsConfig>,
pub(crate) transfer: Option<TransferConfig>,
pub(crate) merge_conflict: Option<MergeConflictConfig>,
pub(crate) merge_conflicts: Option<MergeConflictConfig>,
}

#[derive(PartialEq, Eq, Debug, serde::Deserialize)]
Expand Down Expand Up @@ -540,7 +540,7 @@ mod tests {
validate_config: Some(ValidateConfig {}),
pr_tracking: None,
transfer: None,
merge_conflict: None,
merge_conflicts: None,
}
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mod github_releases;
mod glacier;
mod major_change;
mod mentions;
mod merge_conflict;
mod merge_conflicts;
mod milestone_prs;
mod no_merges;
mod nominate;
Expand Down Expand Up @@ -145,10 +145,10 @@ pub async fn handle(ctx: &Context, event: &Event) -> Vec<HandlerError> {
}
}

if let Some(conflict_config) = config.as_ref().ok().and_then(|c| c.merge_conflict.as_ref()) {
if let Err(e) = merge_conflict::handle(ctx, event, conflict_config).await {
if let Some(conflict_config) = config.as_ref().ok().and_then(|c| c.merge_conflicts.as_ref()) {
if let Err(e) = merge_conflicts::handle(ctx, event, conflict_config).await {
log::error!(
"failed to process event {:?} with merge_conflict handler: {:?}",
"failed to process event {:?} with merge_conflicts handler: {:?}",
event,
e
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use tokio_postgres::Client as DbClient;
use tracing as log;

/// Key for the database.
const MERGE_CONFLICT_KEY: &str = "merge-conflict";
const MERGE_CONFLICTS_KEY: &str = "merge-conflicts";

/// The amount of time to wait before scanning an unknown mergeable status.
///
Expand Down Expand Up @@ -262,7 +262,7 @@ async fn maybe_add_comment(
possibly: Option<&str>,
) -> anyhow::Result<()> {
let mut state: IssueData<'_, MergeConflictState> =
IssueData::load(db, issue, MERGE_CONFLICT_KEY).await?;
IssueData::load(db, issue, MERGE_CONFLICTS_KEY).await?;
if state.data.last_warned_comment.is_some() {
// There was already an unresolved notification, don't warn again.
return Ok(());
Expand Down Expand Up @@ -308,7 +308,7 @@ async fn maybe_hide_comment(
issue: &Issue,
) -> anyhow::Result<()> {
let mut state: IssueData<'_, MergeConflictState> =
IssueData::load(db, issue, MERGE_CONFLICT_KEY).await?;
IssueData::load(db, issue, MERGE_CONFLICTS_KEY).await?;
let Some(comment_id) = &state.data.last_warned_comment else {
return Ok(());
};
Expand Down

0 comments on commit 90b7023

Please sign in to comment.