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: incident not resolved when alerts enriched from workflow #3897

Merged
merged 14 commits into from
Mar 24, 2025

Conversation

VladimirFilonov
Copy link
Contributor

Closes #3821

πŸ“‘ 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

Copy link

vercel bot commented Mar 6, 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 24, 2025 2:02pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. API API related issues Bug Something isn't working labels Mar 6, 2025
@VladimirFilonov VladimirFilonov changed the title Fix: incident not resolved when alerts enriched from workflow fix: incident not resolved when alerts enriched from workflow Mar 6, 2025
@VladimirFilonov VladimirFilonov force-pushed the fix/3821-bug-incident-not-resolved branch 2 times, most recently from e31a5ce to 19e0792 Compare March 7, 2025 09:48
@VladimirFilonov VladimirFilonov force-pushed the fix/3821-bug-incident-not-resolved branch from 081f25d to 964d3d1 Compare March 12, 2025 07:25
@VladimirFilonov VladimirFilonov force-pushed the fix/3821-bug-incident-not-resolved branch from 0b9b42f to d1a0d22 Compare March 13, 2025 13:14
@VladimirFilonov VladimirFilonov force-pushed the fix/3821-bug-incident-not-resolved branch from 1048b10 to a4f333c Compare March 22, 2025 09:33
Matvey-Kuk
Matvey-Kuk previously approved these changes Mar 22, 2025
Replaces direct environment variable manipulation with `patch.dict` for better isolation in tests. Adds `sleep` in specific test cases to ensure reliable timing and session injection in incident routes for improved handling. Minor cleanup and consistency improvements across the codebase.
Centralized session management and introduced reusable methods for enriching alerts and handling disposable enrichments. Added logic to check and resolve incidents based on enrichment updates, improving maintainability and reducing code repetition.
Cleaned up unused imports to improve code readability and maintainability. This reduces unnecessary dependencies and potential confusion for future development.
Corrected a misspelling in the test function name from "elsatic" to "elastic" to ensure clarity and consistency. No functional changes were made to the test logic.
Reorganized import statements to follow a logical structure, improving code clarity and maintainability. No functional changes introduced in this commit.
Cleaned up unused imports (IncidentStatus, ResolveOn, ActionType) in `alerts.py` to improve code maintainability and readability. This change ensures only relevant dependencies remain in the module.
Reorganized imports by moving IncidentStatus to the correct module for better clarity and maintainability. This ensures proper separation of concerns and improved code readability.
Corrected the passing of the session parameter to ensure consistency and proper handling in incidents and enrichments components. Removed unnecessary session argument in `incidents.py` and added it to `enrichments_bl.py` for better alignment.
Eliminated unnecessary imports to clean up the code and improve readability. This change has no functional impact and preserves the script's behavior.
Align the indentation of the elastic_client fixture to improve readability and code consistency. No functional changes were made to the logic or behavior of the fixture.
This prevents objects from being expired immediately after a commit, ensuring smoother access to session-bound data while processing incidents. Adjusted formatting for better readability of the resolution condition.
@VladimirFilonov VladimirFilonov enabled auto-merge (squash) March 24, 2025 14:02
@VladimirFilonov VladimirFilonov merged commit bcb6f9e into main Mar 24, 2025
12 of 13 checks passed
@VladimirFilonov VladimirFilonov deleted the fix/3821-bug-incident-not-resolved branch March 24, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API related issues Bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[πŸ› Bug]: incident not resolved
2 participants