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

Add filter for outdated agents #6529

Merged
merged 33 commits into from Mar 22, 2024

Conversation

lucianogorza
Copy link
Member

@lucianogorza lucianogorza commented Mar 18, 2024

Description

  • Add a quick filter to the agent's table so that the user can list only the outdated agents.
  • Improve the way filtering works when clicking on the Outdated agents alert.

Issues Resolved

#6512

Evidence

outdated-filter.webm

Test

Test with 4.9.0 manager
Test with up to date and outdated agents

Command to create an outdated agent with docker:

docker run --name os-dev-2120-agent-$(date +%s) --network os-dev-2.12.0 --label com.docker.compose.project=os-dev-2120 --env WAZUH_AGENT_VERSION=4.6.0 -d ubuntu:20.04 bash -c '
  apt update -y
  apt install -y curl lsb-release
  curl -so \wazuh-agent-${WAZUH_AGENT_VERSION}.deb \
    https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${WAZUH_AGENT_VERSION}-1_amd64.deb \
    && WAZUH_MANAGER='wazuh.manager' WAZUH_AGENT_GROUP='default' dpkg -i ./wazuh-agent-${WAZUH_AGENT_VERSION}.deb

  /etc/init.d/wazuh-agent start
  tail -f /var/ossec/logs/ossec.log
'

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

Test Chrome Firefox Safari
With no outdated agents: Alert must show 0
With no outdated agents: Show only outdated filter must be off and disabled
With at least one outdated agent: Alert must show the total outdated agents
With at least one outdated agent: Show only outdated filter must be off and enabled
With at least one outdated agent: Click on alert and filter by outdated agents
With at least one outdated agent: Click on Show only outdated filter to turn on and turn off

Details

⚫ With no outdated agents: Alert must show 0

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ With no outdated agents: `Show only outdated` filter must be off and disabled

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ With at least one outdated agent: Alert must show the total outdated agents

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ With at least one outdated agent: `Show only outdated` filter must be off and enabled

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ With at least one outdated agent: Click on alert and filter by outdated agents

Chrome - ⚫

Firefox - ⚫

Safari - ⚫

⚫ With at least one outdated agent: Click on `Show only outdated` filter to turn on and turn off

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

@lucianogorza lucianogorza self-assigned this Mar 18, 2024
@lucianogorza lucianogorza linked an issue Mar 18, 2024 that may be closed by this pull request
2 tasks
@asteriscos
Copy link
Member

Tests worked OK, but I found this strange behavior. The Upgrade task details and Upgrade agents is duplicated.

image

Test Chrome Firefox Safari
With no outdated agents: Alert must show 0 🟢
With no outdated agents: Show only outdated filter must be off and disabled 🟢
With at least one outdated agent: Alert must show the total outdated agents 🟢
With at least one outdated agent: Show only outdated filter must be off and enabled 🟢
With at least one outdated agent: Click on alert and filter by outdated agents 🟢
With at least one outdated agent: Click on Show only outdated filter to turn on and turn off 🟢

Details

🟢 With no outdated agents: Alert must show 0

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With no outdated agents: `Show only outdated` filter must be off and disabled

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Alert must show the total outdated agents

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: `Show only outdated` filter must be off and enabled

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Click on alert and filter by outdated agents

Chrome - 🟢

Peek 2024-03-21 18-24

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Click on `Show only outdated` filter to turn on and turn off

Chrome - 🟢

Peek 2024-03-21 18-22

Firefox - ⚫

Safari - ⚫

Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

See the last comment.

asteriscos
asteriscos previously approved these changes Mar 21, 2024
Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

image

@JuanGarriuz
Copy link
Member

JuanGarriuz commented Mar 22, 2024

Test

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

Test Chrome Firefox Safari
With no outdated agents: Alert must show 0 🟢
With no outdated agents: Show only outdated filter must be off and disabled 🟢
With at least one outdated agent: Alert must show the total outdated agents 🟢
With at least one outdated agent: Show only outdated filter must be off and enabled 🟢
With at least one outdated agent: Click on alert and filter by outdated agents 🟢
With at least one outdated agent: Click on Show only outdated filter to turn on and turn off 🟢

Details

🟢 With no outdated agents: Alert must show 0

Chrome - 🟢:

image

Firefox - ⚫

Safari - ⚫

🟢 With no outdated agents: `Show only outdated` filter must be off and disabled

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Alert must show the total outdated agents

Chrome - 🟢

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: `Show only outdated` filter must be off and enabled

Chrome - 🟢

image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Click on alert and filter by outdated agents

Chrome - 🟢

image
image

Firefox - ⚫

Safari - ⚫

🟢 With at least one outdated agent: Click on `Show only outdated` filter to turn on and turn off

Chrome - 🟢

image
image

Firefox - ⚫

Safari - ⚫

JuanGarriuz
JuanGarriuz previously approved these changes Mar 22, 2024
Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

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

LGTM!!

@Desvelao
Copy link
Member

Desvelao commented Mar 22, 2024

ssugestion: as generic reference, when something is disabled in the UI, adding the cause could enhance the user experience.

The Show only updated switch is disabled, but I don't know the reason, I think adding it could be useful to the user.

image

@lucianogorza
Copy link
Member Author

Update 22/03/2024

Add tooltip when there are no outdated agents

image

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 28.94% ( 286 / 988 )
Branches 26.22% ( 107 / 408 )
Functions 26.87% ( 86 / 320 )
Lines 28.68% ( 278 / 969 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.08% ( 4203 / 34786 )
Branches 7.79% ( 1774 / 22762 )
Functions 10.74% ( 887 / 8258 )
Lines 12.27% ( 4092 / 33345 )

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.

LGTM!

code review 🟢
request changes 🟢

@asteriscos asteriscos merged commit c5824d7 into 4.9.0 Mar 22, 2024
4 checks passed
@asteriscos asteriscos deleted the enhancement/6512-add-filter-for-outdated-agents branch March 22, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filter for outdated agents
4 participants