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

[Fleet] Extract hook for agentList table logic #175528

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

criamico
Copy link
Contributor

Closes #131153
Follow up of #175318

Summary

Extract the main logic for agentList component in a separate hook.

Checklist

@criamico criamico self-assigned this Jan 25, 2024
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@criamico
Copy link
Contributor Author

/ci

@criamico criamico marked this pull request as ready for review January 26, 2024 16:10
@criamico criamico requested a review from a team as a code owner January 26, 2024 16:10
@criamico criamico added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 26, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@criamico criamico added the release_note:skip Skip the PR/issue when compiling release notes label Jan 26, 2024
@kpollich kpollich self-requested a review January 26, 2024 16:12
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 964 965 +1

Async chunks

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

id before after diff
fleet 1.2MB 1.2MB +1.3KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @criamico

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Love seeing hooks tested in isolation, as we didn't have much (if any) unit test style coverage of this logic before.

I think maybe a future pass at this would be to break the one gigantic hook down into smaller ones. Having a "god hook" like this has its tradeoffs (see the gigantic number of values returned by the hook), but this is an excellent improvement that helps us add test coverage to a key UI component in Fleet 🚀

@criamico
Copy link
Contributor Author

I think maybe a future pass at this would be to break the one gigantic hook down into smaller ones.

That would be great, but I didn't want to go too deep in the rabbit hole. We can then iterate on this one and maybe try to simplify some of the calls we do on that page.

@criamico criamico merged commit c6e1a25 into elastic:main Jan 29, 2024
19 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jan 29, 2024
@criamico criamico deleted the agentlist_hook branch January 29, 2024 13:34
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
Closes elastic#131153
Follow up of elastic#175318

## Summary
Extract the main logic for agentList component in a separate hook.


### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
Closes elastic#131153
Follow up of elastic#175318

## Summary
Extract the main logic for agentList component in a separate hook.


### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
Closes elastic#131153
Follow up of elastic#175318

## Summary
Extract the main logic for agentList component in a separate hook.


### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Refactor AgentListPage component
6 participants