feat(#3529): move ThresholdConfig from MetricProvider to individual Metrics - #3560
Conversation
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3560 +/- ##
==========================================
- Coverage 57.34% 57.34% -0.01%
==========================================
Files 2382 2382
Lines 95615 95582 -33
Branches 26781 26768 -13
==========================================
- Hits 54833 54809 -24
+ Misses 40471 40462 -9
Partials 311 311
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
🤖 Finished Review · ✅ Success · Started 12:49 AM UTC · Completed 1:03 AM UTC |
ReviewFindingsHigh
Medium
Low
Previous runReviewFindingsCritical
Medium
Low
Info
|
|
/fs-fix |
|
🤖 Finished Fix · ❌ Failure · Started 2:42 AM UTC · Completed 4:16 AM UTC |
dzemanov
left a comment
There was a problem hiding this comment.
I went briefly through the code and looks very nice, I have only 1 small comment.
I have tested all metrics except for sonarqube, for that one I tested that metric errors correctly display as I don't have it setup.
I have tested that metrics endpoint works correctly when filtered by datasource or metric ids.
Custom thresholds in app config work. Invalid thresholds in entity annotation or app config work. Custom thresholds in entity annotations work. Aggregation cards work. Custom thresholds for statusWeight (average) aggregation cards work correctly.
Can you please add changeset with major breaking change?
Posting this as a comment to avoid blocking this as I will be on PTO.
|
/fs-fix
|
|
🤖 Fix · ❌ Terminated · Started 2:13 PM UTC · Ended 3:49 PM UTC |
1874c31 to
8fb5093
Compare
|
🤖 Finished Fix · ❌ Failure · Started 2:13 PM UTC · Completed 3:49 PM UTC |
|
🤖 Finished Review · ❌ Failure · Started 3:52 PM UTC · Completed 3:59 PM UTC |
|
/fs-fix revert the changes in workspaces/extensions/plugins/extensions/src/components/TabPanel.tsx |
|
🤖 Finished Fix · ✅ Success · Started 8:59 AM UTC · Completed 9:04 AM UTC |
8fb5093 to
dbcc8c6
Compare
🔧 Fix agent — iteration 1 (bot-triggered)No review feedback was available to address. The review body file was empty, no PR_NUMBER was set, and GH CLI was not authenticated. No code changes were made. Disagreed (1):
Tests: passed Updated by fullsend fix agent |
|
🤖 Finished Review · ✅ Success · Started 9:07 AM UTC · Completed 9:22 AM UTC |
|
/fs-fix Rename field threshold: ThresholdConfig to thresholds in Metric |
|
🤖 Finished Fix · ✅ Success · Started 9:44 AM UTC · Completed 10:03 AM UTC |
Rename the `threshold` field to `thresholds` on the Metric type per reviewer request. Updated all 29 files: type definition, API report, provider implementations, mock fixtures, and test suites. Addresses review feedback on #3560
🔧 Fix agent — iteration 1 (human-triggered)Renamed Metric.threshold to Metric.thresholds across all 29 files: type definition, API report, 6 provider source files, mock fixtures, and 16 test files. All 93 non-infrastructure test suites pass (DatabaseMetricValues failures are pre-existing due to missing native bindings). Fixed (1):
Tests: passed Updated by fullsend fix agent |
dzemanov
left a comment
There was a problem hiding this comment.
Lets merge this and fix logic problem with custom configuration in app-config.yaml being per provider instead of per metric in https://redhat.atlassian.net/browse/RHDHBUGS-3340
|
/fs-fix rebase and resolve merge conflicts |
|
🤖 Finished Fix · ✅ Success · Started 8:13 AM UTC · Completed 8:39 AM UTC |
…etrics Refactor the scorecard MetricProvider interface to move threshold configuration from provider-level methods to individual Metric objects. Core interface changes: - Add `threshold: ThresholdConfig` field to the `Metric` type - Remove `getMetricType()`, `getMetric()`, `getMetricThresholds()`, `calculateMetric()`, and `getMetricIds()` from MetricProvider - Make `getMetrics()` and `calculateMetrics()` required on MetricProvider - Consolidate single/batch provider code paths into batch-only Provider migrations: - All providers (dependabot, filecheck, github, jira, openssf, sonarqube) updated to the new interface with thresholds on metric objects - ThresholdResolver API: `resolveProviderThresholds(provider)` → `resolveMetricThresholds(metric, providerId)` - ThresholdResolver API: `resolveEntityThresholds(entity, provider)` → `resolveEntityThresholds(entity, metric, providerId)` - mergeEntityAndProviderThresholds signature updated similarly - PullMetricsByProviderTask consolidated to always use calculateMetrics() - MetricProvidersRegistry uses provider.getMetrics() for all operations All tests updated. API reports regenerated. Note: DatabaseMetricValues tests could not run (missing better-sqlite3 native binding in sandbox). All other 91 test suites (976 tests) passed. Closes #3529 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename the `threshold` field to `thresholds` on the Metric type per reviewer request. Updated all 29 files: type definition, API report, provider implementations, mock fixtures, and test suites. Addresses review feedback on #3560
The auto-merge during rebase kept an old getMetric() call from main that was not converted to the new getMetrics() API introduced by this PR. Addresses review feedback on #3560
🔧 Fix agent — iteration 2 (human-triggered)Rebased PR #3560 onto latest main (220 commits). Resolved 7 merge conflicts in test files and fixed 2 auto-merge issues (wrong snake_case IDs and unconverted old API call). All 93 non-SQLite test suites pass (1008 tests). The 3 failing suites (DatabaseMetricValues, plugin.api, mcp-tools.integration) are pre-existing failures due to missing better-sqlite3 native bindings in the sandbox. Fixed (1):
Tests: passed Decision points
Updated by fullsend fix agent |
71b81e5 to
1c6f2a5
Compare
|
We will follow up on topics we find right
|
🤖 Finished Retro · ✅ Success · Started 9:21 AM UTC · Completed 9:36 AM UTC |
Retro: PR #3560 — move ThresholdConfig from MetricProvider to individual MetricsTimeline
What went well
Key quality gaps
Proposals filed
Evidence supporting existing issues (not filing duplicates)
Proposals filed
|
Rebase on main and migrate all new metric providers to the updated MetricProvider interface from #3560. Remove deprecated single-metric methods (getMetricType, getMetric, getMetricThresholds, calculateMetric, getMetricIds) and use only getMetrics() with thresholds on each Metric object and calculateMetrics() returning a Map. All 10 test suites (37 tests) pass. Addresses review feedback on #3472
…3981) Add a "MetricProvider Architecture" section covering the MetricProvider interface, three-tier threshold resolution chain (entity annotations > app-config overrides > metric defaults), the current per-provider (not per-metric) config override limitation, review guidance for threshold granularity changes, and a key files reference table. This gives the review agent domain context about how ThresholdResolver works and why threshold granularity changes have high operational impact for cluster administrators, addressing the severity gap seen in PR #3560 where the agent rated a blocking threshold issue as Low. Closes #3979 Co-authored-by: fullsend-code <278716306+fullsend-ai-coder[bot]@users.noreply.github.com>
Rebase on main and migrate all new metric providers to the updated MetricProvider interface from #3560. Remove deprecated single-metric methods (getMetricType, getMetric, getMetricThresholds, calculateMetric, getMetricIds) and use only getMetrics() with thresholds on each Metric object and calculateMetrics() returning a Map. All 10 test suites (37 tests) pass. Addresses review feedback on #3472
Rebase on main and migrate all new metric providers to the updated MetricProvider interface from #3560. Remove deprecated single-metric methods (getMetricType, getMetric, getMetricThresholds, calculateMetric, getMetricIds) and use only getMetrics() with thresholds on each Metric object and calculateMetrics() returning a Map. All 10 test suites (37 tests) pass. Addresses review feedback on #3472








Refactor the scorecard MetricProvider interface to move threshold configuration from provider-level methods to individual Metric objects.
Core interface changes:
threshold: ThresholdConfigfield to theMetrictypegetMetricType(),getMetric(),getMetricThresholds(),calculateMetric(), andgetMetricIds()from MetricProvidergetMetrics()andcalculateMetrics()required on MetricProviderProvider migrations:
updated to the new interface with thresholds on metric objects
resolveProviderThresholds(provider)→resolveMetricThresholds(metric, providerId)resolveEntityThresholds(entity, provider)→resolveEntityThresholds(entity, metric, providerId)All tests updated. API reports regenerated.
Note: DatabaseMetricValues tests could not run (missing better-sqlite3 native binding in sandbox). All other 91 test suites (976 tests) passed.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Closes #3529
Post-script verification
agent/3529-refactor-metric-provider)b57a430ea0c48b4dff885dc812072d5eccb6e0a2..HEAD)