apache / apache/rocketmq-dashboard
[Studio][Bug] Surface alert rule import conflicts and server errors
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
## Problem
The Cluster and Business Alert pages currently upload an alert-rule transfer document and call the import endpoint immediately. Operators cannot review the impact before persistence. Invalid rules abort the import without row-level diagnostics, while rules whose evaluation semantics already exist fail as duplicate conflicts with no option to skip or update the existing rule.
For a control-plane import workflow, file selection should not immediately mutate alert configuration.
## Proposed behavior
Add a two-step import workflow for both Cluster and Business alert rules:
1. Upload and parse a versioned transfer document.
2. Ask the server for a read-only preview.
3. Classify every row as `NEW`, `DUPLICATE`, or `INVALID`.
4. Show row-level validation errors and the matching existing rule for duplicates.
5. Let the operator choose a conflict strategy:
- `FAIL`: reject the apply operation when any duplicate exists.
- `SKIP`: create new rules and leave duplicate rules unchanged.
- `REPLACE`: create new rules and update the existing rule matched by semantic identity.
6. Show create / replace / skip / invalid counts and require explicit confirmation before apply.
7. Return an apply summary and refresh the rule list.
Invalid rows always block apply. The import does not delete rules.
## Compatibility
Keep the existing `POST /import` transfer endpoint for existing clients. Add dedicated preview and apply endpoints for the new workflow.
## Acceptance criteria
- Preview performs no writes.
- All rows are validated before any apply mutation.
- Duplicate matching uses Studio's existing semantic fingerprint/uniqueness definition.
- `FAIL`, `SKIP`, and `REPLACE` have deterministic results.
- Apply is transactional; a failed create/update does not leave a partial import.
- Cluster and Business domains use the same service logic.
- The UI ignores stale preview responses and cannot apply a preview after the selected file or strategy changes.
- Chinese and English text, backend/controller/API/component tests, and API documentation are included.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the existing POST /import flow for the Cluster and Business alert pages, including the server handlers and current transfer validation. Review the backend, controller, API, and component tests before defining the preview and apply paths; done means the stated conflict strategies, transactional behavior, stale-response protection, translations, tests, and API documentation are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, documentation, frontend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100