Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCA checks are not being paginated properly #4314

Closed
Tracked by #4155
davidjiglesias opened this issue Jul 8, 2022 · 7 comments · Fixed by #4653
Closed
Tracked by #4155

SCA checks are not being paginated properly #4314

davidjiglesias opened this issue Jul 8, 2022 · 7 comments · Fixed by #4653
Assignees
Labels

Comments

@davidjiglesias
Copy link
Member

The current implementation of the SCA checks view in the UI is not being handled properly. It is using a single API request to load all the information for all the checks, taking too long (1 to 4s depending on the number of checks), and making the UI feel unresponsive.

We can see in the following screenshot the current request without limit:

image

In this case, we have 27 pages of information being loaded in a single request:

image

We need to ensure we use proper pagination to reduce the processing time.

This issue is related to wazuh/wazuh#7354, as the problem had already been reported and investigated several times.

@Desvelao
Copy link
Member

Proposed solution

The data to retrieve of the Wazuh API endpoint should be the one to be displayed in the UI.

@Desvelao
Copy link
Member

Desvelao commented Jul 22, 2022

Research

I was implementing the proposed solution and I found a problem to display the search bar suggestions. Before the change, these suggestions are building from the fetched data, but if it now fetches only the page data, the number of suggestions will be reduced.

I was checking the SCA endpoint GET /sca/:agent_id/checks/:checks and currently don't have the distinct query parameter that could be used as it is done in Vulnerabilities/Inventory to get a subset of distinct values.

I asked for the possibility to add the distinct and select query parameters to give the possibility to don't lost funcionality in the search bar suggestions and optimize the fetched data.

Blocked by: wazuh/wazuh#14407

@Desvelao Desvelao moved this from In Progress to Blocked in Release 4.3.7 Jul 22, 2022
@Desvelao
Copy link
Member

Partial patch

I will leave a partial patch of my current development that could be useful in the future. It is not completed and requires some work to fix some things that are not working.

enhance-requests-performance-sca-checks-table.partial.txt

Target branch: 4.3-7.10.

@davidjiglesias davidjiglesias moved this to Triage in Release 4.4.0 Jul 22, 2022
@davidjiglesias davidjiglesias moved this from Triage to Blocked in Release 4.4.0 Jul 22, 2022
@asteriscos asteriscos self-assigned this Jul 29, 2022
@chantal-kelm chantal-kelm self-assigned this Jul 29, 2022
@chantal-kelm chantal-kelm moved this from Blocked to In Progress in Release 4.4.0 Aug 2, 2022
@vikman90 vikman90 added this to the Release 4.4.0 milestone Aug 31, 2022
@gdiazlo gdiazlo moved this from In Progress to Blocked in Release 4.4.0 Sep 1, 2022
@gdiazlo gdiazlo removed this from Release 4.4.0 Sep 1, 2022
@gdiazlo gdiazlo moved this to Triage in Release 4.4.0 Sep 1, 2022
@gdiazlo gdiazlo moved this from Triage to Blocked in Release 4.4.0 Sep 1, 2022
@gdiazlo
Copy link
Member

gdiazlo commented Sep 7, 2022

The API team is working on a refactor of the SCA module and its endpoints, this issue is blocked until the following issues are finished:

@AlexRuiz7 AlexRuiz7 moved this from Blocked to On Hold in Release 4.4.0 Oct 5, 2022
@AlexRuiz7 AlexRuiz7 moved this from On Hold to Blocked in Release 4.4.0 Oct 5, 2022
@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Oct 5, 2022

@chantal-kelm chantal-kelm linked a pull request Oct 6, 2022 that will close this issue
@gdiazlo gdiazlo moved this from Blocked to Todo in Release 4.4.0 Oct 11, 2022
@Machi3mfl Machi3mfl moved this from Todo to In Progress in Release 4.4.0 Oct 12, 2022
@Machi3mfl Machi3mfl moved this from In Progress to In Review in Release 4.4.0 Oct 17, 2022
Repository owner moved this from In Review to Done in Release 4.4.0 Oct 19, 2022
@Desvelao Desvelao linked a pull request Dec 19, 2022 that will close this issue
6 tasks
@Desvelao
Copy link
Member

Desvelao commented Dec 19, 2022

I reopened the issue because some work was not done in the previous PR: #4653

The UI displays duplicated buttons:
image

@Desvelao Desvelao reopened this Dec 19, 2022
@Desvelao Desvelao moved this from Done to In Review in Release 4.4.0 Dec 19, 2022
@Desvelao
Copy link
Member

Desvelao commented Dec 19, 2022

I reopened the issue because some work was not done in the previous PR: #4653

The UI displays duplicated buttons: image

It was requested to be moved to another issue: #5011

Repository owner moved this from In Review to Done in Release 4.4.0 Dec 19, 2022
@Desvelao Desvelao removed a link to a pull request Dec 20, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants