Loyal-Young opened a new pull request, #6447:
URL: https://github.com/apache/rocketmq-dashboard/pull/6447

   ### Which Issue(s) This PR Fixes
   
   Fixes #6444
   
   ### Brief Description
   
   Only cast an integral threshold to long when it is inside the actual long 
range. Larger finite doubles retain their numeric literal in the exported 
Prometheus expression instead of saturating at Long.MIN_VALUE/MAX_VALUE. The 
upper comparison is exclusive because Long.MAX_VALUE rounds to 2^63 when 
promoted to double.
   
   ### How Did You Test This Change?
   
   - Java 21 `mvn -B -ntp test -Dtest=AlertServiceTest`: **94 passed**, no 
failures/errors/skips.
   - Ten export cases parse the generated YAML and compare the expression's 
numeric value: both long boundaries, their neighboring doubles, 
positive/negative 1e20, Double.MAX_VALUE, an ordinary integer and a fraction.
   - Five numeric round-trip cases failed before the fix. An additional 
assertion checks the positive boundary cannot silently use Long.MAX_VALUE's 
digits despite float rounding masking that saturation.
   - Maven Checkstyle: 0 violations; `git diff --check`: passed.
   
   No live Prometheus, broker/database integration or full Maven suite was run. 
No ArchitectureTest class exists in the snapshot; no ArchUnit execution is 
claimed.
   
   ### Checklist
   
   - [x] One coherent fix with a regression test ending in `Test`
   - [x] Conventional Commit subject; no new files or UI strings
   
   ### AI Assistance
   
   AI assistance was used to inspect the export conversion, draft boundary 
cases and the range guard, and execute the listed checks.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to