fix(site24x7): resolve status always firing and tags never forwarded#6201
Open
Spirax-M1 wants to merge 1 commit intokeephq:mainfrom
Open
fix(site24x7): resolve status always firing and tags never forwarded#6201Spirax-M1 wants to merge 1 commit intokeephq:mainfrom
Spirax-M1 wants to merge 1 commit intokeephq:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the KeepHQ Team on Vercel. A member of the Team first needs to authorize it. |
…eephq#6195, keephq#6196) - Add STATUS_MAP to correctly map "UP" → RESOLVED and DOWN/TROUBLE/CRITICAL → FIRING; previously _format_alert() never passed `status` to AlertDto so it always defaulted to FIRING via the root_validator fallback. - Parse TAGS field from webhook payload into AlertDto.labels; supports comma-separated "key:value" pairs, plain tag names, and dict payloads. - Add `source=["site24x7"]` which was missing from _format_alert(). - Add 16 unit tests covering all STATUS values, tag parsing edge cases, and core fields. Closes keephq#6195 Closes keephq#6196 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17b720d to
a39a24d
Compare
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.
Summary
Fixes two bugs in the Site24x7 provider webhook handler.
Bug #6195 — Alert status always remains "firing" even after recovery
_format_alert()never passedstatus=toAlertDto, so pydantic's root_validator always defaulted toAlertStatus.FIRING. AddedSTATUS_MAPto correctly mapUP → RESOLVEDandDOWN/TROUBLE/CRITICAL → FIRING.Bug #6196 — Tags/labels never forwarded from webhook payload
_format_alert()ignored theTAGSfield entirely. Site24x7 sends tags as comma-separatedkey:valuepairs (e.g.env:prod,team:backend). Now parsed intoAlertDto.labels.Bonus
Added missing
source=["site24x7"]to_format_alert().Tests
16 new unit tests added in
tests/providers/site24x7_provider/test_site24x7_bugs.py, all passing.Closes #6195
Closes #6196