tju-yxq opened a new pull request, #5198:
URL: https://github.com/apache/rocketmq-dashboard/pull/5198
### Which Issue(s) This PR Fixes
- Fixes #3150
### Brief Description
The consumer-group page's subscription-mode filter now runs on the server.
`GET /api/groups/page` accepts a `subscriptionMode` parameter; for Apache
instances `RocketMQMetadataProvider` adds a `message_model` condition to the
paginated DB query, so the returned page and its total describe the filtered
result set. Providers without a mode-aware store (cloud vendors) get an
`InstanceProvider` default that filters the full inventory before paginating,
and the legacy cluster-scoped path filters the mode over the full list the same
way — no path returns one filtered page of an unfiltered count. The page sends
the active mode with the query and the in-memory page-local filter (the source
of the "only filters the current page" desync) is removed; the mock service
filters the mode too, so mock mode matches.
### How Did You Test This Change?
Run on the branch (`672d0ef4`, based on `master` @ `0228dad5`):
```
cd server && mvn -B -ntp
'-Dtest=MetadataServiceTest,ConsumerGroupControllerTest,RocketMQMetadataProviderTest,ApacheInstanceProviderTest'
test
ConsumerGroupControllerTest: 24, MetadataServiceTest: 53,
ApacheInstanceProviderTest: 13, RocketMQMetadataProviderTest: 45
Tests run: 135, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS
cd web && npm test -- ConsumerPage --run
Test Files 2 passed (2)
Tests 38 passed (38)
cd web && npm run lint
0 errors (11 pre-existing warnings in unrelated files)
```
New coverage: the service passes a trimmed mode to the provider and treats
`ALL`/blank as no restriction; the legacy cluster-scoped path filters the mode
over the full inventory (asserting the total describes the filtered set, not
one page); the controller passes the new parameter through; the page test
switches the mode to Pop and asserts the query carries `subscriptionMode:
'Pop'`. Existing page/provider tests keep passing (the provider signatures
gained mode-aware overloads; the previous signatures delegate with no mode).
### 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/`
(no new UI text in this change)
- [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]