Frun1na opened a new pull request, #6128:
URL: https://github.com/apache/rocketmq-dashboard/pull/6128

   ### Which Issue(s) This PR Fixes
   
   - Fixes #6125
   
   ### Brief Description
   
   `GET /api/producer/groups` dropped the brokers it could not read and 
returned a short list that
   looked complete. `RocketMQClientProvider.scanProducerGroups` already 
collected them
   (`:121-147`, 502 only when every broker fails) but `findProducerGroups` 
returned
   `scanProducerGroups(...).groups()` and threw the failures away, and the 
service and controller could
   only return `List<String>`.
   
   This is the follow-up `#4468` named in its own commit message — "The 
producer group selector behind
   `/api/producer/group` still returns a partial list with no marker. Same 
defect class, but marking it
   means changing that endpoint's contract, so it is left for a follow-up."
   
   - `RocketMQClientProvider` gains a `ProducerGroupScanResult` (in 
`cluster/client`, next to the
     connection one) and `ClientProvider.scanProducerGroups` returns it; 
`ClientProviderStub` keeps
     failing closed with 501.
   - `ProducerConnectionService.listProducerGroups` maps it onto a new 
`ProducerGroupScanVO` with
     `groups`, `complete` and `failedBrokers`, so the endpoint returns a 
`ProducerGroupScan` object
     instead of a bare array; `docs/api-spec.md` §10.2 documents the three 
fields.
   - The `RocketMQClientProviderTest` case that pinned the old silent behaviour
     (`producerGroupSelectorKeepsBestEffortResultsWhenOneBrokerFailsTest`) now 
asserts the surviving
     groups *and* `failedBrokers`/`complete`, so best-effort results still come 
back.
   
   User-visible change: the Producer page's producer group selector now shows 
an "Incomplete scan"
   warning with a tag per broker that could not be read (the same tags the page 
already shows for an
   incomplete connection scan); the suggestions themselves are unchanged. API 
consumers receive the
   completeness marker instead of an unqualified list.
   
   ### How Did You Test This Change?
   
   ```
   cd server && mvn -B -ntp test -DforkCount=1 
-Dsurefire.failIfNoSpecifiedTests=false \
     
-Dtest='ProducerConnectionServiceTest,ProducerControllerTest,RocketMQClientProviderTest,ProviderStubContractTest,ClientServiceTest'
   Tests run: 77, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS          (checkstyle: 0 violations)
   
   npx eslint src/api/producer.test.ts src/api/producer.ts 
src/pages/studio/Producer.tsx \
     src/pages/studio/__tests__/Producer.test.tsx        ✓
   npx prettier --check <the same four files>            ✓
   npx tsc -b                                            ✓
   npx vitest run src/pages/studio/__tests__/Producer.test.tsx --maxWorkers=1 
--fileParallelism=false
     Tests  17 passed (11.4s)
   ```
   
   The new cases fail without the fix. The marker is produced in the service 
and presented in the page,
   so each half was reverted on its own with the new cases kept:
   
   ```
   # service no longer forwards the scan marker (the provider and the VO stay)
   $ mvn -B -ntp test -Dtest=ProducerConnectionServiceTest
   [ERROR] 
ProducerConnectionServiceTest.listProducerGroupsShouldReportBrokersThatCouldNotBeScanned
   Expecting value to be false but was true
   Tests run: 9, Failures: 1, Errors: 0, Skipped: 0
   
   # Producer.tsx restored to trunk while the API returns the scan object
   $ npx vitest run src/pages/studio/__tests__/Producer.test.tsx --maxWorkers=1 
--fileParallelism=false
    Tests  10 failed | 7 passed (17)
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / 
`refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named 
`...Test`
   - [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit 
checks)
   - [x] New source files carry the ASF license header
   - [x] 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]

Reply via email to