You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Loyal-Young (via GitHub)" <gi...@apache.org> on 2026/10/12 17:05:48 UTC
[PR] fix(alert): validate Prometheus duration unit order [rocketmq-dashboard]
Loyal-Young opened a new pull request, #6451:
URL: https://github.com/apache/rocketmq-dashboard/pull/6451
### Which Issue(s) This PR Fixes
Fixes #6450
### Brief Description
Require each unit in an alert duration at most once, in descending order, matching [Prometheus's duration parser](https://github.com/prometheus/common/blob/main/model/time.go). Previously `1s1m` and `1m1m` passed request validation and were exported verbatim into an unusable rule file.
The exporter already shares this pattern, so legacy values with invalid unit order now use its existing `5m` fallback. Native reminder-interval parsing is unchanged. This change enforces unit order; it does not add numeric-range validation for Prometheus durations.
### How Did You Test This Change?
- Java 21 Maven tests: `AlertRuleRequestDTOTest,AlertServiceTest,AlertRuleTransferDTOTest`: **103 passed**, no failures/errors/skips.
- Regression run before the fix: six failures (five invalid-order request cases and the legacy export regression).
- Controls include all supported units, mixed minute/millisecond suffixes, zero, valid compounds, empty text and fractional syntax.
- Checkstyle: 0 violations; `git diff --check`: passed.
No live Prometheus or full Maven suite was run. The snapshot contains no ArchitectureTest class; no ArchUnit execution is claimed.
### Checklist
- [x] One coherent fix and regression tests
- [x] No new files, dependencies or UI strings
### AI Assistance
AI assistance was used to compare the input pattern with Prometheus's parser, draft the fix and regression cases, 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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(alert): validate Prometheus duration unit order [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #6451:
URL: https://github.com/apache/rocketmq-dashboard/pull/6451
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org