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

Removes unnecessary requests in config, inventory data or statistics #5460

Conversation

yenienserrano
Copy link
Member

@yenienserrano yenienserrano commented May 18, 2023

Description

Add to the buttons the parameter that controls if the request has to be made, and we delete a variable that was not used anywhere.

Issues Resolved

Evidence

Details

Inventory data

image

image

image

image

image

Configuration

image

Stats

image

image

Test

  1. Navigate to an agent
  2. Click on Inventory data | Stats | Configuration
  3. Check that the request is not made: GET /agents" with parameters {"agents_list": "002", "select": "status"}

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Check that the request is not made in "Stats"
Check that the request is not made in "Inventory data"
Check that the request is not made in "Configuration"

Details

⚫ Check that the request is not made in "Stats"

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Check that the request is not made in "Inventory data"

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ Check that the request is not made in "Configuration"

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@yenienserrano yenienserrano changed the title Add do not make the queries in config or inventory data Add do not make the queries in config, inventory data or stats May 19, 2023
@yenienserrano yenienserrano self-assigned this May 19, 2023
@yenienserrano yenienserrano requested a review from Desvelao May 29, 2023 09:16
@Desvelao
Copy link
Member

Test

  1. Navigate to an agent
  2. Click on Inventory data | Stats | Configuration
  3. Check that the request is not made: GET /agents" with parameters {"agents_list": "002", "select": "status"}

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Check that the request is not made in "Stats" 🟢 🟢
Check that the request is not made in "Inventory data" 🟢 🟢
Check that the request is not made in "Configuration" 🟢 🟢

Details

🟢 Check that the request is not made in "Stats"

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Check that the request is not made in "Inventory data"

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

🟢 Check that the request is not made in "Configuration"

Chrome - 🟢
image

Firefox - 🟢
image

Safari - ⚫

Desvelao
Desvelao previously approved these changes May 29, 2023
Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

review

code 🟢
test 🟢 #5460 (comment)

Copy link
Member

@Tostti Tostti left a comment

Choose a reason for hiding this comment

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

Test

  1. Navigate to an agent
  2. Click on Inventory data | Stats | Configuration
  3. Check that the request is not made: GET /agents" with parameters {"agents_list": "002", "select": "status"}

Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable

UI

Test Chrome Firefox Safari
Check that the request is not made in "Stats" 🟢 🟢
Check that the request is not made in "Inventory data" 🟢 🟢
Check that the request is not made in "Configuration" 🟢 🟢

Details

🟢 Check that the request is not made in "Stats"

Chrome - 🟢
imagen

Firefox - 🟢
imagen

Safari - ⚫

🟢 Check that the request is not made in "Inventory data" ![imagen](https://github.com/wazuh/wazuh-kibana-app/assets/42900763/0716c6f2-ec7e-48bf-8519-6344e9ed92a3)

Firefox - 🟢
imagen

Safari - ⚫

🟢 Check that the request is not made in "Configuration"

Chrome - 🟢
imagen

Firefox - 🟢
imagen

Safari - ⚫

TEST:✔️
CR:✔️

LGTM

@github-actions
Copy link
Contributor

Code coverage (Jest) % values
Statements 9.51% ( 3506 / 36866 )
Branches 5.01% ( 1434 / 28568 )
Functions 8.17% ( 747 / 9136 )
Lines 9.58% ( 3386 / 35311 )

@yenienserrano yenienserrano changed the title Add do not make the queries in config, inventory data or stats Removes unnecessary requests in config, inventory data or statistics May 29, 2023
@AlexRuiz7 AlexRuiz7 merged commit f5be86d into 4.5 May 29, 2023
@AlexRuiz7 AlexRuiz7 deleted the 5239-wazuh-api-usage-agent-inventory-data-unnecessary-query-while-accessing branch May 29, 2023 16:01
@github-actions
Copy link
Contributor

The backport to 4.5-7.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.5-7.10 4.5-7.10
# Navigate to the new working tree
cd .worktrees/backport-4.5-7.10
# Create a new branch
git switch --create backport-5460-to-4.5-7.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f5be86d213db79fb42c8af9098660c961a3e1732
# Push it to GitHub
git push --set-upstream origin backport-5460-to-4.5-7.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.5-7.10

Then, create a pull request where the base branch is 4.5-7.10 and the compare/head branch is backport-5460-to-4.5-7.10.

@github-actions
Copy link
Contributor

The backport to 4.5-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.5-7.16 4.5-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.5-7.16
# Create a new branch
git switch --create backport-5460-to-4.5-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f5be86d213db79fb42c8af9098660c961a3e1732
# Push it to GitHub
git push --set-upstream origin backport-5460-to-4.5-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.5-7.16

Then, create a pull request where the base branch is 4.5-7.16 and the compare/head branch is backport-5460-to-4.5-7.16.

yenienserrano added a commit that referenced this pull request May 30, 2023
…5460)

* Add dont make the queries in config or inventory

* Update changelog

* Fix stats request

---------

Co-authored-by: Álex Ruiz <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit f5be86d)
yenienserrano added a commit that referenced this pull request May 30, 2023
…5460)

* Add dont make the queries in config or inventory

* Update changelog

* Fix stats request

---------

Co-authored-by: Álex Ruiz <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit f5be86d)
AlexRuiz7 pushed a commit that referenced this pull request May 30, 2023
… data or statistics (#5508)

Removes unnecessary requests in config, inventory data or statistics (#5460)

* Add dont make the queries in config or inventory

* Update changelog

* Fix stats request

---------

Co-authored-by: Álex Ruiz <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit f5be86d)
AlexRuiz7 pushed a commit that referenced this pull request May 30, 2023
… data or statistics (#5507)

Removes unnecessary requests in config, inventory data or statistics (#5460)

* Add dont make the queries in config or inventory

* Update changelog

* Fix stats request

---------

Co-authored-by: Álex Ruiz <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit f5be86d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants