fix: parse site24x7 LABELS as dict for AlertDto compatibility#6526
Merged
Conversation
f34e0a7 to
cf72fde
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6526 +/- ##
===========================================
- Coverage 46.41% 30.54% -15.88%
===========================================
Files 176 101 -75
Lines 18443 11694 -6749
===========================================
- Hits 8561 3572 -4989
+ Misses 9882 8122 -1760 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
💪 Fantastic work @Jleee713! Your very first PR to keep has been merged! 🎉🥳 You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌 For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩💻👨💻 |
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.
Closes #6527
📑 Description
Fix
Site24X7Provider._format_alertincorrectly parsing theLABELSwebhook field as alistinstead of adict.AlertDto.labelsis typed asdict | None, so passing a list caused labels to be silently dropped by pydantic on alert ingestion.LABELSstring (e.g."env:prod,team:sre") into adict({"env": "prod", "team": "sre"})dictpayloads passthrough{}for empty/missing values✅ Checks
ℹ Additional Information
Before:
LABELSwas split into a list of strings and passed toAlertDto.labels, which expects adict— causing labels to never appear on alerts.After:
LABELSis parsed askey:valuepairs into a dict. Keys without a:separator are stored with an empty string value.