unbridled-41 opened a new pull request, #5900:
URL: https://github.com/apache/rocketmq-dashboard/pull/5900

   ### Which Issue(s) This PR Fixes
   
   Fixes #5899
   
   ### Problem / Evidence
   
   The ACL rules table sends the 版本 filter 
(`web/src/pages/instance/acl.tsx:203` -> `web/src/api/acl.ts:67`) but the value 
stopped at the HTTP boundary: `AclController.listRules` declared no 
`aclVersion` `@RequestParam` (Spring discards an unmatched parameter), the 
service signature had none, and it passed a literal `null` into a predicate 
that already existed:
   
   ```java
   // server/.../instance/acl/AclService.java:98 (before)
   return aclRepository.findRulePage(principal, resource, scope, decision, null,
           normalizedPage, normalizedPageSize);
   // MybatisPlusAclRepository.ruleQuery: .eq(hasText(aclVersion), 
"acl_version", aclVersion)
   ```
   
   Observed before the fix:
   
   ```
   AclControllerTest#listRulesShouldApplyTheAclVersionFilterTest: Argument(s) 
are different
   AclServiceTest#listRulesShouldForwardTheAclVersionFilterToTheRepositoryTest: 
repository received null
   AclServiceTest#listRulesShouldFilterTencentRulesByAclVersionTest: the 1.0 
role stayed in the 2.0 page
   ```
   
   ### Root cause / Fix
   
   Half-finished plumbing: the console, the DTO and the repository predicate 
were ready, the two hops in between were not. Bind the parameter, add the 
service overload (the 7-argument method is kept and delegates with `null`, so 
`AclListToolHandler` and the AI tools keep compiling), forward the value to the 
repository, apply the same filter to the Tencent role projection, and document 
the parameter in the API spec.
   
   ### Priority and scoring
   
   **PRIORITY 62** — impact 22/40 (a filter control silently returns a 
superset, including the vendor where versions are meaningful), blast radius 
12/20 (the ACL rules page), reproducibility 20/20 (deterministic, pinned by 
tests on both hops), maintenance value 8/20.
   
   **FIX_CONFIDENCE 95** — mechanical wiring onto an existing predicate; a 
maintainer already reviewed this shape on an earlier attempt and asked for 
exactly two things (test names ending in `Test`, and the API-spec row), both 
included here.
   
   ### Tests
   
   `cd server && mvn -o -B -ntp test -Dtest='AclServiceTest,AclControllerTest'` 
-> `Tests run: 110, Failures: 0, Errors: 0`.
   
   | Test | Before | After |
   |---|---|---|
   | 
`AclServiceTest#listRulesShouldForwardTheAclVersionFilterToTheRepositoryTest` | 
FAIL (repo got `null`) | PASS |
   | `AclServiceTest#listRulesShouldFilterTencentRulesByAclVersionTest` | FAIL 
(1.0 role in the page) | PASS |
   | `AclControllerTest#listRulesShouldApplyTheAclVersionFilterTest` | FAIL 
(parameter unbound) | PASS |
   
   Three existing controller cases were updated to the new service signature 
(same expectations, one extra `isNull()`); `mvn -o -B -ntp checkstyle:check` 
passes.
   
   ### Risk
   
   Low: an omitted parameter keeps today's behaviour (`null` predicate is 
skipped), so no caller changes semantics. The 7-argument service method remains 
as a delegating overload.


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