The GitHub Actions job "CI" on 
rocketmq-dashboard.git/codex/alert-ratio-threshold-percent has failed.
Run started by GitHub user iloveeyjafjalla (triggered by iloveeyjafjalla).

Head commit for run:
c3494a38d2cf7d0eec2d153dd3b023b850f74e0b / iloveeyjafjalla <[email protected]>
fix(alerts): render legacy ratio thresholds without floating point residue

The alert rules table and the edit dialog scaled a stored ratio threshold with 
a plain * 100. Eight of the ninety-nine whole percents do not round trip in 
binary floating point, so a legacy ratio rule (no thresholdUnit, threshold 
0.29) printed '> 28.999999999999996%' and the dialog wrote that residue back as 
the percent threshold with unit '%'.

Scale through a new ratioToPercent helper that shifts the decimal point in the 
shortest round-trip decimal representation, matching 
AlertNotificationTemplate.formattedValue's BigDecimal.movePointRight(2): 0.29 
renders as 29 and 0.1234 as 12.34.

Red first (sources reverted, tests in place): '> 28.999999999999996%' vs '> 
29%' and a saved threshold of 28.999999999999996 vs 29. Green: 
AlertsPage.test.tsx 34/34, format.test.ts 29/29, the whole web/src/pages/ops 
suite 116/116, tsc -b / eslint / prettier clean.

Report URL: 
https://github.com/apache/rocketmq-dashboard/actions/runs/38585371206

With regards,
GitHub Actions via GitBox

Reply via email to