unbridled-41 commented on PR #4891:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4891#issuecomment-5773789616
### Independent verification (isolated checkout of `c2e77a1e`)
Every citation re-read against this branch and every command in the
description re-executed from a clean checkout (`git worktree add --detach` at
the branch head, empty `target/`), so the numbers below are not reused from the
earlier runs.
**Code citations — re-verified**
- The parameter is dropped at the boundary on the base:
`AclController.listRules` declares `principal, resource, scope, decision,
instanceId, page, pageSize` only, and Spring ignores an unmatched query
parameter.
- The service hardcoded the slot on the base:
`aclRepository.findRulePage(principal, resource, scope, decision, null, …)`,
with `MybatisPlusAclRepository.ruleQuery` already carrying
`.eq(StringUtils.hasText(aclVersion), "acl_version", aclVersion)`.
- On this branch: `@RequestParam(required = false) String aclVersion` at
`AclController.java:64` forwarded at `:68`; the service signature carries it at
`AclService.java:84`, the repository call passes it at `:100`, and the
role-backed projection filters it in memory at `:93` (the role projection
reports `ACL_VERSION = "1.0"`, the same vocabulary the selector offers).
- Web side unchanged and matching: `web/src/pages/instance/acl.tsx:196`
sends it, `web/src/api/acl.ts:63` forwards it,
`web/src/services/aclService.ts:60-62` shows why mock mode looked correct, and
`web/src/api/acl.test.ts:42` describes it as a controller-supported filter —
which is true only after this change.
**Test claims — re-executed**
```
mvn -o test -Dtest='org.apache.rocketmq.studio.instance.acl.*Test,\
org.apache.rocketmq.studio.ops.ai.tool.handler.acl.*Test,\
org.apache.rocketmq.studio.provider.tencent.TencentAclServiceTest' (the
exact command in the description)
-> Tests run: 210, Failures: 0, Errors: 0 BUILD SUCCESS
mvn -o test
-> Tests run: 3153, Failures: 0, Errors: 17, Skipped: 0
```
The 17 errors are all context-load failures, in
`HealthProbeIntegrationTest`, `StudioApplicationTest`,
`AuthServiceBootstrapIntegrationTest`, `AuthServiceConcurrencyIntegrationTest`,
`AuthServiceSessionOverviewIntegrationTest`,
`QueryHistoryServiceIntegrationTest`, `NativeAlertEvaluationTransactionTest`,
`NotificationOutboxMapperIntegrationTest` and
`RmqAlertStateMapperIntegrationTest`, every one of them with
`com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link
failure` — this checkout has no MySQL. None of them is in the ACL layer (`grep
-l "Failed to load ApplicationContext" target/surefire-reports/*.txt | grep -c
acl` → 0), and the three test classes the signature change touches are green
inside that run (`AclControllerTest` 28, `AclServiceTest` 80,
`AclListToolHandlerTest` 2).
**Pre-fix failure — reproduced from the same checkout**
With the three main sources and the three mechanically updated test classes
restored to the parent revision and the new `AclRuleVersionFilterWebTest` kept:
```
Argument(s) are different! Wanted:
AclRepository#0.findRulePage(null, null, null, null, "1.0", 1, 20)
-> at
AclRuleVersionFilterWebTest.ruleListShouldApplyTheAclVersionFilterToTheQuery(:81)
Actual invocations have different arguments at position [4]:
AclRepository#0.findRulePage(null, null, null, null, null, 1, 20)
```
**Coverage**
Three layers, no redundancy: the slice test drives the real `AclService`
between the controller and a mocked repository (so it fails unless the
parameter survives both, and its second case pins that an absent version keeps
the predicate open), and
`AclServiceTest.listRulesShouldFilterTencentRulesByAclVersion` covers the
in-memory branch. The front end needs no change — it was already sending the
parameter.
--
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]