fix(prometheus): return firing_alerts from critical_alerts()#1218
Open
NETIZEN-11 wants to merge 2 commits intokrkn-chaos:mainfrom
Open
fix(prometheus): return firing_alerts from critical_alerts()#1218NETIZEN-11 wants to merge 2 commits intokrkn-chaos:mainfrom
NETIZEN-11 wants to merge 2 commits intokrkn-chaos:mainfrom
Conversation
Review Summary by QodoFix critical_alerts() to return firing alerts properly
WalkthroughsDescription• Added missing return statement in critical_alerts() method • Method now correctly returns firing_alerts instead of None • Added Apache 2.0 license header to file • Cleaned up trailing whitespace in method Diagramflowchart LR
A["critical_alerts() method"] -->|"collects alerts"| B["firing_alerts variable"]
B -->|"missing return (bug)"| C["returns None"]
B -->|"with fix"| D["returns firing_alerts"]
D -->|"enables"| E["callers access alerts"]
File Changes1. krkn/prometheus/client.py
|
Code Review by Qodo
1. Flake8 E305 violation
|
paigerube14
reviewed
Mar 31, 2026
4c5304f to
8afc056
Compare
critical_alerts() collected alerts into a list but always returned None, making the result inaccessible to every caller. Add the missing return statement so callers can act on the firing alerts. Also adds Apache 2.0 license header. Signed-off-by: NETIZEN-11 <[email protected]>
35cca76 to
5d2dc55
Compare
Contributor
Author
|
@paigerube14 I've squashed the commits into a single commit and force-pushed the changes. Please review. |
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.
Description
This PR fixes an issue in
krkn/prometheus/client.py:return firing_alertsincritical_alerts()so that collected alerts are properly returned instead of always returningNoneAdditionally:
This PR is focused on a single fix to improve correctness and maintain consistency.
Type of change
Related Tickets & Documents
Checklist before requesting a review
Tests Performed