huskies: merge 995
This commit is contained in:
@@ -9,8 +9,6 @@ use crate::io::watcher::WatcherEvent;
|
||||
/// The notification action to take in response to a [`WatcherEvent`].
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum EventAction {
|
||||
/// Post a stage-transition notification; the event carries a known source stage.
|
||||
StageTransition,
|
||||
/// Post a merge-failure error notification.
|
||||
MergeFailure,
|
||||
/// Post a rate-limit warning (subject to config/debounce suppression).
|
||||
@@ -39,15 +37,9 @@ pub enum EventAction {
|
||||
/// Classify a [`WatcherEvent`] into the action the notification listener should take.
|
||||
pub fn classify(event: &WatcherEvent) -> EventAction {
|
||||
match event {
|
||||
WatcherEvent::WorkItem { from_stage, .. } => {
|
||||
if from_stage.is_some() {
|
||||
EventAction::StageTransition
|
||||
} else {
|
||||
// Synthetic events (creation, reassign) have no from_stage.
|
||||
// Posting a notification for these would produce incorrect messages.
|
||||
EventAction::Skip
|
||||
}
|
||||
}
|
||||
// Stage-change notifications are now handled by the TransitionFired subscriber
|
||||
// (story 995). WorkItem events are skipped regardless of from_stage.
|
||||
WatcherEvent::WorkItem { .. } => EventAction::Skip,
|
||||
WatcherEvent::MergeFailure { .. } => EventAction::MergeFailure,
|
||||
WatcherEvent::RateLimitWarning { .. } => EventAction::RateLimitWarning,
|
||||
WatcherEvent::StoryBlocked { .. } => EventAction::StoryBlocked,
|
||||
@@ -77,10 +69,12 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
// Stage-change notifications moved to TransitionFired subscriber (story 995).
|
||||
// All WorkItem events are now classified as Skip regardless of from_stage.
|
||||
#[test]
|
||||
fn work_item_with_from_stage_is_stage_transition() {
|
||||
fn work_item_with_from_stage_is_skip() {
|
||||
let event = work_item(Some("2_current"));
|
||||
assert_eq!(classify(&event), EventAction::StageTransition);
|
||||
assert_eq!(classify(&event), EventAction::Skip);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user