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 Solutions] Re-arranges and adds more packages to remove copied code #100310

Merged

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented May 19, 2021

Summary

  • Creates a securitysolution-list-utils packaged and moves the first set of utilities into there
  • Fixes a slight bug with kbn-securitysolution-io-ts-list-types where the wrong name was used
  • Moves all of the lists schemas and types into the package kbn-securitysolution-io-ts-list-types
  • Removes copied code found in a few places

Tech debt

  • Some spots I have to use an any in the package as Kibana kbn packages don't have the types I need
  • Some spots I copy constants until we can straighten out those pieces.
  • I keep copied mock files until we figure out how to share mocks from these packages without adding weight or we create dedicated mock packages for all of this.

Checklist

@FrankHassanabad FrankHassanabad self-assigned this May 19, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lists 194 210 +16
securitySolution 2104 2179 +75
total +91

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
lists 207 191 -16

Async chunks

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

id before after diff
lists 55.2KB 74.4KB +19.2KB
securitySolution 6.8MB 6.9MB +72.9KB
total +92.2KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
lists 58 55 -3

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lists 188.8KB 190.6KB +1.8KB
Unknown metric groups

API count

id before after diff
lists 229 210 -19

References to deprecated APIs

id before after diff
lists 271 236 -35
securitySolution 389 380 -9
total -44

History

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

cc @FrankHassanabad

@FrankHassanabad FrankHassanabad marked this pull request as ready for review May 19, 2021 19:59
@FrankHassanabad FrankHassanabad requested review from a team as code owners May 19, 2021 19:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@FrankHassanabad FrankHassanabad added release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed labels May 19, 2021
"src/plugins/management"
],
"lists": "packages/kbn-securitysolution-list-utils/src",
"management": ["src/legacy/core_plugins/management", "src/plugins/management"],
Copy link
Member

Choose a reason for hiding this comment

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

Ping-pong on the auto-formatter...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this change is so large I am going to leave it. Wish my editor hadn't done this.

Comment on lines +4 to +6
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
Copy link
Member

Choose a reason for hiding this comment

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

For posterity -- the kbn packages use the newer v2 license but plugins do not, so that's why there's these license changes.

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for all the heavy lifting here in moving everything around. It get's tedious, but makes a large impact, so thank you! 🙂

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

That LGTM after @jbudz windows testing

@FrankHassanabad FrankHassanabad changed the title Re-arranged and added packages [Security Solutions] Re-arranges and adds more packages to remove copied code May 19, 2021
@FrankHassanabad FrankHassanabad merged commit 9bf488e into elastic:master May 19, 2021
@FrankHassanabad FrankHassanabad deleted the add-more-list-packages branch May 19, 2021 21:59
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 19, 2021
…ied code (elastic#100310)

## Summary

* Creates a `securitysolution-list-utils` packaged and moves the first set of utilities into there
* Fixes a slight bug with `kbn-securitysolution-io-ts-list-types` where the wrong name was used
* Moves _all_ of the lists schemas and types into the package `kbn-securitysolution-io-ts-list-types`
* Removes copied code found in a few places

## Tech debt
* Some spots I have to use an `any` in the package as Kibana kbn packages don't have the types I need
* Some spots I copy constants until we can straighten out those pieces.
* I keep copied mock files until we figure out how to share mocks from these packages without adding weight or we create dedicated mock packages for all of this. 


### Checklist

- [x] [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
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request May 19, 2021
…ied code (#100310) (#100369)

## Summary

* Creates a `securitysolution-list-utils` packaged and moves the first set of utilities into there
* Fixes a slight bug with `kbn-securitysolution-io-ts-list-types` where the wrong name was used
* Moves _all_ of the lists schemas and types into the package `kbn-securitysolution-io-ts-list-types`
* Removes copied code found in a few places

## Tech debt
* Some spots I have to use an `any` in the package as Kibana kbn packages don't have the types I need
* Some spots I copy constants until we can straighten out those pieces.
* I keep copied mock files until we figure out how to share mocks from these packages without adding weight or we create dedicated mock packages for all of this. 


### Checklist

- [x] [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

Co-authored-by: Frank Hassanabad <[email protected]>
yctercero pushed a commit to yctercero/kibana that referenced this pull request May 25, 2021
…ied code (elastic#100310)

## Summary

* Creates a `securitysolution-list-utils` packaged and moves the first set of utilities into there
* Fixes a slight bug with `kbn-securitysolution-io-ts-list-types` where the wrong name was used
* Moves _all_ of the lists schemas and types into the package `kbn-securitysolution-io-ts-list-types`
* Removes copied code found in a few places

## Tech debt
* Some spots I have to use an `any` in the package as Kibana kbn packages don't have the types I need
* Some spots I copy constants until we can straighten out those pieces.
* I keep copied mock files until we figure out how to share mocks from these packages without adding weight or we create dedicated mock packages for all of this. 


### Checklist

- [x] [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
ashokaditya added a commit to ashokaditya/kibana that referenced this pull request Mar 29, 2022
ashokaditya added a commit that referenced this pull request Mar 29, 2022
…#128810)

* Show creation success toast on adding first event filter

fixes /issues/128444

* clean up redundant type imports

refs /pull/100310/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants