RockteMQ-AI commented on code in PR #2132:
URL:
https://github.com/apache/rocketmq-dashboard/pull/2132#discussion_r3776382388
##########
server/src/test/java/com/rocketmq/studio/ops/audit/AuditServiceTest.java:
##########
@@ -107,6 +109,35 @@ void queryLogsShouldReturnEmptyWhenPageExceedsTotal() {
assertThat(result.getTotal()).isEqualTo(1);
}
+ @Test
Review Comment:
Test annotations appear as file path strings (e.g.,
`@apache_rocketmq/auth/src/test/...`) instead of `@Test`. This looks like a
diff-rendering artifact or tooling corruption — these test methods will not be
discovered by JUnit and will silently not run.
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,54 @@
+name: CI
Review Comment:
PR title is `feat(web): follow system theme changes` but the project
convention requires `[Studio] feat: follow system theme changes`. The `(web)`
scope notation and missing `[Studio]` prefix are both non-conformant.
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,54 @@
+name: CI
+
+# 检测前端与后端是否都能正确编译
+on:
+ push:
+ branches:
+ - rocketmq-studio
+ pull_request:
+ branches:
+ - rocketmq-studio
+
+jobs:
+ backend-build:
+ name: Backend Build (Java 21)
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: server
+ steps:
+ - name: Checkout
Review Comment:
GitHub Actions step references use malformed paths (e.g., `actions/checkout
@apache_rocketmq-clients/cpp/third_party/asio/...`) instead of pinned versions
like `actions/checkout@v4`. These workflow steps will fail to run entirely — CI
is completely broken as submitted.
##########
server/src/main/java/com/rocketmq/studio/ops/audit/AuditService.java:
##########
@@ -47,20 +49,33 @@ public PageResult<AuditRecordVO> queryLogs(int page, int
pageSize, String search
List<AuditRecordVO> allRecords = auditRepository.findAll(search,
operationType, start, end, result);
Review Comment:
`queryLogs` loads all records into memory via `auditRepository.findAll(...)`
before paginating in-process. For large audit log datasets this will cause high
memory pressure and slow responses. Pagination should be pushed down to the
repository layer.
##########
.claude/skills/pr-review/SKILL.md:
##########
@@ -0,0 +1,265 @@
+---
Review Comment:
Adding a skill definition document to the repository is an unusual inclusion
in a feature PR about system theme following. This file documents internal
tooling workflows and should either live in a separate PR or be excluded from
the feature branch entirely.
##########
server/src/main/java/com/rocketmq/studio/ops/audit/AuditService.java:
##########
@@ -47,20 +49,33 @@ public PageResult<AuditRecordVO> queryLogs(int page, int
pageSize, String search
List<AuditRecordVO> allRecords = auditRepository.findAll(search,
operationType, start, end, result);
long total = allRecords.size();
- int fromIndex = Math.min((page - 1) * pageSize, allRecords.size());
- int toIndex = Math.min(fromIndex + pageSize, allRecords.size());
+ long offset = (long) (page - 1) * pageSize;
+ int fromIndex = (int) Math.min(offset, allRecords.size());
+ int toIndex = (int) Math.min((long) fromIndex + pageSize,
allRecords.size());
List<AuditRecordVO> pageRecords = allRecords.subList(fromIndex,
toIndex);
return PageResult.of(pageRecords, total, page, pageSize);
}
Review Comment:
Input validation in `validatePagination` and `cleanupLogs` throws
`BusinessException` with a hardcoded HTTP status code (400). Ensure the global
exception handler maps `BusinessException` codes to HTTP responses correctly;
otherwise callers may receive a 500 with the message buried inside.
--
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]