tju-yxq opened a new pull request, #6161:
URL: https://github.com/apache/rocketmq-dashboard/pull/6161

   > Resubmission of #5244 — the original PR and its linked issue were closed 
by the repo's 7-day stale bot while awaiting review, not because the change was 
rejected. The fix is rebased unchanged onto the current `rocketmq-studio` head 
(5e4c39b0) and the linked issue is still reproducible on trunk.
   
   > The original linked issue met the same stale fate and could not be 
reopened, so this PR fixes a fresh report of the same problem (see the linked 
issue).
   
   ### Which Issue(s) This PR Fixes
   
   - Fixes #6160
   
   ### Brief Description
   
   Adds `POST /api/system-alerts/acknowledge-all`, which accepts the same 
filter surface as the paged feed and acknowledges every unacknowledged alert 
matching those filters — across pages. Each acknowledged FIRING/REMINDER event 
ACKs its active alert state with the same rule as the single-row path (#4242), 
so reminder storms stop in one action; RESOLVED events do not touch state. The 
batch is bounded (400 beyond 10,000 alerts), transactional, and covered by one 
audit record naming the count and the active filters. The page gains a **全部确认** 
toolbar button — disabled when the loaded page has nothing unacknowledged, 
confirmation-gated with copy that states the cross-pages semantics — that 
reports the acknowledged count and refreshes to page 1.
   
   ### How Did You Test This Change?
   
   Run on the branch (`089b5833`, based on `master` @ `0228dad5`):
   
   ```
   cd server && mvn -B -ntp '-Dtest=AlertServiceTest,SystemAlertControllerTest' 
test
   AlertServiceTest: 85, SystemAlertControllerTest: 12
   Tests run: 97, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
   
   cd web && npm test -- SystemAlertsPage --run
   Test Files  1 passed (1)
        Tests  19 passed (19)
   
   cd web && npm run lint
   0 errors (11 pre-existing warnings in unrelated files)
   ```
   
   New coverage: the service test acknowledges a FIRING and a RESOLVED alert 
together and asserts both rows are acknowledged with the audit fields set, that 
only the FIRING episode ACKs its active state, and that the single batch audit 
record carries `acknowledged=2` plus the filters; a second service test rejects 
a 10,001-row result set before any write. The controller test pins the filter 
pass-through (`level`, `instanceId`) and the `{acknowledged: n}` response. The 
page tests pin the confirm-gated call (with the query filters, without 
pagination fields), the success toast with the count, and the disabled state 
when every loaded alert is already acknowledged. The repository's filter 
construction was extracted unchanged into `alertConditions` shared by the paged 
feed and the new unacknowledged query; the paged-feed tests keep passing 
unchanged.
   
   ### 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/`
   - [x] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / 
in-app help)
   
   


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