The GitHub Actions job "CI" on 
rocketmq-dashboard.git/fix/audit-cleanup-truncation has failed.
Run started by GitHub user unbridled-41 (triggered by unbridled-41).

Head commit for run:
82f19d775a81a4400cb7aaa00bd3c630975d41f5 / unbridled-41 
<[email protected]>
fix(audit): disclose a cleanup that hit its per-call batch ceiling

POST /audit-logs/cleanup deletes at most CLEANUP_BATCH_SIZE x 
CLEANUP_MAX_BATCHES
(500 x 20 = 10000) rows and answered with the count alone:

    return auditRepository.deleteBefore(cutoff, CLEANUP_BATCH_SIZE, 
CLEANUP_MAX_BATCHES);

and the page did not even read the count:

    await cleanupAuditLogs(cleanupDays);
    message.success(t('audit.cleanupSuccess', { n: cleanupDays }));

So a deployment with more than 10000 expired rows was told the retention window
was applied while older rows survived - the operator had to notice a stale row 
in
the refreshed list to learn otherwise, and the audit record of the cleanup 
(added
for the deletion itself) says the same "deleted=10000, SUCCESS".

Report whether the sweep hit its ceiling (a full sweep means expired rows may
remain), thread it through the endpoint response and the web client, and warn 
with
the real count instead of claiming success; a non-truncated cleanup keeps the
existing message.

Tests:
- server: cd server && mvn -o -B -ntp test 
-Dtest='AuditServiceTest,AuditControllerTest'
  -> Tests run: 32, Failures: 0, Errors: 0. New
  cleanupLogsReportsWhenTheSweepHitItsCeilingTest pins the signal (and the 
existing
  bounded-batch case now asserts truncated=false); three controller cases were
  updated to the new service return type.
- web: cd web && npx vitest run src/pages/ops/__tests__/AuditPage.test.tsx
  -> Tests 12 passed. New case "discloses a cleanup that hit the per-call cap" 
fails
  before this change (the success toast is shown) and passes after it.
- npx eslint reports no errors; npx tsc -b passes; checkstyle passes.

Report URL: 
https://github.com/apache/rocketmq-dashboard/actions/runs/37991031576

With regards,
GitHub Actions via GitBox

Reply via email to