diff --git a/.eslintrc.js b/.eslintrc.js index 7d6203be3aca..46fb015eb186 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -142,7 +142,7 @@ module.exports = { * New Platform client-side */ { - files: ['{src,x-pack}/plugins/*/public/**/*.{js,mjs,ts,tsx}'], + files: ['{src}/plugins/*/public/**/*.{js,mjs,ts,tsx}'], rules: { 'import/no-commonjs': 'error', }, @@ -230,24 +230,24 @@ module.exports = { basePath: __dirname, zones: [ { - target: ['(src|x-pack)/**/*', '!src/core/**/*'], + target: ['(src)/**/*', '!src/core/**/*'], from: ['src/core/utils/**/*'], errorMessage: `Plugins may only import from src/core/server and src/core/public.`, }, { - target: ['(src|x-pack)/plugins/*/server/**/*'], - from: ['(src|x-pack)/plugins/*/public/**/*'], + target: ['(src)/plugins/*/server/**/*'], + from: ['(src)/plugins/*/public/**/*'], errorMessage: `Server code can not import from public, use a common directory.`, }, { - target: ['(src|x-pack)/plugins/*/common/**/*'], - from: ['(src|x-pack)/plugins/*/(server|public)/**/*'], + target: ['(src)/plugins/*/common/**/*'], + from: ['(src)/plugins/*/(server|public)/**/*'], errorMessage: `Common code can not import from server or public, use a common directory.`, }, { target: [ 'src/legacy/**/*', - '(src|x-pack)/plugins/**/(public|server)/**/*', + '(src)/plugins/**/(public|server)/**/*', 'examples/**/*', ], from: [ @@ -278,23 +278,22 @@ module.exports = { { target: [ 'src/legacy/**/*', - '(src|x-pack)/plugins/**/(public|server)/**/*', + '(src)/plugins/**/(public|server)/**/*', 'examples/**/*', - '!(src|x-pack)/**/*.test.*', - '!(x-pack/)?test/**/*', + '!(src)/**/*.test.*', ], from: [ - '(src|x-pack)/plugins/**/(public|server)/**/*', - '!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}', - '!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}', + '(src)/plugins/**/(public|server)/**/*', + '!(src)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}', + '!(src)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}', ], allowSameFolder: true, errorMessage: 'Plugins may only import from top-level public and server modules.', }, { target: [ - '(src|x-pack)/plugins/**/*', - '!(src|x-pack)/plugins/**/server/**/*', + '(src)/plugins/**/*', + '!(src)/plugins/**/server/**/*', 'examples/**/*', '!examples/**/server/**/*', @@ -302,24 +301,19 @@ module.exports = { from: [ 'src/core/server', 'src/core/server/**/*', - '(src|x-pack)/plugins/*/server/**/*', + '(src)/plugins/*/server/**/*', 'examples/**/server/**/*', ], errorMessage: 'Server modules cannot be imported into client modules or shared modules.', }, - { - target: ['src/**/*'], - from: ['x-pack/**/*'], - errorMessage: 'OSS cannot import x-pack files.', - }, { target: ['src/core/**/*'], from: ['plugins/**/*', 'src/plugins/**/*', 'src/legacy/ui/**/*'], errorMessage: 'The core cannot depend on any plugins.', }, { - target: ['(src|x-pack)/plugins/*/public/**/*'], + target: ['(src)/plugins/*/public/**/*'], from: ['ui/**/*'], errorMessage: 'Plugins cannot import legacy UI code.', }, @@ -348,17 +342,10 @@ module.exports = { { files: [ '**/*.stories.tsx', - 'x-pack/test/apm_api_integration/**/*.ts', - 'x-pack/test/functional/apps/**/*.js', - 'x-pack/plugins/apm/**/*.js', 'test/*/config.ts', 'test/*/config_open.ts', 'test/*/{tests,test_suites,apis,apps}/**/*', 'test/visual_regression/tests/**/*', - 'x-pack/test/*/{tests,test_suites,apis,apps}/**/*', - 'x-pack/test/*/*config.*ts', - 'x-pack/test/saved_object_api_integration/*/apis/**/*', - 'x-pack/test/ui_capabilities/*/tests/**/*', ], rules: { 'import/no-default-export': 'off', @@ -390,16 +377,11 @@ module.exports = { }, }, }, - /** * Files that ARE NOT allowed to use devDependencies */ { - files: [ - 'packages/osd-ui-framework/**/*.js', - 'x-pack/**/*.js', - 'packages/osd-interpreter/**/*.js', - ], + files: ['packages/osd-ui-framework/**/*.js', 'packages/osd-interpreter/**/*.js'], rules: { 'import/no-extraneous-dependencies': [ 'error', @@ -423,13 +405,6 @@ module.exports = { 'packages/osd-opensearch/src/**/*.js', 'packages/osd-interpreter/tasks/**/*.js', 'packages/osd-interpreter/src/plugin/**/*.js', - 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js', - 'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__,public}/**/*.js', - 'x-pack/**/*.test.js', - 'x-pack/test_utils/**/*', - 'x-pack/gulpfile.js', - 'x-pack/plugins/apm/public/utils/testHelpers.js', - 'x-pack/plugins/canvas/shareable_runtime/postcss.config.js', ], rules: { 'import/no-extraneous-dependencies': [ @@ -513,9 +488,6 @@ module.exports = { '.eslintrc.js', 'packages/osd-eslint-import-resolver-opensearch-dashboards/**/*.js', 'packages/osd-eslint-plugin-eslint/**/*', - 'x-pack/gulpfile.js', - 'x-pack/dev-tools/mocha/setup_mocha.js', - 'x-pack/scripts/*.js', ], excludedFiles: ['**/integration_tests/**/*'], rules: { @@ -669,370 +641,6 @@ module.exports = { }, }, - /** - * APM and Observability overrides - */ - { - files: [ - 'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}', - ], - rules: { - 'no-console': ['warn', { allow: ['error'] }], - 'react/function-component-definition': [ - 'warn', - { - namedComponents: 'function-declaration', - unnamedComponents: 'arrow-function', - }, - ], - 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks - 'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }], - }, - }, - - /** - * ML overrides - */ - { - files: ['x-pack/plugins/ml/**/*.js'], - rules: { - 'no-shadow': 'error', - 'import/no-extraneous-dependencies': [ - 'error', - { - packageDir: './x-pack', - }, - ], - }, - }, - - /** - * Security Solution overrides - */ - { - // front end and common typescript and javascript files only - files: [ - 'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}', - ], - rules: { - 'import/no-nodejs-modules': 'error', - 'no-restricted-imports': [ - 'error', - { - // prevents UI code from importing server side code and then webpack including it when doing builds - patterns: ['**/server/*'], - }, - ], - }, - }, - { - // typescript only for front and back end - files: ['x-pack/plugins/security_solution/**/*.{ts,tsx}'], - rules: { - // This will be turned on after bug fixes are complete - // '@typescript-eslint/explicit-member-accessibility': 'warn', - '@typescript-eslint/no-this-alias': 'error', - '@typescript-eslint/no-explicit-any': 'error', - '@typescript-eslint/no-useless-constructor': 'error', - // This will be turned on after bug fixes are complete - // '@typescript-eslint/no-object-literal-type-assertion': 'warn', - '@typescript-eslint/unified-signatures': 'error', - - // eventually we want this to be a warn and then an error since this is a recommended linter rule - // for now, keeping it commented out to avoid too much IDE noise until the other linter issues - // are fixed in the next release or two - // '@typescript-eslint/explicit-function-return-type': 'warn', - - // these rules cannot be turned on and tested at the moment until this issue is resolved: - // https://github.com/prettier/prettier-eslint/issues/201 - // '@typescript-eslint/await-thenable': 'error', - // '@typescript-eslint/no-non-null-assertion': 'error' - // '@typescript-eslint/no-unnecessary-type-assertion': 'error', - // '@typescript-eslint/no-unused-vars': 'error', - // '@typescript-eslint/prefer-includes': 'error', - // '@typescript-eslint/prefer-string-starts-ends-with': 'error', - // '@typescript-eslint/promise-function-async': 'error', - // '@typescript-eslint/prefer-regexp-exec': 'error', - // '@typescript-eslint/promise-function-async': 'error', - // '@typescript-eslint/require-array-sort-compare': 'error', - // '@typescript-eslint/restrict-plus-operands': 'error', - // '@typescript-eslint/unbound-method': 'error', - }, - }, - // { - // // will introduced after the other warns are fixed - // // typescript and javascript for front end react performance - // files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,mjs,ts,tsx}'], - // plugins: ['react-perf'], - // rules: { - // // 'react-perf/jsx-no-new-object-as-prop': 'error', - // // 'react-perf/jsx-no-new-array-as-prop': 'error', - // // 'react-perf/jsx-no-new-function-as-prop': 'error', - // // 'react/jsx-no-bind': 'error', - // }, - // }, - { - // typescript and javascript for front and back end - files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'], - plugins: ['eslint-plugin-node', 'react'], - env: { - mocha: true, - jest: true, - }, - rules: { - 'accessor-pairs': 'error', - 'array-callback-return': 'error', - 'no-array-constructor': 'error', - complexity: 'warn', - // This will be turned on after bug fixes are mostly completed - // 'consistent-return': 'warn', - // This will be turned on after bug fixes are mostly completed - // 'func-style': ['warn', 'expression'], - // These will be turned on after bug fixes are mostly completed and we can - // run a fix-lint - /* - 'import/order': [ - 'warn', - { - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], - 'newlines-between': 'always', - }, - ], - */ - 'node/no-deprecated-api': 'error', - 'no-bitwise': 'error', - 'no-continue': 'error', - 'no-dupe-keys': 'error', - 'no-duplicate-case': 'error', - 'no-duplicate-imports': 'error', - 'no-empty-character-class': 'error', - 'no-empty-pattern': 'error', - 'no-ex-assign': 'error', - 'no-extend-native': 'error', - 'no-extra-bind': 'error', - 'no-extra-boolean-cast': 'error', - 'no-extra-label': 'error', - 'no-func-assign': 'error', - 'no-implicit-globals': 'error', - 'no-implied-eval': 'error', - 'no-invalid-regexp': 'error', - 'no-inner-declarations': 'error', - 'no-lone-blocks': 'error', - 'no-multi-assign': 'error', - 'no-misleading-character-class': 'error', - 'no-new-symbol': 'error', - 'no-obj-calls': 'error', - 'no-param-reassign': 'error', - 'no-process-exit': 'error', - 'no-prototype-builtins': 'error', - 'no-return-await': 'error', - 'no-self-compare': 'error', - 'no-shadow-restricted-names': 'error', - 'no-sparse-arrays': 'error', - 'no-this-before-super': 'error', - 'no-undef': 'error', - 'no-unreachable': 'error', - 'no-unsafe-finally': 'error', - 'no-useless-call': 'error', - 'no-useless-catch': 'error', - 'no-useless-concat': 'error', - 'no-useless-computed-key': 'error', - // This will be turned on after bug fixes are mostly complete - // 'no-useless-escape': 'warn', - 'no-useless-rename': 'error', - 'no-useless-return': 'error', - // This will be turned on after bug fixers are mostly complete - // 'no-void': 'warn', - 'one-var-declaration-per-line': 'error', - 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', - 'prefer-rest-params': 'error', - 'prefer-spread': 'error', - 'prefer-template': 'error', - 'react/boolean-prop-naming': 'error', - 'react/button-has-type': 'error', - 'react/display-name': 'error', - 'react/forbid-dom-props': 'error', - 'react/no-access-state-in-setstate': 'error', - 'react/no-children-prop': 'error', - 'react/no-danger-with-children': 'error', - 'react/no-deprecated': 'error', - 'react/no-did-mount-set-state': 'error', - // Re-enable once we have better options per this issue: - // https://github.com/airbnb/javascript/issues/1875 - // 'react/no-did-update-set-state': 'error', - 'react/no-direct-mutation-state': 'error', - 'react/no-find-dom-node': 'error', - 'react/no-redundant-should-component-update': 'error', - 'react/no-render-return-value': 'error', - 'react/no-typos': 'error', - 'react/no-string-refs': 'error', - 'react/no-this-in-sfc': 'error', - 'react/no-unescaped-entities': 'error', - 'react/no-unsafe': 'error', - 'react/no-unused-prop-types': 'error', - 'react/no-unused-state': 'error', - // will introduced after the other warns are fixed - // 'react/sort-comp': 'error', - 'react/void-dom-elements-no-children': 'error', - 'react/jsx-no-comment-textnodes': 'error', - 'react/jsx-no-literals': 'error', - 'react/jsx-no-target-blank': 'error', - 'react/jsx-fragments': 'error', - 'react/jsx-sort-default-props': 'error', - 'require-atomic-updates': 'error', - 'symbol-description': 'error', - 'vars-on-top': 'error', - }, - }, - - /** - * Lists overrides - */ - { - // front end and common typescript and javascript files only - files: [ - 'x-pack/plugins/lists/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/lists/common/**/*.{js,mjs,ts,tsx}', - ], - rules: { - 'import/no-nodejs-modules': 'error', - 'no-restricted-imports': [ - 'error', - { - // prevents UI code from importing server side code and then webpack including it when doing builds - patterns: ['**/server/*'], - }, - ], - }, - }, - { - // typescript and javascript for front and back end - files: ['x-pack/plugins/lists/**/*.{js,mjs,ts,tsx}'], - plugins: ['eslint-plugin-node'], - env: { - mocha: true, - jest: true, - }, - rules: { - 'accessor-pairs': 'error', - 'array-callback-return': 'error', - 'no-array-constructor': 'error', - complexity: 'error', - 'consistent-return': 'error', - 'func-style': ['error', 'expression'], - 'import/order': [ - 'error', - { - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], - 'newlines-between': 'always', - }, - ], - 'sort-imports': [ - 'error', - { - ignoreDeclarationSort: true, - }, - ], - 'node/no-deprecated-api': 'error', - 'no-bitwise': 'error', - 'no-continue': 'error', - 'no-dupe-keys': 'error', - 'no-duplicate-case': 'error', - 'no-duplicate-imports': 'error', - 'no-empty-character-class': 'error', - 'no-empty-pattern': 'error', - 'no-ex-assign': 'error', - 'no-extend-native': 'error', - 'no-extra-bind': 'error', - 'no-extra-boolean-cast': 'error', - 'no-extra-label': 'error', - 'no-func-assign': 'error', - 'no-implicit-globals': 'error', - 'no-implied-eval': 'error', - 'no-invalid-regexp': 'error', - 'no-inner-declarations': 'error', - 'no-lone-blocks': 'error', - 'no-multi-assign': 'error', - 'no-misleading-character-class': 'error', - 'no-new-symbol': 'error', - 'no-obj-calls': 'error', - 'no-param-reassign': ['error', { props: true }], - 'no-process-exit': 'error', - 'no-prototype-builtins': 'error', - 'no-return-await': 'error', - 'no-self-compare': 'error', - 'no-shadow-restricted-names': 'error', - 'no-sparse-arrays': 'error', - 'no-this-before-super': 'error', - 'no-undef': 'error', - 'no-unreachable': 'error', - 'no-unsafe-finally': 'error', - 'no-useless-call': 'error', - 'no-useless-catch': 'error', - 'no-useless-concat': 'error', - 'no-useless-computed-key': 'error', - 'no-useless-escape': 'error', - 'no-useless-rename': 'error', - 'no-useless-return': 'error', - 'no-void': 'error', - 'one-var-declaration-per-line': 'error', - 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', - 'prefer-rest-params': 'error', - 'prefer-spread': 'error', - 'prefer-template': 'error', - 'require-atomic-updates': 'error', - 'symbol-description': 'error', - 'vars-on-top': 'error', - '@typescript-eslint/explicit-member-accessibility': 'error', - '@typescript-eslint/no-this-alias': 'error', - '@typescript-eslint/no-explicit-any': 'error', - '@typescript-eslint/no-useless-constructor': 'error', - '@typescript-eslint/unified-signatures': 'error', - '@typescript-eslint/explicit-function-return-type': 'error', - '@typescript-eslint/no-non-null-assertion': 'error', - '@typescript-eslint/no-unused-vars': 'error', - 'no-template-curly-in-string': 'error', - 'sort-keys': 'error', - 'prefer-destructuring': 'error', - }, - }, - /** - * Alerting Services overrides - */ - { - // typescript only for front and back end - files: ['x-pack/plugins/{alerts,stack_alerts,actions,task_manager,event_log}/**/*.{ts,tsx}'], - rules: { - '@typescript-eslint/no-explicit-any': 'error', - }, - }, - - /** - * Lens overrides - */ - { - files: ['x-pack/plugins/lens/**/*.{ts,tsx}'], - rules: { - '@typescript-eslint/no-explicit-any': 'error', - }, - }, - - /** - * Enterprise Search overrides - */ - { - files: ['x-pack/plugins/enterprise_search/**/*.{ts,tsx}'], - excludedFiles: ['x-pack/plugins/enterprise_search/**/*.{test,mock}.{ts,tsx}'], - rules: { - 'react-hooks/exhaustive-deps': 'off', - '@typescript-eslint/no-explicit-any': 'error', - }, - }, - /** * disable jsx-a11y for osd-ui-framework */ @@ -1046,96 +654,6 @@ module.exports = { 'jsx-a11y/aria-role': 'off', }, }, - - /** - * Canvas overrides - */ - { - files: ['x-pack/plugins/canvas/**/*.js'], - rules: { - radix: 'error', - - // module importing - 'import/order': [ - 'error', - { - groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], - }, - ], - 'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }], - - // react - 'react/no-did-mount-set-state': 'error', - 'react/no-did-update-set-state': 'error', - 'react/no-multi-comp': ['error', { ignoreStateless: true }], - 'react/self-closing-comp': 'error', - 'react/sort-comp': 'error', - 'react/jsx-boolean-value': 'error', - 'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], - 'react/forbid-elements': [ - 'error', - { - forbid: [ - { - element: 'EuiConfirmModal', - message: 'Use instead', - }, - { - element: 'EuiPopover', - message: 'Use instead', - }, - { - element: 'EuiIconTip', - message: 'Use instead', - }, - ], - }, - ], - }, - }, - { - files: [ - 'x-pack/plugins/canvas/gulpfile.js', - 'x-pack/plugins/canvas/scripts/*.js', - 'x-pack/plugins/canvas/tasks/*.js', - 'x-pack/plugins/canvas/tasks/**/*.js', - 'x-pack/plugins/canvas/__tests__/**/*.js', - 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', - ], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - devDependencies: true, - peerDependencies: true, - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/storybook/**'], - rules: { - 'import/no-extraneous-dependencies': 0, - }, - }, - { - files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'], - globals: { canvas: true, $: true }, - rules: { - 'import/no-unresolved': [ - 'error', - { - ignore: ['!!raw-loader.+.svg$'], - }, - ], - }, - }, - { - files: ['x-pack/plugins/canvas/public/**/*.js'], - env: { - browser: true, - }, - }, { files: ['packages/osd-ui-shared-deps/flot_charts/**/*.js'], env: { @@ -1169,10 +687,6 @@ module.exports = { files: [ // platform-team owned code 'src/core/**', - 'x-pack/plugins/features/**', - 'x-pack/plugins/licensing/**', - 'x-pack/plugins/global_search/**', - 'x-pack/plugins/cloud/**', 'packages/osd-config-schema', 'src/plugins/status_page/**', 'src/plugins/saved_objects_management/**', diff --git a/.gitignore b/.gitignore index cdddd715fa39..3a34f3e892c4 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,6 @@ npm-debug.log* .gradle # apm plugin -/x-pack/plugins/apm/tsconfig.json apm.tsconfig.json ## @cypress/snapshot from apm plugin that could be added by mistake diff --git a/.sass-lint.yml b/.sass-lint.yml index a90c0e67d755..c399da95df2e 100644 --- a/.sass-lint.yml +++ b/.sass-lint.yml @@ -6,17 +6,6 @@ files: - 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss' - 'src/plugins/vis_type_vega/**/*.s+(a|c)ss' - 'src/plugins/vis_type_xy/**/*.s+(a|c)ss' - - 'x-pack/plugins/canvas/**/*.s+(a|c)ss' - - 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss' - - 'x-pack/plugins/lens/**/*.s+(a|c)ss' - - 'x-pack/plugins/cross_cluster_replication/**/*.s+(a|c)ss' - - 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss' - - 'x-pack/plugins/maps/**/*.s+(a|c)ss' - - 'x-pack/plugins/spaces/**/*.s+(a|c)ss' - - 'x-pack/plugins/security/**/*.s+(a|c)ss' - - 'x-pack/plugins/monitoring/**/*.s+(a|c)ss' - ignore: - - 'x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss' rules: quotes: - 2 diff --git a/TYPESCRIPT.md b/TYPESCRIPT.md index 19eb42cb2a3e..07577dd963e5 100644 --- a/TYPESCRIPT.md +++ b/TYPESCRIPT.md @@ -110,7 +110,7 @@ If that happens, just pick the closest one. If yarn doesn't find the module it may not have types. For example, our `rison_node` package doesn't have types. In this case you have a few options: 1. Contribute types into the DefinitelyTyped repo itself, or -2. Create a top level `types` folder and point to that in the tsconfig. For example, Infra team already handled this for `rison_node` and added: `x-pack/legacy/plugins/infra/types/rison_node.d.ts`. Other code uses it too so we will need to pull it up. Or, +2. Create a top level `types` folder and point to that in the tsconfig. 3. Add a `// @ts-ignore` line above the import. This should be used minimally, the above options are better. However, sometimes you have to resort to this method. ### TypeScripting react files diff --git a/package.json b/package.json index 8164dc15a5cb..bfee00b600db 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,6 @@ "**/@types/*/**", "**/grunt-*", "**/grunt-*/**", - "x-pack/typescript", "@elastic/eui/rehype-react", "@elastic/eui/remark-rehype", "@elastic/eui/remark-rehype/**" diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/elastic-eslint-config-kibana/.eslintrc.js index a60976af46e4..f0af849dc0ea 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -48,10 +48,6 @@ module.exports = { to: false, disallowedMessage: `Don't use idx(), use optional chaining syntax instead https://ela.st/optchain` }, - { - from: 'x-pack', - toRelative: 'x-pack', - }, { from: 'react-router', to: 'react-router-dom', diff --git a/packages/osd-config/src/env.test.ts b/packages/osd-config/src/env.test.ts index 07929041742a..4b9a3e0018b6 100644 --- a/packages/osd-config/src/env.test.ts +++ b/packages/osd-config/src/env.test.ts @@ -150,29 +150,6 @@ test('correctly creates environment with constructor.', () => { expect(env).toMatchSnapshot('env properties'); }); -test('pluginSearchPaths contains x-pack plugins path if --oss flag is false', () => { - const env = new Env( - '/some/home/dir', - packageInfos, - getEnvOptions({ - cliArgs: { oss: false }, - }) - ); - - expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/plugins'); -}); - -test('pluginSearchPaths does not contains x-pack plugins path if --oss flag is true', () => { - const env = new Env( - '/some/home/dir', - packageInfos, - getEnvOptions({ - cliArgs: { oss: true }, - }) - ); - - expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/plugins'); -}); test('pluginSearchPaths contains examples plugins path if --run-examples flag is true', () => { const env = new Env( @@ -186,30 +163,6 @@ test('pluginSearchPaths contains examples plugins path if --run-examples flag is expect(env.pluginSearchPaths).toContain('/some/home/dir/examples'); }); -test('pluginSearchPaths contains x-pack/examples plugins path if --run-examples flag is true', () => { - const env = new Env( - '/some/home/dir', - packageInfos, - getEnvOptions({ - cliArgs: { runExamples: true }, - }) - ); - - expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/examples'); -}); - -test('pluginSearchPaths does not contain x-pack/examples plugins path if --oss flag is true', () => { - const env = new Env( - '/some/home/dir', - packageInfos, - getEnvOptions({ - cliArgs: { runExamples: true, oss: true }, - }) - ); - - expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/examples'); -}); - test('pluginSearchPaths does not contains examples plugins path if --run-examples flag is false', () => { const env = new Env( '/some/home/dir', @@ -221,15 +174,3 @@ test('pluginSearchPaths does not contains examples plugins path if --run-example expect(env.pluginSearchPaths).not.toContain('/some/home/dir/examples'); }); - -test('pluginSearchPaths does not contains x-pack/examples plugins path if --run-examples flag is false', () => { - const env = new Env( - '/some/home/dir', - packageInfos, - getEnvOptions({ - cliArgs: { runExamples: false }, - }) - ); - - expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/examples'); -}); diff --git a/packages/osd-config/src/env.ts b/packages/osd-config/src/env.ts index 11a76e88e4d5..c162039a80a2 100644 --- a/packages/osd-config/src/env.ts +++ b/packages/osd-config/src/env.ts @@ -120,12 +120,8 @@ export class Env { */ this.pluginSearchPaths = [ resolve(this.homeDir, 'src', 'plugins'), - ...(options.cliArgs.oss ? [] : [resolve(this.homeDir, 'x-pack', 'plugins')]), resolve(this.homeDir, 'plugins'), ...(options.cliArgs.runExamples ? [resolve(this.homeDir, 'examples')] : []), - ...(options.cliArgs.runExamples && !options.cliArgs.oss - ? [resolve(this.homeDir, 'x-pack', 'examples')] - : []), resolve(this.homeDir, '..', 'opensearch-dashboards-extra'), ]; diff --git a/packages/osd-dev-utils/src/plugin_list/generate_plugin_list.ts b/packages/osd-dev-utils/src/plugin_list/generate_plugin_list.ts index a5072a356e7e..658f767ae087 100644 --- a/packages/osd-dev-utils/src/plugin_list/generate_plugin_list.ts +++ b/packages/osd-dev-utils/src/plugin_list/generate_plugin_list.ts @@ -46,7 +46,7 @@ function* printPlugins(plugins: Plugins, includes: string[]) { } } -export function generatePluginList(ossPlugins: Plugins, xpackPlugins: Plugins) { +export function generatePluginList(ossPlugins: Plugins) { const includes: string[] = []; return `//// @@ -76,20 +76,6 @@ NOTE: ${Array.from(printPlugins(ossPlugins, includes)).join('\n')} -|=== - -[discrete] -=== x-pack/plugins - -[%header,cols=2*] -|=== -|Name -|Description - -${Array.from(printPlugins(xpackPlugins, includes)).join('\n')} - -|=== - ${Array.from(includes).join('\n')} `; } diff --git a/packages/osd-dev-utils/src/plugin_list/run_plugin_list_cli.ts b/packages/osd-dev-utils/src/plugin_list/run_plugin_list_cli.ts index 69c56abb814e..f82977cab809 100644 --- a/packages/osd-dev-utils/src/plugin_list/run_plugin_list_cli.ts +++ b/packages/osd-dev-utils/src/plugin_list/run_plugin_list_cli.ts @@ -26,7 +26,6 @@ import { discoverPlugins } from './discover_plugins'; import { generatePluginList } from './generate_plugin_list'; const OSS_PLUGIN_DIR = Path.resolve(REPO_ROOT, 'src/plugins'); -const XPACK_PLUGIN_DIR = Path.resolve(REPO_ROOT, 'x-pack/plugins'); const OUTPUT_PATH = Path.resolve(REPO_ROOT, 'docs/developer/plugin-list.asciidoc'); export function runPluginListCli() { @@ -35,11 +34,7 @@ export function runPluginListCli() { const ossPlugins = discoverPlugins(OSS_PLUGIN_DIR); log.success(`found ${ossPlugins.length} plugins`); - log.info('looking for x-pack plugins'); - const xpackPlugins = discoverPlugins(XPACK_PLUGIN_DIR); - log.success(`found ${xpackPlugins.length} plugins`); - log.info('writing plugin list to', OUTPUT_PATH); - Fs.writeFileSync(OUTPUT_PATH, generatePluginList(ossPlugins, xpackPlugins)); + Fs.writeFileSync(OUTPUT_PATH, generatePluginList(ossPlugins)); }); } diff --git a/packages/osd-i18n/README.md b/packages/osd-i18n/README.md index 7bae133af748..16e740e925d5 100644 --- a/packages/osd-i18n/README.md +++ b/packages/osd-i18n/README.md @@ -33,7 +33,7 @@ For example: src/legacy/core_plugins/opensearch-dashboards/translations/fr.json ``` -The engine scans `x-pack/legacy/plugins/*/translations`, `src/core_plugins/*/translations`, `plugins/*/translations` and `src/legacy/ui/translations` folders on initialization, so there is no need to register translation files. +The engine scans `src/core_plugins/*/translations`, `plugins/*/translations` and `src/legacy/ui/translations` folders on initialization, so there is no need to register translation files. The engine uses a `config/opensearch_dashboards.yml` file for locale resolution process. If locale is defined via `i18n.locale` option in `config/opensearch_dashboards.yml` then it will be used as a base diff --git a/packages/osd-opensearch/src/utils/__snapshots__/parse_es_log.test.js.snap b/packages/osd-opensearch/src/utils/__snapshots__/parse_es_log.test.js.snap deleted file mode 100644 index a1c63876aa0b..000000000000 --- a/packages/osd-opensearch/src/utils/__snapshots__/parse_es_log.test.js.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`parses data containing exception 1`] = `"[o.e.n.Node] [qEfPPg8] starting ..."`; - -exports[`parses data containing exception 2`] = ` -"[o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] -org.elasticsearch.bootstrap.StartupException: BindHttpException; nested: BindException[Address already in use]; - at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-7.0.0.jar:7.0.0-alpha1-SNAPSHOT] -Caused by: org.elasticsearch.http.BindHttpException: Failed to bind to [9200] - at org.elasticsearch.http.netty4.Netty4HttpServerTransport.bindAddress(Netty4HttpServerTransport.java:408) ~[?:?] - at org.elasticsearch.http.netty4.Netty4HttpServerTransport.createBoundHttpAddress(Netty4HttpServerTransport.java:309) ~[?:?] - ... 13 more -Caused by: java.net.BindException: Address already in use - at sun.nio.ch.Net.bind0(Native Method) ~[?:?] - at java.lang.Thread.run(Thread.java:844) [?:?]" -`; - -exports[`parses data containing exception 3`] = `"[o.e.g.GatewayService] [qEfPPg8] recovered [0] indices into cluster_state"`; - -exports[`parses multiple lines 1`] = `"[o.e.p.PluginsService] [qEfPPg8] loaded plugin [x-pack-security]"`; - -exports[`parses multiple lines 2`] = `"[o.e.p.PluginsService] [qEfPPg8] loaded plugin [x-pack-watcher]"`; - -exports[`parses single line 1`] = `"[o.e.p.PluginsService] [qEfPPg8] loaded module [lang-expression]"`; diff --git a/packages/osd-plugin-generator/src/ask_questions.ts b/packages/osd-plugin-generator/src/ask_questions.ts index 06c9f6827ed5..a9f5346d8abb 100644 --- a/packages/osd-plugin-generator/src/ask_questions.ts +++ b/packages/osd-plugin-generator/src/ask_questions.ts @@ -43,14 +43,6 @@ export const INTERNAL_PLUGIN_LOCATIONS: Array<{ name: string; value: string }> = name: 'OpenSearch Dashboards OSS Functional Testing', value: Path.resolve(REPO_ROOT, 'test/plugin_functional/plugins'), }, - { - name: 'X-Pack', - value: Path.resolve(REPO_ROOT, 'x-pack/plugins'), - }, - { - name: 'X-Pack Functional Testing', - value: Path.resolve(REPO_ROOT, 'x-pack/test/plugin_functional/plugins'), - }, ]; export const QUESTIONS = [ diff --git a/packages/osd-plugin-generator/src/plugin_types.ts b/packages/osd-plugin-generator/src/plugin_types.ts index 53cdf96a7183..8b3ac685149c 100644 --- a/packages/osd-plugin-generator/src/plugin_types.ts +++ b/packages/osd-plugin-generator/src/plugin_types.ts @@ -46,15 +46,4 @@ export const PLUGIN_TYPE_OPTIONS: Array<{ name: string; value: PluginType }> = [ installDir: Path.resolve(REPO_ROOT, 'test/plugin_functional/plugins'), }, }, - { - name: 'X-Pack', - value: { thirdParty: false, installDir: Path.resolve(REPO_ROOT, 'x-pack/plugins') }, - }, - { - name: 'X-Pack Functional Testing', - value: { - thirdParty: false, - installDir: Path.resolve(REPO_ROOT, 'x-pack/test/plugin_functional/plugins'), - }, - }, ]; diff --git a/packages/osd-pm/README.md b/packages/osd-pm/README.md index aaaaedea5ae8..69a304b9ed67 100644 --- a/packages/osd-pm/README.md +++ b/packages/osd-pm/README.md @@ -10,7 +10,7 @@ To run `@osd/pm`, go to OpenSearch Dashboards root and run `yarn osd`. Long-term we want to get rid of Webpack from production (basically, it's causing a lot of problems, using a lot of memory and adding a lot of complexity). Ideally we want each plugin to build its own separate production bundles for -both server and UI. To get there all OpenSearch Dashboards plugins (including x-pack) need to +both server and UI. To get there all OpenSearch Dashboards plugins need to be able to build their production bundles separately from OpenSearch Dashboards , which means they need to be able to depend on code from OpenSearch Dashboards without `import`-ing random files directly from the OpenSearch Dashboards source code. @@ -54,8 +54,7 @@ scripts, while still having a nice developer experience. ### Internal usage -For packages that are referenced within the OpenSearch Dashboards repo itself (for example, -using the `@osd/i18n` package from an `x-pack` plugin), we are leveraging +For packages that are referenced within the OpenSearch Dashboards repo itself, we are leveraging Yarn's workspaces feature. This allows yarn to optimize node_modules within the entire repo to avoid duplicate modules by hoisting common packages as high in the dependency tree as possible. @@ -96,8 +95,7 @@ that looks like this: opensearch └── opensearch-dashboards └── plugins - ├── opensearch-dashboards-canvas - └── x-pack-opensearch-dashboards + ├── opensearch-dashboards-example ``` Relying on `link:` style dependencies means we no longer need to `npm publish` diff --git a/packages/osd-pm/src/README.md b/packages/osd-pm/src/README.md index bcd571918ba3..87e5c710d0ed 100644 --- a/packages/osd-pm/src/README.md +++ b/packages/osd-pm/src/README.md @@ -10,7 +10,7 @@ To run `@osd/pm`, go to OpenSearch Dashboards root and run `yarn osd`. Long-term we want to get rid of Webpack from production (basically, it's causing a lot of problems, using a lot of memory and adding a lot of complexity). Ideally we want each plugin to build its own separate production bundles for -both server and UI. To get there all OpenSearch Dashboards plugins (including x-pack) need to +both server and UI. To get there all OpenSearch Dashboards plugins need to be able to build their production bundles separately from OpenSearch Dashboards , which means they need to be able to depend on code from OpenSearch Dashboards without `import`-ing random files directly from the OpenSearch Dashboards source code. @@ -96,8 +96,7 @@ that looks like this: opensearch └── opensearch-dashboards └── plugins - ├── opensearch-dashboards-canvas - └── x-pack-opensearch-dashboards + ├── opensearch-dashboards-example ``` Relying on `link:` style dependencies means we no longer need to `npm publish` diff --git a/packages/osd-pm/src/config.ts b/packages/osd-pm/src/config.ts index 55e237e1819f..b0d6a9fcbe80 100644 --- a/packages/osd-pm/src/config.ts +++ b/packages/osd-pm/src/config.ts @@ -44,13 +44,6 @@ export function getProjectPaths({ rootPath, ossOnly, skipOpenSearchDashboardsPlu projectPaths.push(resolve(rootPath, 'test/interpreter_functional/plugins/*')); projectPaths.push(resolve(rootPath, 'examples/*')); - if (!ossOnly) { - projectPaths.push(resolve(rootPath, 'x-pack')); - projectPaths.push(resolve(rootPath, 'x-pack/plugins/*')); - projectPaths.push(resolve(rootPath, 'x-pack/legacy/plugins/*')); - projectPaths.push(resolve(rootPath, 'x-pack/test/functional_with_es_ssl/fixtures/plugins/*')); - } - if (!skipOpenSearchDashboardsPlugins) { projectPaths.push(resolve(rootPath, '../opensearch-dashboards-extra/*')); projectPaths.push(resolve(rootPath, '../opensearch-dashboards-extra/*/packages/*')); diff --git a/packages/osd-pm/src/production/build_production_projects.ts b/packages/osd-pm/src/production/build_production_projects.ts index dbab2f0d40b1..d3e281c27892 100644 --- a/packages/osd-pm/src/production/build_production_projects.ts +++ b/packages/osd-pm/src/production/build_production_projects.ts @@ -70,10 +70,6 @@ async function getProductionProjects(rootPath: string, onlyOSS?: boolean) { const projects = await getProjects(rootPath, projectPaths); const projectsSubset = [projects.get('opensearch-dashboards')!]; - if (projects.has('x-pack')) { - projectsSubset.push(projects.get('x-pack')!); - } - const productionProjects = includeTransitiveProjects(projectsSubset, projects, { onlyProductionDependencies: true, }); diff --git a/packages/osd-spec-to-console/README.md b/packages/osd-spec-to-console/README.md index 14974314bbd1..d1ed5dd72ea4 100644 --- a/packages/osd-spec-to-console/README.md +++ b/packages/osd-spec-to-console/README.md @@ -25,8 +25,6 @@ At the root of the OpenSearch Dashboards repository, run the following commands: # OSS yarn spec_to_console -g "/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated" -# X-pack -yarn spec_to_console -g "/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated" ``` ### Information used in Console that is not available in the REST spec diff --git a/packages/osd-telemetry-tools/README.md b/packages/osd-telemetry-tools/README.md index b62ea2546cd9..b36227c04701 100644 --- a/packages/osd-telemetry-tools/README.md +++ b/packages/osd-telemetry-tools/README.md @@ -4,7 +4,7 @@ ### Description -The tool is used to extract telemetry collectors schema from all `*.{ts}` files in provided plugins directories to JSON files. The tool looks for `.telemetryrc.json` files in the root of the project and in the `x-pack` dir for its runtime configurations. +The tool is used to extract telemetry collectors schema from all `*.{ts}` files in provided plugins directories to JSON files. The tool looks for `.telemetryrc.json` files in the root of the project. It uses typescript parser to build an AST for each file. The tool is able to validate, extract and match collector schemas. diff --git a/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js b/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js index a66cdeba492b..6e6a4ec42ad1 100644 --- a/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js +++ b/packages/osd-test/src/functional_tests/lib/babel_register_for_test_plugins.js @@ -25,14 +25,7 @@ const { REPO_ROOT } = require('@osd/dev-utils'); // compile the required source with babel require('@babel/register')({ ignore: [/[\/\\](node_modules|target|dist)[\/\\]/], - only: [ - Path.resolve(REPO_ROOT, 'test'), - Path.resolve(REPO_ROOT, 'x-pack/test'), - Path.resolve(REPO_ROOT, 'examples'), - Path.resolve(REPO_ROOT, 'x-pack/examples'), - // TODO: should should probably remove this link back to the source - Path.resolve(REPO_ROOT, 'x-pack/plugins/task_manager/server/config.ts'), - ], + only: [Path.resolve(REPO_ROOT, 'test'), Path.resolve(REPO_ROOT, 'examples')], babelrc: false, presets: [require.resolve('@osd/babel-preset/node_preset')], extensions: ['.js', '.ts', '.tsx'], diff --git a/renovate.json5 b/renovate.json5 index b1e14ba8e1dc..642ba9540cca 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -10,8 +10,6 @@ ], includePaths: [ 'package.json', - 'x-pack/package.json', - 'x-pack/legacy/plugins/*/package.json', 'packages/*/package.json', 'examples/*/package.json', 'test/plugin_functional/plugins/*/package.json', diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 74a3cd79f051..4e768728c6ce 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -226,16 +226,6 @@ export class ClusterManager { /\.md$/, /debug\.log$/, ...pluginInternalDirsIgnore, - fromRoot('x-pack/plugins/reporting/chromium'), - fromRoot('x-pack/plugins/security_solution/cypress'), - fromRoot('x-pack/plugins/apm/e2e'), - fromRoot('x-pack/plugins/apm/scripts'), - fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, - fromRoot('x-pack/plugins/case/server/scripts'), - fromRoot('x-pack/plugins/lists/scripts'), - fromRoot('x-pack/plugins/lists/server/scripts'), - fromRoot('x-pack/plugins/security_solution/scripts'), - fromRoot('x-pack/plugins/security_solution/server/lib/detection_engine/scripts'), ]; this.watcher = chokidar.watch(watchPaths, { diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.ts b/src/core/server/plugins/discovery/plugins_discovery.test.ts index f79bee93aff5..804b72c834ff 100644 --- a/src/core/server/plugins/discovery/plugins_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugins_discovery.test.ts @@ -147,7 +147,6 @@ describe('plugins discovery system', () => { { [`${OPENSEARCH_DASHBOARDS_ROOT}/src/plugins/plugin_a`]: Plugins.valid('pluginA'), [`${OPENSEARCH_DASHBOARDS_ROOT}/plugins/plugin_b`]: Plugins.valid('pluginB'), - [`${OPENSEARCH_DASHBOARDS_ROOT}/x-pack/plugins/plugin_c`]: Plugins.valid('pluginC'), }, { createCwd: false } ); diff --git a/src/dev/i18n/README.md b/src/dev/i18n/README.md index 6a2d05eb7c6e..8bb713b7b1b3 100644 --- a/src/dev/i18n/README.md +++ b/src/dev/i18n/README.md @@ -163,7 +163,7 @@ The tool throws an exception if `formats` object is missing in locale file. ### Usage ```bash -node scripts/i18n_integrate --source path/to/locale.json --target x-pack/legacy/plugins/translations/translations/locale.json +node scripts/i18n_integrate --source path/to/locale.json ``` * `--source` path to the JSON file with translations that should be integrated. diff --git a/src/dev/i18n/tasks/check_configs.ts b/src/dev/i18n/tasks/check_configs.ts index e3dad93c1607..56044f0c808d 100644 --- a/src/dev/i18n/tasks/check_configs.ts +++ b/src/dev/i18n/tasks/check_configs.ts @@ -24,9 +24,8 @@ import { ErrorReporter, checkConfigNamespacePrefix, arrayify } from '..'; export function checkConfigs(additionalConfigPaths: string | string[] = []) { const root = join(__dirname, '../../../../'); const opensearchDashboardsRC = resolve(root, I18N_RC); - const xpackRC = resolve(root, 'x-pack', I18N_RC); - const configPaths = [opensearchDashboardsRC, xpackRC, ...arrayify(additionalConfigPaths)]; + const configPaths = [opensearchDashboardsRC, ...arrayify(additionalConfigPaths)]; return configPaths.map((configPath) => ({ task: async (context: { reporter: ErrorReporter }) => { diff --git a/src/dev/mocha/run_mocha_cli.js b/src/dev/mocha/run_mocha_cli.js index 1438d781e50f..ddd5d7387ba8 100644 --- a/src/dev/mocha/run_mocha_cli.js +++ b/src/dev/mocha/run_mocha_cli.js @@ -70,11 +70,6 @@ export function runMochaCli() { 'src/**/__tests__/**/*.{js,ts,tsx}', 'packages/**/__tests__/**/*.{js,ts,tsx}', 'tasks/**/__tests__/**/*.{js,ts,tsx}', - 'x-pack/common/**/__tests__/**/*.{js,ts,tsx}', - 'x-pack/server/**/__tests__/**/*.{js,ts,tsx}', - `x-pack/legacy/plugins/*/__tests__/**/*.{js,ts,tsx}`, - `x-pack/legacy/plugins/*/common/**/__tests__/**/*.{js,ts,tsx}`, - `x-pack/legacy/plugins/*/**/server/**/__tests__/**/*.{js,ts,tsx}`, ], { cwd: REPO_ROOT, diff --git a/src/dev/notice/generate_notice_from_source.ts b/src/dev/notice/generate_notice_from_source.ts index a72668c3979d..5d31a5e57496 100644 --- a/src/dev/notice/generate_notice_from_source.ts +++ b/src/dev/notice/generate_notice_from_source.ts @@ -50,9 +50,6 @@ export async function generateNoticeFromSource({ productName, directory, log }: '{node_modules,build,dist,data,built_assets}/**', 'packages/*/{node_modules,build,dist}/**', 'src/plugins/*/{node_modules,build,dist}/**', - 'x-pack/{node_modules,build,dist,data}/**', - 'x-pack/packages/*/{node_modules,build,dist}/**', - 'x-pack/plugins/**/{node_modules,build,dist}/**', '**/target/**', ], }; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 6e487b0f5c34..c83af34ed01e 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -36,12 +36,8 @@ export const IGNORE_FILE_GLOBS = [ '**/Gruntfile.js', 'tasks/config/**/*', '**/{Dockerfile,docker-compose.yml}', - 'x-pack/plugins/canvas/tasks/**/*', - 'x-pack/plugins/canvas/canvas_plugin_src/**/*', - 'x-pack/plugins/monitoring/public/lib/jquery_flot/**/*', '**/.*', '**/__mocks__/**/*', - 'x-pack/docs/**/*', 'src/core/server/core_app/assets/fonts/**/*', 'packages/osd-utility-types/test-d/**/*', '**/Jenkinsfile*', @@ -63,13 +59,8 @@ export const IGNORE_FILE_GLOBS = [ 'packages/elastic-safer-lodash-set/**/*', // TODO fix file names in APM to remove these - 'x-pack/plugins/apm/public/**/*', - 'x-pack/plugins/apm/scripts/**/*', - 'x-pack/plugins/apm/e2e/**/*', - 'x-pack/plugins/maps/server/fonts/**/*', // packages for the ingest manager's api integration tests could be valid semver which has dashes - 'x-pack/test/ingest_manager_api_integration/apis/fixtures/test_packages/**/*', ]; /** @@ -77,8 +68,10 @@ export const IGNORE_FILE_GLOBS = [ * folders that must use kebab case. * * @type {Array} + * */ -export const KEBAB_CASE_DIRECTORY_GLOBS = ['packages/*', 'x-pack']; + +export const KEBAB_CASE_DIRECTORY_GLOBS = ['packages/*']; /** * These patterns are matched against directories and indicate @@ -102,8 +95,6 @@ export const IGNORE_DIRECTORY_GLOBS = [ 'src/legacy/ui/public/flot-charts', 'test/functional/fixtures/opensearch_archiver/visualize_source-filters', 'packages/osd-pm/src/utils/__fixtures__/*', - 'x-pack/dev-tools', - 'packages/osd-optimizer/src/__fixtures__/mock_repo/x-pack', ]; /** @@ -146,41 +137,4 @@ export const TEMPORARILY_IGNORED_PATHS = [ 'packages/osd-ui-framework/doc_site/src/images/elastic-logo.svg', 'packages/osd-ui-framework/doc_site/src/images/hint-arrow.svg', 'packages/osd-ui-framework/doc_site/src/images/react-logo.svg', - 'x-pack/legacy/plugins/index_management/public/lib/editSettings.js', - 'x-pack/legacy/plugins/license_management/public/store/reducers/licenseManagement.js', - 'x-pack/plugins/monitoring/public/components/sparkline/__mocks__/plugins/xpack_main/jquery_flot.js', - 'x-pack/plugins/monitoring/public/icons/health-gray.svg', - 'x-pack/plugins/monitoring/public/icons/health-green.svg', - 'x-pack/plugins/monitoring/public/icons/health-red.svg', - 'x-pack/plugins/monitoring/public/icons/health-yellow.svg', - 'x-pack/plugins/reporting/server/export_types/common/assets/fonts/noto/NotoSansCJKtc-Medium.ttf', - 'x-pack/plugins/reporting/server/export_types/common/assets/fonts/noto/NotoSansCJKtc-Regular.ttf', - 'x-pack/plugins/reporting/server/export_types/common/assets/fonts/roboto/Roboto-Italic.ttf', - 'x-pack/plugins/reporting/server/export_types/common/assets/fonts/roboto/Roboto-Medium.ttf', - 'x-pack/plugins/reporting/server/export_types/common/assets/fonts/roboto/Roboto-Regular.ttf', - 'x-pack/plugins/reporting/server/export_types/common/assets/img/logo-grey.png', - 'x-pack/test/functional/opensearch_archives/monitoring/beats-with-restarted-instance/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/beats-with-restarted-instance/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/logstash-pipelines/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/logstash-pipelines/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/multi-basic/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/multi-basic/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-basic-beats/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-basic-beats/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-gold/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-gold/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-platinum/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-platinum/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-trial-two-nodes-one-cgrouped/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-green-trial-two-nodes-one-cgrouped/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-red-platinum/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-red-platinum/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-three-nodes-shard-relocation/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-three-nodes-shard-relocation/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-basic/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-basic/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-platinum--with-10-alerts/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-platinum--with-10-alerts/mappings.json', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-platinum/data.json.gz', - 'x-pack/test/functional/opensearch_archives/monitoring/singlecluster-yellow-platinum/mappings.json', ]; diff --git a/src/dev/run_check_lockfile_symlinks.js b/src/dev/run_check_lockfile_symlinks.js index 9ffac48bb6e3..c24f857c0b32 100644 --- a/src/dev/run_check_lockfile_symlinks.js +++ b/src/dev/run_check_lockfile_symlinks.js @@ -34,10 +34,6 @@ const IGNORE_FILE_GLOBS = [ '**/test/**/*', // fixtures aren't used in production, ignore them '**/*fixtures*/**/*', - // cypress isn't used in production, ignore it - 'x-pack/plugins/apm/e2e/*', - // apm scripts aren't used in production, ignore them - 'x-pack/plugins/apm/scripts/*', ]; run(async ({ log }) => { diff --git a/src/dev/run_i18n_check.ts b/src/dev/run_i18n_check.ts index 1538069e89d2..2a8c5bc866cb 100644 --- a/src/dev/run_i18n_check.ts +++ b/src/dev/run_i18n_check.ts @@ -72,7 +72,7 @@ run( throw createFailError(`${chalk.white.bgRed(' I18N ERROR ')} --fix can't have a value`); } - const srcPaths = Array().concat(path || ['./src', './packages', './x-pack']); + const srcPaths = Array().concat(path || ['./src', './packages']); const list = new Listr( [ diff --git a/src/dev/run_i18n_extract.ts b/src/dev/run_i18n_extract.ts index 879494bf8812..9f2903868511 100644 --- a/src/dev/run_i18n_extract.ts +++ b/src/dev/run_i18n_extract.ts @@ -46,7 +46,7 @@ run( `${chalk.white.bgRed(' I18N ERROR ')} --path and --include-config require a value` ); } - const srcPaths = Array().concat(path || ['./src', './packages', './x-pack']); + const srcPaths = Array().concat(path || ['./src', './packages']); const list = new Listr([ { diff --git a/src/dev/run_i18n_integrate.ts b/src/dev/run_i18n_integrate.ts index 6a5442f72901..1447e2139cb5 100644 --- a/src/dev/run_i18n_integrate.ts +++ b/src/dev/run_i18n_integrate.ts @@ -77,7 +77,7 @@ run( ); } - const srcPaths = Array().concat(path || ['./src', './packages', './x-pack']); + const srcPaths = Array().concat(path || ['./src', './packages']); const list = new Listr([ { diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index b22510aa9615..81d63c91ef48 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -18,13 +18,6 @@ */ export const storybookAliases = { - apm: 'x-pack/plugins/apm/.storybook', - canvas: 'x-pack/plugins/canvas/storybook', codeeditor: 'src/plugins/opensearch_dashboards_react/public/code_editor/.storybook', - dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/.storybook', embeddable: 'src/plugins/embeddable/.storybook', - infra: 'x-pack/plugins/infra/.storybook', - security_solution: 'x-pack/plugins/security_solution/.storybook', - ui_actions_enhanced: 'x-pack/plugins/ui_actions_enhanced/.storybook', - observability: 'x-pack/plugins/observability/.storybook', }; diff --git a/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx b/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx index 60bb13a43727..c5b39858c76d 100644 --- a/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx +++ b/src/plugins/discover/public/application/components/sidebar/change_indexpattern.tsx @@ -34,8 +34,6 @@ export type ChangeIndexPatternTriggerProps = EuiButtonEmptyProps & { title?: string; }; -// TODO: refactor to shared component with ../../../../../../../../x-pack/legacy/plugins/lens/public/indexpattern_plugin/change_indexpattern - export function ChangeIndexPattern({ indexPatternRefs, indexPatternId, diff --git a/src/plugins/usage_collection/README.md b/src/plugins/usage_collection/README.md index c1a09a0126b2..70bc38d3b19e 100644 --- a/src/plugins/usage_collection/README.md +++ b/src/plugins/usage_collection/README.md @@ -200,20 +200,8 @@ New fields added to the telemetry payload currently mean that telemetry cluster There are a few ways you can test that your usage collector is working properly. 1. The `/api/stats?extended=true&legacy=true` HTTP API in OpenSearch Dashboards (added in 6.4.0) will call the fetch methods of all the registered collectors, and add them to a stats object you can see in a browser or in curl. To test that your usage collector has been registered correctly and that it has the model of data you expected it to have, call that HTTP API manually and you should see a key in the `usage` object of the response named after your usage collector's `type` field. This method tests the Metricbeat scenario described above where `callCluster` wraps `callWithRequest`. -2. There is a dev script in x-pack that will give a sample of a payload of data that gets sent up to the telemetry cluster for the sending phase of telemetry. Collected data comes from: - - The `.monitoring-*` indices, when Monitoring is enabled. Monitoring enhances the sent payload of telemetry by producing usage data potentially of multiple clusters that exist in the monitoring data. Monitoring data is time-based, and the time frame of collection is the last 15 minutes. - - Live-pulled from OpenSearch API endpoints. This will get just real-time stats without context of historical data. - - The dev script in x-pack can be run on the command-line with: - - ```shell - cd x-pack - node scripts/api_debug.js telemetry --host=http://localhost:5601 - ``` - - Where `http://localhost:5601` is a OpenSearch Dashboards server running in dev mode. If needed, authentication and basePath info can be provided in the command as well. - - Automatic inclusion of all the stats fetched by collectors is added in [#22336](https://github.com/elastic/kibana/pull/22336) / 6.5.0 -3. In Dev mode, OpenSearch Dashboards will send telemetry data to a staging telemetry cluster. Assuming you have access to the staging cluster, you can log in and check the latest documents for your new fields. -4. If you catch the network traffic coming from your browser when a telemetry payload is sent, you can examine the request payload body to see the data. This can be tricky as telemetry payloads are sent only once per day per browser. Use incognito mode or clear your localStorage data to force a telemetry payload. +2. In Dev mode, OpenSearch Dashboards will send telemetry data to a staging telemetry cluster. Assuming you have access to the staging cluster, you can log in and check the latest documents for your new fields. +3. If you catch the network traffic coming from your browser when a telemetry payload is sent, you can examine the request payload body to see the data. This can be tricky as telemetry payloads are sent only once per day per browser. Use incognito mode or clear your localStorage data to force a telemetry payload. ## FAQ