feat(#4338): add string MetricType and migrate catalog provider - #4339
feat(#4338): add string MetricType and migrate catalog provider#4339fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add 'string' as an alternative type to MetricType in
scorecard-common so that metric providers can return status
keys directly instead of encoding them as numbers.
Migrate CatalogRequiredAttributesMetricProvider from
MetricProvider<'number'> to MetricProvider<'string'>, removing
the numeric encoding layer (buildStatusCodeMapping,
statusToCode). The provider now returns status strings
('found', 'missed', 'ok', 'invalid') directly as metric
values, with threshold expressions using string equality
(e.g. ==found) instead of numeric codes (e.g. ==0).
Changes:
- scorecard-common: extend MetricType union with 'string',
update MetricValue conditional type and EntityMetricDetail
- scorecard-node: handle 'string' type in threshold expression
parser (parseComparisonOperator), add string metric tests
- scorecard-backend-module-catalog: simplify provider to return
status strings directly, remove numeric code indirection
- scorecard-backend: update Zod schemas in action files to
include 'string' type and string values
Closes #4338
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4339 +/- ##
==========================================
- Coverage 61.38% 61.38% -0.01%
==========================================
Files 2520 2520
Lines 100936 100932 -4
Branches 28304 28305 +1
==========================================
- Hits 61958 61955 -3
+ Misses 38427 38426 -1
Partials 551 551
*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:
|
|



Add 'string' as an alternative type to MetricType in scorecard-common so that metric providers can return status keys directly instead of encoding them as numbers.
Migrate CatalogRequiredAttributesMetricProvider from MetricProvider<'number'> to MetricProvider<'string'>, removing the numeric encoding layer (buildStatusCodeMapping, statusToCode). The provider now returns status strings ('found', 'missed', 'ok', 'invalid') directly as metric values, with threshold expressions using string equality (e.g. ==found) instead of numeric codes (e.g. ==0).
Changes:
update MetricValue conditional type and EntityMetricDetail
parser (parseComparisonOperator), add string metric tests
status strings directly, remove numeric code indirection
include 'string' type and string values
Closes #4338
Post-script verification
agent/4338-string-metric-type)ee6947c241eb2aad2efcb8f6c8dd73fb24b24bf5..HEAD)