fix: set event in foreach AlertDto path so incident resolution check runs#6213
Open
DragonBot00 wants to merge 2 commits intokeephq:mainfrom
Open
fix: set event in foreach AlertDto path so incident resolution check runs#6213DragonBot00 wants to merge 2 commits intokeephq:mainfrom
DragonBot00 wants to merge 2 commits intokeephq:mainfrom
Conversation
|
@DragonBot00 is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Hi maintainers, this one-line fix resolves #6194 — incidents don't resolve when alerts are enriched via workflow foreach because the event variable is never set in the AlertDto path, silently skipping check_incident_resolution(). The root cause was confirmed by multiple community members. Would love to get this merged — it's been sitting for a few days. Thanks! |
…runs In BaseProvider._enrich(), when iterating over AlertDto objects in a foreach loop, the event variable was never assigned. This caused check_incident_resolution() to be silently skipped because the condition if event and should_check_incidents_resolution evaluates to False. The enrichment itself succeeds (alerts show as 'resolved' in the UI) but the incident resolution check never runs, so incidents set to 'resolve on all_resolved' stay active forever when alerts are resolved via workflow. Fix: assign event = foreach_context in the AlertDto isinstance branch. Fixes keephq#6194
031a37a to
a70b1f5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6213 +/- ##
==========================================
+ Coverage 46.41% 46.43% +0.01%
==========================================
Files 176 176
Lines 18443 18463 +20
==========================================
+ Hits 8561 8573 +12
- Misses 9882 9890 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6194
Problem: When enriching alerts to resolved via a workflow foreach loop with AlertDto objects, the incident resolution check is silently skipped.
Root Cause: In BaseProvider._enrich(), the event variable is set in the tuple path (line 221) but never set in the AlertDto path (line 223-224). The resolution check is gated on if event and should_check_incidents_resolution, so it always evaluates to False for AlertDto foreach.
Fix: One line - assign event = foreach_context in the isinstance(foreach_context, AlertDto) branch.