Summary
The daily-sparkline coverage call sets both Granularity and GroupBy on GetReservationCoverage, which the API documents as mutually exclusive. Every real call returns a ValidationException, which the caller logs at warning level and swallows, so the per-row usage-history feature is dead in production while collection looks healthy. Mock-backed tests stay green because none of them assert Granularity on this input.
Location
providers/aws/recommendations/usage_history.go:85 at 3c0f8ac94048a2c36fce5ccddee54e6c4849a5cd
Failure scenario
The GetReservationCoverage SDK operation doc states "If GroupBy is set, Granularity can't be set." fetchDailyCoverage sets both, so every real call returns a ValidationException. AttachDailyUsageHistory logs the error at WARN and continues, so the entire per-row usage-history feature is dead in production while the collection looks healthy. No test asserts Granularity on this input (the three GranularityDaily assertions in the package are in ondemand_series_test.go and sp_coverage_test.go, whose operations do accept it), which is why mock-backed tests stay green. The sibling path in coverage.go correctly omits Granularity when it sets GroupBy.
Evidence
input := &costexplorer.GetReservationCoverageInput{
TimePeriod: &types.DateInterval{...},
Granularity: types.GranularityDaily,
GroupBy: []types.GroupDefinition{
{Type: types.GroupDefinitionTypeDimension, Key: aws.String(string(types.DimensionInstanceType))},
},
Filter: dailyUsageFilter(serviceFilter, region),
Metrics: []string{"Hour"},
}
Suggested fix
Drop the Granularity field (the response is already per-day when the time period is daily-resolvable), and assert its absence in the test so the pair cannot be reintroduced.
Found by the 2026-09-02 codebase audit, finding A07-010, reported by one reviewer and independently confirmed by a second. Full report: docs/audits/codebase-audit-2026-09-02.md.
Summary
The daily-sparkline coverage call sets both
GranularityandGroupByonGetReservationCoverage, which the API documents as mutually exclusive. Every real call returns a ValidationException, which the caller logs at warning level and swallows, so the per-row usage-history feature is dead in production while collection looks healthy. Mock-backed tests stay green because none of them assertGranularityon this input.Location
providers/aws/recommendations/usage_history.go:85at 3c0f8ac94048a2c36fce5ccddee54e6c4849a5cdFailure scenario
The
GetReservationCoverageSDK operation doc states "If GroupBy is set, Granularity can't be set."fetchDailyCoveragesets both, so every real call returns a ValidationException.AttachDailyUsageHistorylogs the error at WARN and continues, so the entire per-row usage-history feature is dead in production while the collection looks healthy. No test assertsGranularityon this input (the threeGranularityDailyassertions in the package are in ondemand_series_test.go and sp_coverage_test.go, whose operations do accept it), which is why mock-backed tests stay green. The sibling path in coverage.go correctly omitsGranularitywhen it setsGroupBy.Evidence
Suggested fix
Drop the
Granularityfield (the response is already per-day when the time period is daily-resolvable), and assert its absence in the test so the pair cannot be reintroduced.Found by the 2026-09-02 codebase audit, finding
A07-010, reported by one reviewer and independently confirmed by a second. Full report:docs/audits/codebase-audit-2026-09-02.md.