Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Refactor timestamp handling for incident alerts #3856

Conversation

VladimirFilonov
Copy link
Contributor

@VladimirFilonov VladimirFilonov commented Mar 5, 2025

Update incident start and last seen times to use the "lastReceived" field from alerts instead of "timestamp". Added parsing logic for string timestamps and a test to validate the timestamp handling based on varied alert data.

Closes #3822

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 5, 2025
Copy link

vercel bot commented Mar 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
keep ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2025 7:56am

@dosubot dosubot bot added the Bug Something isn't working label Mar 5, 2025
Update incident start and last seen times to use the "lastReceived" field from alerts instead of "timestamp". Added parsing logic for string timestamps and a test to validate the timestamp handling based on varied alert data.
This commit removes unused imports `DATETIME` and `parse` from `db.py` and `test_incidents.py` respectively. Cleaning up unused imports improves code readability and reduces unnecessary dependencies.
@VladimirFilonov VladimirFilonov force-pushed the fix/3822-bug-incident-started-date-is-wrong-ai-summary-doing-nothings branch from 966afe0 to 413190a Compare March 5, 2025 07:56
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 9.09091% with 10 lines in your changes missing coverage. Please review.

Project coverage is 47.55%. Comparing base (ec0bd45) to head (413190a).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
keep/api/core/db.py 9.09% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3856       +/-   ##
===========================================
+ Coverage   31.25%   47.55%   +16.30%     
===========================================
  Files          70      156       +86     
  Lines        8307    15362     +7055     
===========================================
+ Hits         2596     7306     +4710     
- Misses       5711     8056     +2345     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VladimirFilonov VladimirFilonov merged commit f16996a into main Mar 5, 2025
17 of 21 checks passed
@VladimirFilonov VladimirFilonov deleted the fix/3822-bug-incident-started-date-is-wrong-ai-summary-doing-nothings branch March 5, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: incident started date is wrong
2 participants