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

   ## Summary
   - `opsService.importAlertRulesTransfer` (mock mode) now tolerates a transfer 
file without a `rules` array and rules with missing fields, applying the same 
defaults as `createAlertRule`
   - Adds regression tests: a rule missing `channels` and other fields, and a 
transfer object without `rules` at all
   
   ## Why
   The transfer file is user-supplied JSON (downloaded earlier or hand-edited). 
The import mapped `data.rules` directly and copied each rule with 
`[...rule.channels]` — a missing `rules` array or a rule without `channels` 
threw a `TypeError` and aborted the whole import, even though every rule 
carries independent defaults in `createAlertRule`.
   
   ## Testing
   - `./node_modules/.bin/vitest run src/services/opsService.test.ts` → 13 
passed (2 new; verified both fail with the pre-fix service)
   - `./node_modules/.bin/tsc --noEmit` → clean
   - `./node_modules/.bin/eslint src/services/opsService.ts 
src/services/opsService.test.ts` → 0 errors
   


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