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

Cleanup Security plugin imports #93056

Merged
merged 14 commits into from
Mar 2, 2021
Merged

Conversation

jportner
Copy link
Contributor

@jportner jportner commented Mar 1, 2021

Follow-on to #91976.

Cleans up imports for the following plugins:

  • plugins/spaces_oss
  • plugins/security_oss
  • x-pack/plugins/encrypted_saved_objects
  • x-pack/plugins/security

Sort order

  1. External dependencies
  2. Internal absolute dependencies (@kbn/..., src/...)
  3. Internal relative dependencies

Each of these plugins also now requires consistent type imports (the import type directive), and I've converted relative imports to (internal) absolute imports where possible.

@jportner jportner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.13.0 labels Mar 1, 2021
This is needed to use the import sorter
Sort order
1. External dependencies
2. Internal absolute dependencies (@kbn/..., src/...)
3. Internal relative dependencies
Adds ESLint rule to enforce this.
Also got rid of imports from `'kibana/...'` in favor of
`'src/core/...'`.
For some reason a couple of Jest tests broke (snapshots had unnecessary
whitespace which is automatically removed by ESLint). I modified the
test assertions to tighten them up so the snapshots pass.
This is needed to use the import sorter
Some modules had relative imports outside of the directory when they
should not, or exports from the server when they should import directly
from common.
Sort order
1. External dependencies
2. Internal absolute dependencies (@kbn/..., src/...)
3. Internal relative dependencies
Adds ESLint rule to enforce this.
@@ -240,6 +240,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/ @elastic/kibana-core @elastic/
# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
/src/plugins/security_oss/ @elastic/kibana-security
/src/plugins/spaces_oss/ @elastic/kibana-security
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this was missing, so I added it 🙈

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
security 724.3KB 724.3KB +69.0B
triggersActionsUi 1.6MB 1.5MB -23.9KB
total -23.8KB

Page load bundle

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

id before after diff
security 131.0KB 131.2KB +150.0B
triggersActionsUi 104.0KB 104.1KB +82.0B
total +232.0B
Unknown metric groups

async chunk count

id before after diff
triggersActionsUi 41 42 +1

History

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

@jportner jportner marked this pull request as ready for review March 1, 2021 20:32
@jportner jportner requested a review from a team as a code owner March 1, 2021 20:32
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for the cleanup work!

@@ -240,6 +240,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/ @elastic/kibana-core @elastic/
# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-core
/src/plugins/security_oss/ @elastic/kibana-security
/src/plugins/spaces_oss/ @elastic/kibana-security
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding!

@jportner jportner added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 2, 2021
@jportner jportner merged commit 6ecffcc into elastic:master Mar 2, 2021
@jportner jportner deleted the cleanup-plugins branch March 2, 2021 13:42
@kibanamachine
Copy link
Contributor

💔 Backport failed

❌ 7.x: Commit could not be cherrypicked due to conflicts

To backport manually, check out the target branch and run:
node scripts/backport --pr 93056

gmmorris added a commit to gmmorris/kibana that referenced this pull request Mar 2, 2021
…bana into task-manager/docs-monitoring

* 'task-manager/docs-monitoring' of github.com:gmmorris/kibana:
  [ILM] Allow multiple searchable snapshot actions (elastic#92789)
  Improve consistency for display of management items (elastic#92694)
  skip flaky suite (elastic#93152)
  skip flaky suite (elastic#93152)
  [ILM] Refactor edit_policy client integration tests into separate feature files (elastic#92826)
  Add developer documentation about the building blocks we offer plugin developers (elastic#92743)
  [Security Solution] Case ui enhancement (elastic#91863)
  [Security Solution] [Detections] Updates warning message when no indices match provided index patterns (elastic#93094)
  Collect agent telemetry even when fleet server is disabled. (elastic#93198)
  [Lens] Fix runtime validation error message (elastic#93195)
  [Lens] Remove warning about ordinal x-domain (elastic#93049)
  [Security Solution] Fixes the Customize Event Renderers modal by removing the EuiOverlayMask (elastic#93150)
  Cleanup Security plugin imports (elastic#93056)
  [Security Solution] - Bug fixes (elastic#92294)
  Updated doc links (elastic#92968)
  [ML] Transforms: Fixes chart histograms for runtime fields. (elastic#93028)
  [chore] Enable core's eslint rule: `@ts-expect-error` (elastic#93086)
jportner added a commit that referenced this pull request Mar 2, 2021
# Conflicts:
#	.github/CODEOWNERS
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 backported release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants