elephone-184 opened a new pull request, #5151: URL: https://github.com/apache/rocketmq-dashboard/pull/5151
## What is the purpose of the change The existing `BrokerConfigDiffService.compare` path provides an essential view of cluster property divergence across reachable brokers. However, all detected differences are surfaced uniformly without severity classification, making it hard for operators to discern benign operational variances (e.g. `deleteWhen` timing) from critical replication failure modes (e.g. `flushDiskType` SYNC vs ASYNC divergence). Furthermore, operators previously had no quantitative consistency score or actionable remediation advice. In accordance with Maintainer feedback on PR #4975, this PR enriches the existing `BrokerConfigDiffVO` and `compare` flow rather than introducing a parallel endpoint or swallowing unreachable broker failures: 1. `BrokerConfigDiffVO` enrichment: Adds `consistencyScore` (0.0% ~ 100.0%), `clusterPosture` (`SYNCHRONIZED`, `DRIFT_DETECTED`, `CRITICAL_DRIFT`), and `operationalSuggestions`. 2. `ConfigDifferenceVO` enrichment: Adds `severity` (`CRITICAL`, `HIGH`, `MEDIUM`), `impactDescription`, and `remediationAdvice`. 3. `BrokerConfigDriftEvaluator`: Dedicated helper component to evaluate differences against standard properties (`flushDiskType`, `autoCreateTopicEnable`, `maxMessageSize`, `brokerPermission`, `fileReservedTime`), preserving reachability reporting intact. 4. Web UI Integration: Updates `ClusterPage` Broker Config Diff modal to display `Consistency Score` badge, `Cluster Posture` tag, `Severity` column, and actionable recommendations. 5. Documentation & Tests: Updates `docs/api-spec.md` (ยง4.4.1) and provides comprehensive unit tests adhering to the project's `...Test` method naming convention. ## Brief changelog - Enrich `BrokerConfigDiffVO.java` and `ConfigDifferenceVO` with consistency score, posture, severity, and advice. - Add `BrokerConfigDriftEvaluator.java` and integrate into `BrokerConfigDiffService.java`. - Update `web/src/api/cluster.ts` and `web/src/pages/cluster/index.tsx` to render the enriched fields in the modal. - Document the enriched endpoint in `docs/api-spec.md`. - Add `BrokerConfigDriftEvaluatorTest.java` and expand `BrokerConfigDiffServiceTest.java`. ## Verifying this change - `BrokerConfigDriftEvaluatorTest`: verifies synchronized clusters, critical flush mode divergence, high/medium property classification, and impact descriptions. - `BrokerConfigDiffServiceTest`: verifies integration with existing broker reachability and comparison logic. - `ClusterPage.test.tsx`: verifies UI render compatibility with the enriched diff result. -- 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]
