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] Removes tech debt of exporting all from linter rule for metrics_entities plugin in the server section #120412

Merged

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented Dec 3, 2021

Summary

See: #110903

This removes all the top level API export * spots from:

  • metrics_entities plugin within the server section

This reduces the number of metrics and warning about undocumented functions.

In the file metrics_entites/server/index.ts I now put the advice of:

// Careful of exporting anything from this file as any file(s) you export here will cause your functions to be exposed as public.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.
// When you do have to add things here you might want to consider creating a package such to share with other plugins instead as packages
// are easier to break down.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api

@FrankHassanabad FrankHassanabad changed the title [Security Solutions] Removes the server side deps for metrics and entities [Security Solutions] Removes tech debt of exporting all from linter rule for metrics_entities plugin in the server section Dec 3, 2021
@FrankHassanabad FrankHassanabad self-assigned this Dec 3, 2021
@FrankHassanabad FrankHassanabad added v8.0.0 v8.1.0 Team:Security Solution Platform Security Solution Platform Team release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed labels Dec 3, 2021
@FrankHassanabad FrankHassanabad marked this pull request as ready for review December 4, 2021 00:32
@FrankHassanabad FrankHassanabad requested a review from a team as a code owner December 4, 2021 00:32
@FrankHassanabad
Copy link
Contributor Author

@elasticmachine merge upstream

@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
metricsEntities 6 4 -2
Unknown metric groups

API count

id before after diff
metricsEntities 9 4 -5

History

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

cc @FrankHassanabad

@FrankHassanabad FrankHassanabad added the Team:Detections and Resp Security Detection Response Team label Dec 7, 2021
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

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

Code lgtm!

@FrankHassanabad FrankHassanabad merged commit 673039d into elastic:main Dec 7, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 7, 2021
## Summary

See: elastic#110903

This removes all the top level API `export *` spots from:
* `metrics_entities` plugin within the server section

This reduces the number of metrics and warning about undocumented functions.

In the file `metrics_entites/server/index.ts` I now put the advice of:

```
// Careful of exporting anything from this file as any file(s) you export here will cause your functions to be exposed as public.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.
// When you do have to add things here you might want to consider creating a package such to share with other plugins instead as packages
// are easier to break down.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0

This backport PR will be merged automatically after passing CI.

@FrankHassanabad FrankHassanabad deleted the fix-export-metrics-entities branch December 7, 2021 17:15
kibanamachine added a commit that referenced this pull request Dec 7, 2021
)

## Summary

See: #110903

This removes all the top level API `export *` spots from:
* `metrics_entities` plugin within the server section

This reduces the number of metrics and warning about undocumented functions.

In the file `metrics_entites/server/index.ts` I now put the advice of:

```
// Careful of exporting anything from this file as any file(s) you export here will cause your functions to be exposed as public.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.
// When you do have to add things here you might want to consider creating a package such to share with other plugins instead as packages
// are easier to break down.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```

Co-authored-by: Frank Hassanabad <[email protected]>
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
## Summary

See: elastic#110903

This removes all the top level API `export *` spots from:
* `metrics_entities` plugin within the server section

This reduces the number of metrics and warning about undocumented functions.

In the file `metrics_entites/server/index.ts` I now put the advice of:

```
// Careful of exporting anything from this file as any file(s) you export here will cause your functions to be exposed as public.
// If you're using functions/types/etc... internally or within integration tests it's best to import directly from their paths
// than expose the functions/types/etc... here. You should _only_ expose functions/types/etc... that need to be shared with other plugins here.
// When you do have to add things here you might want to consider creating a package such to share with other plugins instead as packages
// are easier to break down.
// See: https://docs.elastic.dev/kibana-dev-docs/key-concepts/platform-intro#public-plugin-api
```
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 Team:Security Solution Platform Security Solution Platform Team v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants