The bug a well-reviewed repo can't show you
说明与用途
API 返回的 cpu_hours 十进制值导致 pmss-fleet-manager 仪表盘解析错误,导致计费数据丢失。通过在 1.3.0 版本中将字段改为 *float64 解决了问题。
问题
A dashboard tool misinterpreted a decimal CPU hours value from an API, causing billing and renewal data to be blanked for affected services.
结果
The bug was fixed within 46 minutes of the pull request opening, restoring correct billing and renewal data for affected services.
工作流
- Read the dashboard source and API feed
- Identify mismatch between API decimal and dashboard int64 model
- Create test fixture with 3.4 and null
- Modify struct to use *float64
- Add tests for new parsing logic
- Merge changes via pull request
- Release v1.3.0
- Verify functionality in production
证据
Go's encoding/json will not put 3.4 into an int64; it returns an error.
The fix in release 1.3.0 is small: CPUHours *float64 json:"cpu_hours"
The fix shipped 46 minutes after the pull request opened.
- 记录日期: 2026-10-19T10:41:02.787Z