-
Notifications
You must be signed in to change notification settings - Fork 51
Fix FinOps recommendation severity sort order (#872) #874
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2176,7 +2176,7 @@ FROM cpu_utilization_stats | |
| AppLogger.Error("FinOps", $"Recommendation check failed (Reserved capacity): {ex.Message}"); | ||
| } | ||
|
|
||
| return recommendations; | ||
| return recommendations.OrderBy(r => r.SeveritySort).ToList(); | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider a tiebreaker within the same severity, e.g. Generated by Claude Code |
||
| } | ||
|
|
||
| private static string FormatDuration(long seconds) | ||
|
|
@@ -2578,6 +2578,13 @@ public class RecommendationRow | |
| public string Detail { get; set; } = ""; | ||
| public decimal? EstMonthlySavings { get; set; } | ||
| public string EstMonthlySavingsDisplay => EstMonthlySavings.HasValue ? $"${EstMonthlySavings.Value:N0}" : ""; | ||
| public int SeveritySort => Severity switch | ||
| { | ||
| "High" => 1, | ||
| "Medium" => 2, | ||
| "Low" => 3, | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Generated by Claude Code |
||
| _ => 4 | ||
| }; | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SortMemberPath="SeveritySort"here makes header-click sort match initial order — good. Note the same column exists in Dashboard atDashboard/Controls/FinOpsContent.xaml:93without aSortMemberPath, so the Dashboard FinOps Recommendations tab still has the original #872 bug (alphabetical: High, Low, Medium).Generated by Claude Code