-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[eslint] no_restricted_paths config cleanup #63741
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
Conversation
|
Pinging @elastic/uptime (Team:uptime) |
c746917 to
1f0484b
Compare
12d95a3 to
06695cd
Compare
Major cleanup of the no_restricted_paths rule for imports of core. For relative imports, we use eslint-module-utils/resolve which resolves to the full filesystem path. So, to support relative and absolute imports from the src alias we need to define both the directory and the index including file extension. This rule was handling both core imports, as well as imports from other plugins. Imports from other plugins are being used much more liberally allowed through the exceptions in tests. I choose to break these up, removing this exception for tests for core imports. Fixes: Absolute imports of src/core/server/mocks were not allowed in src. This was not an issue in x-pack due to the target excluding !x-pack/**/*.test.* and !x-pack/test/**/*. Non-top-level public and server imports were allowed from X-Pack tests to the previously mentioned exclusion. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
| export { | ||
| HttpHeadersInit, | ||
| HttpRequestInit, | ||
| HttpFetchError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we OK with this? It's being requested from tests, so either we can add src/core/public/http as an exception to the ESLint rule, or we can exempt tests from requiring top level imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @elastic/kibana-platform
jen-huang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ingest manager changes LGTM
|
Pinging @elastic/kibana-operations (Team:Operations) |
|
Pinging @elastic/kibana-platform (Team:Platform) |
joshdover
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to test this locally still, but a couple comments
jportner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security changes LGTM.
patrykkopycinski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIEM changes LGTM 💪
cjcenizal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes to Upgrade Assistant LGTM, didn't test locally.
mikecote
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alerting code LGTM
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
|
Waiting for #64306 to be merged before backporting to 7.x |
* master: (70 commits) KQL removes leading zero and breaks query (elastic#62748) [FieldFormats] Cleanup: rename IFieldFormatType -> FieldFormatInstanceType (elastic#64193) [ML] Changes transforms wizard UI text (elastic#64150) [Alerting] change server log action type .log to .server-log in README (elastic#64124) [Metrics UI] Design Refresh: Inventory View, Episode 1 (elastic#64026) chore(NA): reduce siem bundle size using babel-plugin-transfor… (elastic#63269) chore(NA): use core-js instead of babel-polyfill on canvas sha… (elastic#63486) skip flaky suite (elastic#61173) skip flaky suite (elastic#62497) Renamed ilm policy for event log so it is not prefixed with dot (elastic#64262) [eslint] no_restricted_paths config cleanup (elastic#63741) Add Oil Rig Icon from @elastic/maki (elastic#64364) [Maps] Migrate Maps embeddables to NP (elastic#63976) [Ingest] Data streams list page (elastic#64134) chore(NA): add file-loader into jest moduleNameMapper (elastic#64330) [DOCS] Added images to automating report generation (elastic#64333) [SIEM][CASE] Api Integration Tests: Configuration (elastic#63948) Expose ability to check if API Keys are enabled (elastic#63454) [DOCS] Fixes formatting in alerting doc (elastic#64338) [data.search.aggs]: Create agg types function for terms agg. (elastic#63541) ...
Major cleanup of the no_restricted_paths rule for imports of core. For relative imports, we use eslint-module-utils/resolve which resolves to the full filesystem path. So, to support relative and absolute imports from the src alias we need to define both the directory and the index including file extension. This rule was handling both core imports, as well as imports from other plugins. Imports from other plugins are being used much more liberally allowed through the exceptions in tests. I choose to break these up, removing this exception for tests for core imports. Fixes: Absolute imports of src/core/server/mocks were not allowed in src. This was not an issue in x-pack due to the target excluding !x-pack/**/*.test.* and !x-pack/test/**/*. Non-top-level public and server imports were allowed from X-Pack tests to the previously mentioned exclusion. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Major cleanup of the no_restricted_paths rule for imports of core. For relative imports, we use eslint-module-utils/resolve which resolves to the full filesystem path. So, to support relative and absolute imports from the src alias we need to define both the directory and the index including file extension. This rule was handling both core imports, as well as imports from other plugins. Imports from other plugins are being used much more liberally allowed through the exceptions in tests. I choose to break these up, removing this exception for tests for core imports. Fixes: Absolute imports of src/core/server/mocks were not allowed in src. This was not an issue in x-pack due to the target excluding !x-pack/**/*.test.* and !x-pack/test/**/*. Non-top-level public and server imports were allowed from X-Pack tests to the previously mentioned exclusion. Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Refactor/fixes of the no_restricted_paths rule config for imports of core.
In no_restricted_paths we resolve relative imports with
eslint-module-utils/resolvewhich resolves to the full filesystem path. So, to support relative and absolute imports from thesrcalias we need to define both the directory and the index including file extension. An alternative could be to change how we handle this in no_restricted_paths by checking if it's a node_module or from source.This rule was handling both core imports, as well as imports from other plugins. Imports from other plugins are being used much more liberally allowed through the exceptions in tests. I choose to break these up, removing this exception for tests for core imports.
Fixes:
src/core/server/mockswere not allowed insrc. This was not an issue in x-pack due to the target excluding!x-pack/**/*.test.*and!x-pack/test/**/*.