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

[Security solution] Grouping package cleanup #152820

Merged
merged 73 commits into from
Mar 8, 2023

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Mar 7, 2023

Summary

An enhancement, a bug fix, and tests for the grouping package

Enhancement: Count aggregation

  • Creates a pattern to take optional count aggregations for groupCount0 and unitCount0.
  • Updates the security solution implementation to use new count fields instead of groupsNumber and alertsCount
  • Updates grouping.tsx to show the optional counts at the appropriate time
  • Updates the default unit translation from alerts to events

Bug fix: reset pagination

  • Resets the pagination to activePage: 0 on initial load
  • Updates the pagination object returned from useGrouping to include a reset function that the consumer can call to set activePage: 0
  • Updates the security solution implementation to call pagination.reset() when the global filters update. Fixes this bug:
bug.mov

Tests

  • reducer.test.ts
  • use_grouping.test.tsx
  • use_get_group_selector.test.tsx

To do in follow up

  • Documentation
  • Rename package? @YulNaumenko can't remember where we landed on this? This is what our imports currently look like:
     import type {
       GroupingFieldTotalAggregation,
       GroupingAggregation,
       RawBucket,
     } from '@kbn/securitysolution-grouping';
     import { isNoneGroup, useGrouping } from '@kbn/securitysolution-grouping';
    

@stephmilovic stephmilovic added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore v8.8.0 labels Mar 7, 2023
@stephmilovic stephmilovic marked this pull request as ready for review March 7, 2023 14:50
@stephmilovic stephmilovic requested review from a team as code owners March 7, 2023 14:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

Awesome!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/securitysolution-grouping 16 17 +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 15.7MB 15.7MB +796.0B
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-grouping 17 18 +1

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 505 507 +2

History

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

@stephmilovic stephmilovic merged commit eef9265 into elastic:main Mar 8, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 8, 2023
sloanelybutsurely pushed a commit to sloanelybutsurely/kibana that referenced this pull request Mar 8, 2023
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
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: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants