dxz0069 opened a new pull request, #7055:
URL: https://github.com/apache/rocketmq-dashboard/pull/7055

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6948
   
   ### Brief Description
   
   The step syntax gate (NUMBER_PATTERN requiring digits on both sides of a 
decimal point, no sign, no exponent) rejected ".5", "1.", "+1", "1e1", "5E-1" 
and "1e0" as "Metric query step is invalid" before dispatch, even though 
Prometheus 3.5.0 and the Studio PrometheusMetricsSource accept them.
   
   The gate now matches the Prometheus float grammar (optional sign, decimal 
point on either side of the digits, optional exponent), which BigDecimal's own 
string grammar accepts, so the step text parses and is dispatched unchanged. 
Nothing else moves: positivity and the 11,000-point sample budget remain the 
downstream checks on the parsed value - a 20-second range still rejects 
"0.001", ".001" and "1e-3" - and duration forms ("1h30m", "30s", "15s") take 
the same branch as before.
   
   ### How Did You Test This Change
   
   ```
   cd server
   mvn -B -ntp test -Dtest='MetricsServiceTest' 
-Dsurefire.failIfNoSpecifiedTests=false
   Tests run: 33, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```
   
   New tests: queryShouldAcceptPrometheusDecimalAndExponentStepFormsTest (all 
six previously rejected forms now dispatch to the source with the step text 
unchanged, on the issue's 20-second reproduction range) and 
queryShouldStillRejectSubBudgetStepsInExponentNotationTest ("0.001" / ".001" / 
"1e-3" still rejected by the sample budget, proving the widened syntax did not 
widen semantics).
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/` 
(no new UI text)
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header (existing files only)
   - [x] Documentation touched where behaviour changed (no user-visible 
behaviour change beyond accepting equivalent numeric forms)


-- 
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