Skip to content

[9.2] [Security Solution] Installation review pagination: Frontend (#248259)#250009

Merged
nikitaindik merged 3 commits intoelastic:9.2from
nikitaindik:backport/9.2/pr-248259
Jan 23, 2026
Merged

[9.2] [Security Solution] Installation review pagination: Frontend (#248259)#250009
nikitaindik merged 3 commits intoelastic:9.2from
nikitaindik:backport/9.2/pr-248259

Conversation

@nikitaindik
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.2:

Questions ?

Please refer to the Backport tool documentation

…#248259)

**Partially addresses: elastic#241656
**Backend PR: elastic#247375

> ⚠️ Note: This PR should be merged only when the [backend
PR](elastic#247375) is merged and
released in Serverless (after Monday 19-Jan-2026).

## Summary
This PR builds on top of the [backend
PR](elastic#247375) and adds frontend
changes for the installation review pagination.

## Changes
- If `page` parameter is not passed, it's defaulted to 1. If `per_page`
parameter is not passed it's defaulted to 20.
- UI code now sends `page` and `per_page` parameters.
- Client-side sorting and filtering was removed. It now happens on the
backend.
- Added Cypress tests to match the test plan.
- Refactored `reviewRuleInstallationHandler` to make it more readable,
as suggested in the feedback for the backend PR.

(cherry picked from commit 2a85280)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx
#	x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts
#	x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/review_installation.ts
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #8 / scripts/generate_plugin builds a generated plugin into a viable archive
  • [job] [logs] FTR Configs #52 / Stateful Observability - Deployment-agnostic AI Assistant API integration tests observability AI Assistant tool: retrieve_elastic_doc POST /internal/observability_ai_assistant/chat/complete "after all" hook for "emits 5 messageAdded events"
  • [job] [logs] FTR Configs #52 / Stateful Observability - Deployment-agnostic AI Assistant API integration tests observability AI Assistant tool: retrieve_elastic_doc POST /internal/observability_ai_assistant/chat/complete The first request enables the LLM to call retrieve_elastic_doc

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 8315 8314 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.1MB 11.1MB +1018.0B

Copy link
Copy Markdown
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikitaindik Thanks for encompassing my suggestions to the backport 🙏

The diff is pretty close to the original PR. Testing has shown it works in the expected way.

refetchInterval: 60000, // Refetch available rules for installation every minute
keepPreviousData: true, // Use this option so that the state doesn't jump between "success" and "loading" on page change
// Fetch rules to install only after background installation of security_detection_rules package is complete
enabled: isUpgradeReviewRequestEnabled({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we could have a single hook for that purpose named something like usePrebuiltRulesAvailable. It could encapsulate the dependent hooks and return the clear result. isUpgradeReviewRequestEnabled was originally related to the prebuilt rules upgrade review API endpoint.

Let's note it for the future.

}
);

const rules = useMemo(() => reviewResponse?.rules ?? [], [reviewResponse]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does't look like useMemo is required here.

const rulesMatchingFilterCount = reviewResponse?.total ?? 0;
const installableRulesCount = reviewResponse?.stats.num_rules_to_install ?? 0;

const tags = useMemo(() => reviewResponse?.stats?.tags ?? [], [reviewResponse]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does't look like useMemo is required here.

@nikitaindik nikitaindik enabled auto-merge (squash) January 23, 2026 16:23
@nikitaindik
Copy link
Copy Markdown
Contributor Author

run docs-build

@nikitaindik nikitaindik merged commit b650c97 into elastic:9.2 Jan 23, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:build-cloud-image

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants