nawei123 opened a new pull request, #6920: URL: https://github.com/apache/rocketmq-dashboard/pull/6920
### Which Issue(s) This PR Fixes Fixes #6919 ### Brief Description Editing or duplicating an existing native usage-ratio rule with no stored unit depends on successful metric-capability discovery to convert its threshold to percentage points. Saving or testing while that request is pending, or after it fails, submits `0.29%` for a stored threshold meaning `29%`. A delayed response can also overwrite a threshold the operator has already edited. Initialize the legacy threshold and `%` unit together when opening Edit or Duplicate. Capability discovery now populates metric choices without rewriting the current threshold. Existing percentage values, non-ratio native units, and legacy built-in metrics keep their values. Document the migration behavior. ### How Did You Test This Change? Base: `apache/rocketmq-dashboard`, `rocketmq-studio`, `c34535db0819d02f68e50a856cb3d2614f0dc5dd`. Local change: `c52d6e6`. - Added nine real-component cases. With the production source restored to the exact baseline, six regressions fail and three compatibility controls pass. The failing save requests are actually sent once with the incorrect value; this is not a form-validation failure. - Fixed `AlertsPage.test.tsx`: **46/46 passed**. Cases cover edit and duplicate, all three native ratio metrics, pending/failed discovery, late success after an operator edit, Test Run, existing `%` units, non-ratio native metrics, and legacy built-in metrics. - Entire frontend: **1769 passed, 2 failed, 161 files**. The failures are in untouched `Producer.test.tsx` (topic-select pointer interaction) and `UserManagement.test.tsx` (export before search debounce commits). The former reproduces on the exact unmodified base. The latter passes in the isolated base run but fails under the full suite; existing PR #5866 addresses that same test timing defect. Overall local frontend CI is **not claimed green**. - Production build, TypeScript and packaged license verification passed (132 components, 139 license files). - License-script tests: **5/5 passed**. - Full frontend lint: **0 errors, 10 existing warnings**. Changed-file formatting and whitespace checks passed. - Patch application verified against a clean checkout of the exact upstream base. No backend code changed; Java/Go or real broker/database integration tests were not run. AI assistance was used to investigate, implement, review, and verify this change. No maintainer approval or remote CI success is claimed. Commands run from `web/`: ```text npm test -- src/pages/ops/__tests__/AlertsPage.test.tsx # 46 passed npm test # 1769 passed, 2 failed (details above) npm run lint # 0 errors, 10 warnings npm run build # passed, including license check npm run license:test # 5 passed npx prettier --check src/pages/ops/alerts.tsx src/pages/ops/__tests__/AlertsPage.test.tsx ``` ### Checklist - [x] One coherent change; unrelated modifications are not bundled in - [x] Commit subject follows Conventional Commits - [x] Tests added for the non-trivial change - [x] Documentation updated where behavior changed - No new UI text or source files; translation entries and new-file license headers are not applicable. - Backend architecture checks were not run; no backend files changed. -- 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]
