feat: paginate alert rules - #2590
Open
tju-yxq wants to merge 1 commit into
Open
Conversation
RockteMQ-AI
approved these changes
Aug 25, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM — code changes look good.
Automated review by github-manager-bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2589
Summary
GET /api/alert-rules/pagewith name search, enabled filter, bounded page, and bounded page sizename ASC, id ASCordering in SQL through MyBatis-PlusPagetoggleRulewith directfindRuleByIdfindRulesByIdsqueryWhy
The page previously fetched every rule and rendered it with
pagination={false}. Toggling one rule also scanned the complete inventory, and bulk toggle read all rules to resolve a small ID list. This makes the read path bounded by page size and makes targeted mutations use targeted lookups.Tests
AlertServiceTest, AlertRuleControllerTest, MybatisPlusAlertRepositoryTest— 80 tests passed, Checkstyle 0 violationsAlertsPage.test.tsx, opsService.test.ts, ops.test.ts— 3 files / 32 tests passedRocketMQMessageProviderTestfailures remain, reproduced earlier on untouched upstream14da4b95npm run lint -- --quiet: 0 errors, 2 pre-existing warningsnpm run build: passedgit diff --check: passedProduction changes: 176 additions / 48 deletions across backend and frontend, naturally exceeding 100 production lines without test padding.
Note
I also checked open PR #2533. Its later commits already contain a broader native-alerting implementation with alert-rule pagination, but that PR is still open and has been rebased several times. This PR is intentionally scoped to the current upstream code path, avoids the unrelated native-alerting domain changes, and provides a smaller standalone fix. If maintainers prefer to land #2533 first, this PR can be rebased or closed as superseded.