feat(scorecard): Custom threshold keys and colors - #2378
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to 9032678
Previous suggestions✅ Suggestions up to commit 2e56c05
|
||||||||||||||||||||||||||||||||
|
Persistent suggestions updated to latest commit 9032678 |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
Eswaraiahsapram
left a comment
There was a problem hiding this comment.
Thanks @dzemanov, 🎉
I tested it in the local environment and reviewed the frontend changes, everything looks good to me.
/lgtm
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
24069be to
b6580a1
Compare
|
Rebased to resolve conflicts. |
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
|
/hold Fixing usage of custom threshold keys in annotations |
Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com>
|
|
Thank you. I also tested the latest changes and they fixed the custom threshold keys in annotations |
) * Enable custom threshold keys Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Introduce custom colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Introduce SCORECARD_THRESHOLD_RULE_COLOR_VALUES Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Unify scorecard error colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Simplify resolveStatusColor Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use constant for error state color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Unify scorecard error state handling for color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Custom threshold keys must specify color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update docs Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update reports Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix issues Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix e2e Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Rename to fix case Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update docs Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Split utils Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use statusCounts as record Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use error state color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update to include also PG config Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Prefer Number.parseInt Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix rgba colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Simplify DbAggregatedMetric computation Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix overriding custom keys by entity annotations Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> --------- Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> Co-authored-by: Eswaraiah Sapram <esapram@redhat.com>
) * Enable custom threshold keys Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Introduce custom colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Introduce SCORECARD_THRESHOLD_RULE_COLOR_VALUES Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Unify scorecard error colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Simplify resolveStatusColor Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use constant for error state color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Unify scorecard error state handling for color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Custom threshold keys must specify color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update docs Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update reports Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix issues Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix e2e Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Rename to fix case Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update docs Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Split utils Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use statusCounts as record Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Use error state color Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Update to include also PG config Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Prefer Number.parseInt Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix rgba colors Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Simplify DbAggregatedMetric computation Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> * Fix overriding custom keys by entity annotations Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> --------- Signed-off-by: Dominika Zemanovicova <dzemanov@redhat.com> Co-authored-by: Eswaraiah Sapram <esapram@redhat.com>





User description
Hey, I just made a Pull Request!
Introduces support for custom threshold keys and colors.
Users can specify colors as RGB or HEX.
Example config of custom threshold keys and colors:
Demo
✔️ Checklist
Fixes
Fixes https://issues.redhat.com/browse/RHIDP-11915
PR Type
Enhancement
Description
Support custom threshold keys with optional color configuration
Refactor aggregated metric structure to use dynamic status counts
Add color validation for hex, RGB/RGBA, and theme palette references
Unify color resolution logic across scorecard components
Expand test coverage for threshold validation and color handling
Diagram Walkthrough
File Walkthrough
3 files
Allow custom threshold keys and optional colorsAdd knex configuration for database migrationsRemove status enum constraint for custom keys15 files
Change status to string and refactor aggregated metricRefactor aggregation to use dynamic status countsRemove hardcoded aggregated metrics type definitionMap aggregated metrics with threshold-ordered status countsPass thresholds to aggregation mapperValidate custom threshold keys and color formatsAdd optional color property to threshold rulesUpdate aggregated metric types with thresholdsAdd color resolution and threshold rule color utilitiesUse threshold rule colors in legend displayPass threshold rules to status configSimplify color resolution using new utilityAdd test ID to legend color boxesUse new color resolution utilityApply threshold rule colors to pie chart segments13 files
Expand tests for aggregated metric functionalityUpdate tests for new aggregation structureAdd comprehensive mapper tests for custom thresholdsUpdate router tests for threshold parameterAdd tests for custom keys and color validationAdd tests for custom legend color renderingUpdate scorecard tests for color resolutionUpdate entity scorecard tests for threshold rulesAdd color display tests for legend itemsAdd tests for pie segment colorsUpdate test fixtures with threshold dataAdd comprehensive tests for color utilitiesAdd threshold data to mock aggregated scorecard3 files
Document custom threshold keys and color configurationUpdate API report with new color constantsAdd changeset for custom thresholds feature1 files