Commit graph

97 commits

Author SHA1 Message Date
Kibana Machine
4628c55bb0
[8.8] [ML] Fix the file upload telemetry (#157888) (#157969)
# Backport

This will backport the following commits from `main` to `8.8`:
- [[ML] Fix the file upload telemetry
(#157888)](https://github.com/elastic/kibana/pull/157888)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2023-05-17T09:36:58Z","message":"[ML]
Fix the file upload telemetry (#157888)\n\n## Summary\r\n\r\nFixes the
usage collector for the file upload plugin. According to the\r\ngit
history it hasn't been working
since\r\nhttps://github.com/elastic/kibana/pull/60418.\r\n\r\nThe saved
objects repository required for retrieving telemetry data\r\nwasn't
provided, causing telemetry to fall back to\r\n`index_creation_count: 0`
after each check.\r\n\r\n\r\n### How to test \r\n\r\nExecute the
following request in the Dev Console.\r\n\r\n```\r\nPOST
kbn:/api/telemetry/v2/clusters/_stats\r\n{ \"unencrypted\": true
}\r\n```\r\n\r\n\r\n[`mlUsage`](9047d69d57/x-pack/plugins/file_upload/server/telemetry/usage_collector.ts (L36))\r\nshouldn't
be
`null`.","sha":"57af98f38a535432f7f085abaa3c9e7e4f67a53a","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:File
Upload","telemetry","v8.9.0","v8.8.1"],"number":157888,"url":"https://github.com/elastic/kibana/pull/157888","mergeCommit":{"message":"[ML]
Fix the file upload telemetry (#157888)\n\n## Summary\r\n\r\nFixes the
usage collector for the file upload plugin. According to the\r\ngit
history it hasn't been working
since\r\nhttps://github.com/elastic/kibana/pull/60418.\r\n\r\nThe saved
objects repository required for retrieving telemetry data\r\nwasn't
provided, causing telemetry to fall back to\r\n`index_creation_count: 0`
after each check.\r\n\r\n\r\n### How to test \r\n\r\nExecute the
following request in the Dev Console.\r\n\r\n```\r\nPOST
kbn:/api/telemetry/v2/clusters/_stats\r\n{ \"unencrypted\": true
}\r\n```\r\n\r\n\r\n[`mlUsage`](9047d69d57/x-pack/plugins/file_upload/server/telemetry/usage_collector.ts (L36))\r\nshouldn't
be
`null`.","sha":"57af98f38a535432f7f085abaa3c9e7e4f67a53a"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157888","number":157888,"mergeCommit":{"message":"[ML]
Fix the file upload telemetry (#157888)\n\n## Summary\r\n\r\nFixes the
usage collector for the file upload plugin. According to the\r\ngit
history it hasn't been working
since\r\nhttps://github.com/elastic/kibana/pull/60418.\r\n\r\nThe saved
objects repository required for retrieving telemetry data\r\nwasn't
provided, causing telemetry to fall back to\r\n`index_creation_count: 0`
after each check.\r\n\r\n\r\n### How to test \r\n\r\nExecute the
following request in the Dev Console.\r\n\r\n```\r\nPOST
kbn:/api/telemetry/v2/clusters/_stats\r\n{ \"unencrypted\": true
}\r\n```\r\n\r\n\r\n[`mlUsage`](9047d69d57/x-pack/plugins/file_upload/server/telemetry/usage_collector.ts (L36))\r\nshouldn't
be
`null`.","sha":"57af98f38a535432f7f085abaa3c9e7e4f67a53a"}},{"branch":"8.8","label":"v8.8.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <dmitrii.arnautov@elastic.co>
2023-05-17 03:48:22 -07:00
Jason Stoltzfus
c339ca8394
Upgraded EUI to v76.0.0 (#152506)
👋 Hi all - the biggest breaking change of this PR is around two icon
type changes/renames.

1. ⚠️ **The  `alert` icon is now named `warning`**
- <img width="103" alt=""
src="https://user-images.githubusercontent.com/549407/223561599-8913e88c-676f-47cd-aaed-81b64783bd81.png"
align="middle">
- This change should have been automatically converted on your behalf by
the EUI team, **but if for some reason** we missed making this
conversion in this PR and your icon(s) are now broken, please ping us or
let us know in this PR (or fix yourself after this PR merges).
- In some cases, teams were using this icon for error messages,
alongside the `danger` color. In those cases, we opinionatedly changed
those icon usages to the new `error` icon instead of using the old
alert/warning icon.

2. 🛑 **The `crossInACircleFilled` icon has been removed, and a new
`error` icon added**
- <img width="84" alt=""
src="https://user-images.githubusercontent.com/549407/223561892-4406bdf6-1a55-49ac-85ad-3a11eb7c090d.png"
align="middle">
- The conversion for this breaking change was not straightforward. This
was the path we used to determine what to change `crossInACircleFilled`
usages to:
- If the icon was associated with errors or error messages, we changed
it to the new `error` icon.
- If a "delete" action was associated with this icon, we changed it to
the `trash` icon instead.
- If a "clear" action was associated with this icon, we changed it to
just the `cross` icon, or in some cases `minusInCircleFilled` (if used
alongside `plusInCircleFilled`).
- Again, if we made a mistake during this conversion or missed your
plugin, please feel free to ping us.

## Summary

`eui@75.1.2`  `eui@76.0.2`

## [`76.0.2`](https://github.com/elastic/eui/tree/v76.0.2)

**Bug fixes**

- Added a legacy `alert` alias for the `warning` `EuiIcon` type
([#6640](https://github.com/elastic/eui/pull/6640))

## [`76.0.1`](https://github.com/elastic/eui/tree/v76.0.1)

**Bug fixes**

- Fixed broken icons on all `isInvalid` form controls
([#6629](https://github.com/elastic/eui/pull/6629))

## [`76.0.0`](https://github.com/elastic/eui/tree/v76.0.0)

- Added `pivot` glyph to `EuiIcon`
([#6605](https://github.com/elastic/eui/pull/6605))
- Added the `displayHeaderCellProps` API to `EuiDataGrid`'s columns,
which allows passing custom props directly to column header cells
([#6609](https://github.com/elastic/eui/pull/6609))
- Added the new `headerCellProps`/`footerCellProps` APIs to
`EuiDataGrid`'s control columns, which allows passing custom props
directly to control column header or footer cells
([#6609](https://github.com/elastic/eui/pull/6609))
- Added a new `footerCellRender` API to `EuiDataGrid`'s control columns,
which allows completely customizing control column rendering (previously
rendered an empty cell)
([#6609](https://github.com/elastic/eui/pull/6609))
- Updated the styling of nested ordered lists in `EuiText` to align with
GitHub's list style, which is a popular format used in Markdown or MDX
formatting ([#6615](https://github.com/elastic/eui/pull/6615))
- Added a margin-bottom property exclusively to the direct child `ul`
and `ol` elements of the `EuiText` component
([#6615](https://github.com/elastic/eui/pull/6615))
- Fix issue with badges appearing within an `EuiBadgeGroup`, where the
CSS rule to override the `margin-inline-start` was not being applied
correctly due to the order of appearance in the CSS rules
([#6618](https://github.com/elastic/eui/pull/6618))

**Bug fixes**

- Fixed `EuiDataGrid` footer control columns rendering with cell
expansion popovers when they should not have been
([#6609](https://github.com/elastic/eui/pull/6609))
- Fixed an `EuiSkipLink` bug where main content loading in
progressively/dynamically after the skip link rendered was not being
correctly focused ([#6613](https://github.com/elastic/eui/pull/6613))

**Breaking changes**

- Renamed `EuiIcon`'s `alert` to `warning`
([#6608](https://github.com/elastic/eui/pull/6608))
- Removed `EuiIcon`'s `crossInACircleFilled` in favor of `error`
([#6608](https://github.com/elastic/eui/pull/6608))

---------

Co-authored-by: Davey Holler <daveyholler@hey.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2023-03-14 14:27:40 -05:00
Pierre Gayvallet
e058c06d57
Capability resolver: minor optimizations (#152784)
## Summary

Related to https://github.com/elastic/kibana/issues/146881

I tried to fix the issue, but couldn't so I kept the tiny optimizations
I made on the way:
- optimize reduce blocks to re-use the memo instead of spreading into a
new object
- update most of the existing resolver to only return the list of
changes rather than the whole capability objects (which was how it was
supposed to work) - minor perf improvement when merging the result of
the resolvers
2023-03-09 08:37:42 +01:00
Thomas Watson
5fa79fc9b3
Remove @loaders.gl/polyfills dev-dependency (#151287) 2023-02-15 15:03:37 +01:00
Spencer
1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
Nathan Reese
55702f446e
[Maps] fix Kibana Maps UI upload geojson failure should be received as such (#149969)
Fixes https://github.com/elastic/kibana/issues/138122

PR updates geo spatial file upload to show error callout if all features
fail indexing. PR updates geo spatial file upload to show warning
callout if some features fail indexing.

<img width="150" alt="Screen Shot 2023-01-31 at 11 34 49 AM"
src="https://user-images.githubusercontent.com/373691/215851548-11cf9fa8-7c59-4d21-9257-664ab00f418d.png">

<img width="150" alt="Screen Shot 2023-01-31 at 11 34 32 AM"
src="https://user-images.githubusercontent.com/373691/215851557-09dfbef3-ae0e-4ddd-b617-9c70a66fa712.png">

To test save the following geojson samples as a file with the name
`<filename>.geojson`. Then upload the files in kibana. Verify errors are
displayed as expected

all invalid features
```
{
  "type" : "FeatureCollection",
  "features" : [{ 
    "type" : "Feature", 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 100000, 42.417500 ] 
    }
  }]
}
```

some invalid features
```
{
  "type" : "FeatureCollection",
  "features" : [{ 
    "type" : "Feature", 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 0, 0 ] 
    }
  },
  { 
    "type" : "Feature", 
    "geometry" : { 
      "type" : "Point", 
      "coordinates" : [ 100000, 0 ] 
    }
  }]
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-31 15:14:29 -07:00
Nathan Reese
312586043b
[file upload] verify CRS for geojson upload (#148403)
Fixes https://github.com/elastic/kibana/issues/146420 and
https://github.com/elastic/kibana/issues/138128

PR adds verification logic to ensure Geojson is correct CRS

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-04 15:36:41 -05:00
Spencer
afb09ccf8a
Transpile packages on demand, validate all TS projects (#146212)
## Dearest Reviewers 👋 

I've been working on this branch with @mistic and @tylersmalley and
we're really confident in these changes. Additionally, this changes code
in nearly every package in the repo so we don't plan to wait for reviews
to get in before merging this. If you'd like to have a concern
addressed, please feel free to leave a review, but assuming that nobody
raises a blocker in the next 24 hours we plan to merge this EOD pacific
tomorrow, 12/22.

We'll be paying close attention to any issues this causes after merging
and work on getting those fixed ASAP. 🚀

---

The operations team is not confident that we'll have the time to achieve
what we originally set out to accomplish by moving to Bazel with the
time and resources we have available. We have also bought ourselves some
headroom with improvements to babel-register, optimizer caching, and
typescript project structure.

In order to make sure we deliver packages as quickly as possible (many
teams really want them), with a usable and familiar developer
experience, this PR removes Bazel for building packages in favor of
using the same JIT transpilation we use for plugins.

Additionally, packages now use `kbn_references` (again, just copying the
dx from plugins to packages).

Because of the complex relationships between packages/plugins and in
order to prepare ourselves for automatic dependency detection tools we
plan to use in the future, this PR also introduces a "TS Project Linter"
which will validate that every tsconfig.json file meets a few
requirements:

1. the chain of base config files extended by each config includes
`tsconfig.base.json` and not `tsconfig.json`
1. the `include` config is used, and not `files`
2. the `exclude` config includes `target/**/*`
3. the `outDir` compiler option is specified as `target/types`
1. none of these compiler options are specified: `declaration`,
`declarationMap`, `emitDeclarationOnly`, `skipLibCheck`, `target`,
`paths`

4. all references to other packages/plugins use their pkg id, ie:
	
	```js
    // valid
    {
      "kbn_references": ["@kbn/core"]
    }
    // not valid
    {
      "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }]
    }
    ```

5. only packages/plugins which are imported somewhere in the ts code are
listed in `kbn_references`

This linter is not only validating all of the tsconfig.json files, but
it also will fix these config files to deal with just about any
violation that can be produced. Just run `node scripts/ts_project_linter
--fix` locally to apply these fixes, or let CI take care of
automatically fixing things and pushing the changes to your PR.

> **Example:** [`64e93e5`
(#146212)](64e93e5806)
When I merged main into my PR it included a change which removed the
`@kbn/core-injected-metadata-browser` package. After resolving the
conflicts I missed a few tsconfig files which included references to the
now removed package. The TS Project Linter identified that these
references were removed from the code and pushed a change to the PR to
remove them from the tsconfig.json files.

## No bazel? Does that mean no packages??
Nope! We're still doing packages but we're pretty sure now that we won't
be using Bazel to accomplish the 'distributed caching' and 'change-based
tasks' portions of the packages project.

This PR actually makes packages much easier to work with and will be
followed up with the bundling benefits described by the original
packages RFC. Then we'll work on documentation and advocacy for using
packages for any and all new code.

We're pretty confident that implementing distributed caching and
change-based tasks will be necessary in the future, but because of
recent improvements in the repo we think we can live without them for
**at least** a year.

## Wait, there are still BUILD.bazel files in the repo
Yes, there are still three webpack bundles which are built by Bazel: the
`@kbn/ui-shared-deps-npm` DLL, `@kbn/ui-shared-deps-src` externals, and
the `@kbn/monaco` workers. These three webpack bundles are still created
during bootstrap and remotely cached using bazel. The next phase of this
project is to figure out how to get the package bundling features
described in the RFC with the current optimizer, and we expect these
bundles to go away then. Until then any package that is used in those
three bundles still needs to have a BUILD.bazel file so that they can be
referenced by the remaining webpack builds.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-22 19:00:29 -06:00
Nathan Reese
58c11ed59c
[maps] Fix uploading FeatureCollection as feature when file contains single Feature (#147207)
Fixes https://github.com/elastic/kibana/issues/146417

PR resolves edge case where when uploading a file containing a
FeatureCollection with a single feature, the results incorrectly state
that 2 features where indexed with one failing.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-12-14 12:08:00 -05:00
Spencer
7d77d39e1f
[ts] set allowJs to true by default (#144281)
* [ts] set allowJs to true by default

* fix scripts/check_ts_projects, original implementation is now wildly inefficient

* produce stats in check_ts_projects to make sure it's actually working

* fix imports
2022-11-01 15:26:44 -07:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Nathan Reese
63fd2ce656
[Maps] fix map app crashing on file upload request timeout (#139760)
* [Maps] fix GeoJSON upload fails

* remove console.log statement

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* replace slowConnection with uploadSize

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* convert back to switch

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-13 10:43:22 -06:00
James Gowdy
2b9faa0d12
[File data visualizer] Adding ecs_compatibility setting for find structure calls (#139708)
* [File data visualizer] Adding ecs_compatibility setting for find structure calls

* fixing tests
2022-08-31 09:07:07 +01:00
Nick Peihl
6c08eacdc0
[File Upload] [Maps] Reduce precision of coordinates for geo imports (#135133)
* Reduce precision of coordinates for geo imports

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Revert to jsts@1.6.2

The jsts library does not transpile modules since 2.0. So it is not currently possible to use the newer library.

* Fix yarn lockfile

* Fix test

Test runs on features, not feature collections. 😬

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-07-08 09:57:16 -07:00
Walter Rafelsberger
adbd6a5fb8
[ML] @kbn/ml-agg-utils, @kbn/ml-is-populated-object, @kbn/ml-string-hash packages. (#132963)
Moves some ML utility code to packages.

- @kbn/ml-agg-utils contains multiple utilities used in combination related to building aggregations.
- @kbn/ml-is-populated-object contains the isPopulatedObject() utility function used across several plugins.
- @kbn/ml-string-hash contains the stringHash() utility function used across several plugins.
2022-06-23 10:38:23 +02:00
Pierre Gayvallet
a02c00b8a3
Change ContextContainer to lazily initialize providers (#129896)
* Change ContextContainer to lazily initialize providers

* Introduce CustomRequestHandlerContext, start adapting usages

* adapt IContextProvider's return type

* start fixing violations

* fixing violations - 2

* adapt home routes

* fix remaining core violation

* fix violations on core tests

* fixing more violations

* fixing more violations

* update generated doc...

* fix more violations

* adapt remaining RequestHandlerContext

* fix more violations

* fix non-async method

* more fixes

* fix another await in non async method

* add yet another missing async

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* add yet yet another missing async

* update fleet's endpoints

* fix telemetry endpoints

* fix event_log endpoints

* fix some security unit tests

* adapt canvas routes

* adapt alerting routes

* adapt more so_tagging routes

* fix data_enhanced routes

* fix license_management routes

* fix file_upload routes

* fix index_management routes

* fix lists routes

* fix snapshot_restore routes

* fix rule_registry routes

* fix ingest_pipelines routes

* fix remote_clusters routes

* fix index_lifecycle_management routes

* improve and fix the lazy implementation

* fix triggers_actions_ui endpoints

* start fixing unit tests

* fix cases routes

* fix transform routes

* fix upgrade_assistant routes

* fix uptime route wrapper

* fix uptime route wrapper bis

* update osquery routes

* update cross_cluster_replication routes

* fix some ML routes / wrappers

* adapt maps routes

* adapt rollup routes

* fix some canvas unit tests

* fix more canvas unit tests

* fix observability wrapper

* fix (?) infra type hell

* start fixing monitoring

* fix a few test plugins

* woups

* fix yet more violations

* fixing UA  tests

* fix logstash handlers

* fix fleet unit tests

* lint?

* one more batch

* update security_solution endpoints

* start fixing security_solution mocks

* start fixing security_solution tests

* fix more security_solution tests

* fix more security_solution tests

* just one more

* fix last (?) security_solution tests

* fix timelion javascript file

* fix more test plugins

* fix transforms context type

* fix ml context type

* fix context tests

* fix securitySolution withEndpointAuthz tests

* fix features unit tests

* fix actions unit tests

* fix imports

* fix duplicate import

* fix some merge problems

* fix new usage

* fix new test

* introduces context.resolve

* down the rabbit hole again

* start fixing test type failures

* more test type failures fixes

* move import comment back to correct place

* more test type failures fixes, bis

* use context.resolve for security solution rules routes

* fix new violations due to master merge

* remove comment

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-22 13:15:58 +02:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Nodir Latipov
3e2761d981
[Unified search] Create unified search plugin (#127651)
* [Unified search] Create unified search plugin

* add unified_search into USES_STYLED_COMPONENTS

* fix JEST group 4

* update limits for data plugin

* fix: remove unifiedSearch plugin from x-pack/plugins/file_upload

* feat: updated .github/CODEOWNERS and set @elastic/kibana-app-services as a code owner

* apply PR comments

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* feat: moved filter bar, apply filters folders and apply filter action from Data plugin to unified search plugin

* fix Checks

* fix Checks

* fix Linting and Default CI Group #16

* fix Checks

* fix Checks

* fix Linting (with types)

* fix show FILTER_BAR

* fix Jest Tests

* feat replece indexPatternsContranct in setIndexPatterns to DataViewsContract

* feat: removed unnecessary interface in unified search

* fix Checks

* fix Checks

* fix Jest Tests, Checks

* fix Checks

* resolve comments

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-04-05 12:23:31 +05:00
Pete Harverson
61955d53f6
[ML][File upload] Migrate IndexPattern service usage to DataView service (#128600)
* [ML][File upload] Migrate IndexPattern service usage to DataView service

* [ML][File upload] Update translations

* [ML][File upload] Fix API tests
2022-03-28 15:10:47 +01:00
Max Kovalev
0cd251ec4d
[Maps][File upload] Remove usage of max file size advanced setting 1GB limit in geo file upload (#127639)
* #93261 - Usage of maxFileSize in geo upload form is removed

* 93261 - refactoring

* 93261 - fixed translation checks

* 93261 - documentation updates

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-16 15:25:07 -06:00
Spencer
192309fc27
Typescript upgrade to 4.6.2 (#126935) 2022-03-08 10:21:38 -06:00
Pierre Gayvallet
6627bd8b3a
Elasticsearch client: no longer default to using meta: true (#124488)
* Use `Client` interface instead of `KibanaClient`

* get rid of getKibanaEsClient and convertToKibanaClient

* get rid of last KibanaClient usages

* update usages and types in @kbn/securitysolution-es-utils

* fix some violations

* add sugar method around client mock

* update SO repository calls

* adapt more core usages

* export mock types

* batch 1

* batch 2

* batch 3

* batch 4

* batch 5

* batch 6

* batch 7

* batch 8

* batch 9

* security - batch 1

* security - batch 2

* security - batch 3

* last batch of initial violations

* fix resolve_time_pattern

* update generated doc

* fix /internal/index-pattern-management/preview_scripted_field endpoint

* fix monitoring's getLegacyClusterShim

* fix /api/snapshot_restore/privileges route

* fix UptimeESClient

* fix transforms/_nodes endpoint

* lint

* unit test fix - batch 1

* unit test fix - batch 2

* unit test fix - batch 3

* integration test fix - batch 1

* lint

* adapt ML client

* unit test fix - batch 4

* fix uptime test helper

* fix /api/transform/transforms/{transformId}/_update route

* fix ES client FTR test

* fix uptime unit test

* fix type errors on last unit tests

* fix RollupSearchStrategy call

* fix /internal/security/fields/{query} route

* fix GET /api/index_lifecycle_management/policies route

* fix mlClient.getDataFrameAnalytics

* fix APMEventClient

* fix security solution getBootstrapIndexExists

* fix data_enhanced's getSearchStatus

* remove unused @ts-expect-error

* fix unit tests due to latest code changes

* fix more calls in security_solution routes

* fix more calls in ml routes

* fix POST /api/index_management/component_templates route

* fix unit tests due to latest changes

* fix rule_registry's ResourceInstaller.createOrUpdateIndexTemplate

* fix more fleet client calls

* fix UA's GET cloud_backup_status route

* fix createLifecycleExecutorApiTest

* fix hasFleetServers

* fix unit tests due to latest changes

* changes due to last merge

* fix ml modelProvider.getModelsPipelines

* fix security_solution LifecycleQuery.search

* fix new CoreUsageDataService usage

* fix security solution's StatsQuery.search

* improve ml FTR assertions

* fix security_solution's EventsQuery.search

* fix EsClient type as we're keeping transport

* NITs

* clean RepositoryEsClient type

* update generated doc

* review comments

* adapt mlClient.anomalySearch signature

* remove unnecessary .then((body) => body)

* nit

* add unit tests for the client mocking functions

* fix new upgrade assistant /remote_clusters endpoint
2022-02-12 09:19:44 +01:00
Tiago Costa
b7e366c483
chore(NA): bump version to 8.2.0 (#124409)
* chore(NA): bump version to 8.2.0

* test(NA): update thrown error message for v8.2.0

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-02 23:21:59 +00:00
Nathan Reese
790089e18f
[maps] shapefile import (#123764)
* [maps] shapefile importer

* render importer editor

* shapefile_editor

* break geojson_importer into abstract class

* start shapefile_importer _readNext

* parse shapefile

* getProgress

* comments

* set table row count

* hide shapefile editor once all files selected

* i18n fixes

* validate sidecar file names match .shp name

* rename JsonUploadAndParse to GeoUploadWizard

* eslint

* tslint

* fix getFileNameWithoutExt

* backout i18n changes

* reset i18n files to main

* revert to main zh-CN.json

* i18n updates

* use geoJsonCleanAndValidate to clean features from all geo importers

* update docs

* doc refinement

* tslint fix for loaders

* eslint

* shapefile upload functional test

* geoFileUploadPageObject

* add geojson functional test with geoFileUpload page object

* replace old workflow functional tests with new ones based on geoFileUplad page object

* tslint and eslint

* eslint

* fix jest test

* use smaller chunks to avoid timeout in CI

* try without geojson test

* try small geojson file in CI

* point.json

* do not use copy to clipboard, does not work in CI

* eslint

* more linting

* add retry

* one more thing for functional tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-01 11:06:49 -07:00
James Gowdy
3797b78ce7
[File data visualizer] Removing file upload retries (#123696) 2022-01-25 14:35:21 +00:00
Walter Rafelsberger
d744500c24
[ML] Remove export wildcard syntax for file upload plugin. (#123205)
Remove export wildcard syntax for file upload plugin.
2022-01-20 19:12:44 +01:00
Quynh Nguyen
f8d932f70a
[ML] Fix runtime field validations not supporting special script types (#122469)
* Fix validations not handling extra things like params or lang

* Add translations

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-18 12:19:33 -06:00
Quynh Nguyen
600abd7535
[ML] Add options to exclude or include frozen data tier for Anomaly detection and Index data visualizer (#122306)
* Add exclude frozen data tier

* Rename util name to addExcludeFrozenToQuery for clarity

* Add menu option to let user pick

* Add menu option to let user pick

* Fix match_all which is not valid if we want to exclude

* Update snapshot

* Update texts

* Fix translations

* Add storage pref & radio

* Update dv selector, snapshots

* Fix message

* Update texts

* Update snapshots

* Put in useMemo

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-14 12:07:13 -06:00
James Gowdy
052ab06c61
[ML] Editing semi-structured text fields in grok pattern (#122274)
* [ML] Editing semi-structured text fields in grok pattern

* changes based on review

* fixing apache type patterns

* adding tests

* renaming test description

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-10 15:41:07 +00:00
James Gowdy
078f176c04
[ML] File data visualizer reduce chunk size for slow processors (#121353)
* [ML] File data visualizer reduce chunk size for slow processors

* adding constant

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-04 15:12:28 +00:00
Mikhail Shustov
38feafad72
Update ES client to canary.37 (#119791)
* upgrade es client to canary 37

* fix error in core

* mute error in test/

* mute incompatible errors

* unskip request_entity_too_large_exception test

* commit autofix

* unskip batch_size_bytes_exceeds_es_content_length test

* fix errors in Core code

* fix or mute errors in data plugin

* fix data_view_management

* fix error index_management

* fix x-pack/test errors

* fix watcher

* fix event_log

* fix data_enhanced

* fix uptime

* fix triggers_actions_ui

* fix transform

* fix reporting

* fix rule_registry

* fix timeline

* fix task_manager

* fix security_solution

* fix rule_registry

* fix fleet

* fix index_management

* fix lens

* fix maps

* fix ml

* fix observability

* bump to canary 8.1-2

* fix error in packages

* fix errors in core

* fix errors in data

* fix errors in discover

* fix some discover tests

* fix errors in telemetry

* fix alerting

* fix errors in apm

* fix errors in event_log

* fix errors in fleet

* fix errors in infra

* fix errors in lists

* mute errors in maps

* fix errors in ml

* fix errors in osquery

* fix errors in security_solution

* fix errors in stack_alerts

* fix errors in task_manager

* fix errors in timelines

* fix errors in transform

* fix errors in watcher

* fix errors in tests

* update docs

* adjust fleet code

* fix problem in fleet

* remove outdated _type from data plugin tests

* fix packages tests

* update type

* fix tests part 2

* Adds product header back to elasticsearch

* Updates API docs

* Fix Discover tests

* update alerting typings

* Fix type errors

* Import Sort type

* Update x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>

* Remove double negation

* Fix snapshot conflict issues after merge from "main"

Co-authored-by: Christiane Heiligers <christiane.heiligers@elastic.co>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2021-12-24 14:43:53 +01:00
Thomas Neirynck
f4bfd4dfc0
[File upload] Rename geo-shape field to geometry (#120023) 2021-12-01 09:35:01 -05:00
Tiago Costa
9d662b77be
chore(NA): splits types from code on @kbn/i18n (#119256)
* chore(NA): auto creation of the package.json for the new types pkg rule

* chore(NA): first alpha api extractor working version

* chore(NA): support kbn-analytics

* chore(NA): correctly read tsconfig files and deps from ts_config rule

* chore(NA): layed out pkg_npm_types tree artifact custom rule

* chore(NA): missing todos

* chore(NA): node modules link mapping

* chore(NA): fully working pkg_npm_types rule

* chore(NA): fix changes on new packages using elastic datemath pkgs

* docs(NA): remove todo

* docs(NA): last todo text correction

* chore(NA): removed commented lines

* fix(NA): include missing package version

* chore(NA): include license keys

* chore(NA): change mock types package into private

* chore(NA): disable validator on ts_project rule

* chore(NA): use the wrapper for ts_project

* commit using @elastic.co

* chore(NA): commit using @elastic.co

* chore(NA): split types from code on @kbn/i18n

* chore(NA): update yarn.lock file

* chore(NA): split @kbn/i18n and @kbn/i18n-react

* chore(NA): missing import fix

* chore(NA): fix jest project configs

* chore(NA): change imports on kbn i18n

* chore(NA): change imports on kbn i18n

* chore(NA): correct loader imports

* chore(NA): missnig i18nLoader export key

* chore(NA): fix type exports

* chore(NA): export type only

* chore(NA): export type only

* fix(NA): type exports

* chore(NA): missing @Kbn/i18n/react imports

* chore(NA): missing skip path for kbn-i18n-react

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-24 17:18:03 +00:00
Spencer
4385ac4d83
[eslint] enable type-specific lint rules (#114184)
* [eslint] enable type-specific lint rules

* autofix violations

* duplicate eslint-disable to new export statement

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-03 16:56:17 -06:00
Tiago Costa
edc8f9583b
chore(NA): bump version to 8.1.0 (#116429)
* chore(NA): bump version to 8.1.0

* chore(NA): update non supported plugins

* chore(NA): update non supported plugins

* chore(NA): skip failing tests

* chore(NA): update jest snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-27 21:24:48 +01:00
Mikhail Shustov
3c8fa527a7
[ES] Upgrade client to v8.0 (#113950)
* bump to a pre-8.0 version

* export KibanaClient from /lib sub-folder

* workaround the problem of the absence of estypes

* update es client usage in pacakges

* export estypes from another path

* import errors from root

* import errors from root 2

* update transport import

* update import path for /api/types

* update import path for /api/types

* import errors from top export

* use TransportResult instead if ApiResponse

* fix errors in client_config

* fix src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts

* use KibanaClient in mock. we dont export the original Client

* fix client mocks

* fix errors on SO

* fix remaining core errors

* update estype import path

* fix errors in data plugin

* fix data_views

* fix es_ui_shared

* fix errors in interactive_setup

* fix errors in ./test folder

* add @elastic/transport to the runtime deps

* fix errors in packages

* fix erros in src/core

* fix errors in test/

* fix an error in actions plugin

* woraround and fix errors in APM plugin

* fix errors in canvas

* fix errors in event_log

* fix errors in fleet

* fix errors in ILM

* fix errors in infra

* fix errors in ingest_pipeline

* fix errors in lens

* fix errors in license_management

* fix errors in licensing

* fix errors in logstash

* fix errors in ml

* fix errors in monitoring

* fix errors in observability

* fix errors in rule_registry

* fix errors in reporting

* fix errors in rule_registry

* fix errors in security

* fix errors in security_solution

* fix errors in snapshot_restore

* fix errors in transform

* fix errors in UA

* fix errors in uptime

* fix errors in x-pack/test

* fix eslint errors

* fix new errors

* use default HTTP Connection. Undici does not support agent config options keepAlive and maxSockets

* create does not accept require_alias option

* update deps

* use transport types exported from ES client package

* fix ErrorCause | string errors

* do not use enum

* fix errors in data plugin

* update x-pack code

* fix transport

* fix apm search request

* do not crash on reporting

* fix kbn-test build

* mute reporting error to start

* fix ftr build

* another attempt

* update import path

* address or mute new errors

* REMOVE me. pin transport version temporarily.

* remove deep imports from transport package

* fix jest crash

* fix product check tests

* remove unnecessary ts-expect-error

* fix a few failed unit tests

* bump to canary 24

* remove unnecessary ts-expect-error

* remove dependency on transport

* fix types in tests

* mute errors in xpack tests

* product check doesn;t  spam in logs anymore

* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* fix es-arcives

* fix data plugin crashes

* fix watcher test utils

* rollback unnecessary changes

* fix another problem in es-archiver

* fix scroll. for whatever reason scroll fails when request scroll_id in body

* add meta: true in kbn-securitysolution-es-utils

* bump client to canary 25

* fix errors in accordance with the es client spec

* update securityscolution-es-utils

* unify scroll api in reporting and fix tests

* fix unit tests in watcher

* refactor APM to abort request with AbortController API

* fix missing es client calls in tests

* fix missing meta in detection engine FTR tests

* fix another bunch of errors in js tests

* fix wrong coercion

* remove test-grep pattern

* fix apm unit test

* rename terminateAfter to terminate_after in infra plugin

* rename terminateAfter to terminate_after in uptime plugin

* rename terminateAfter to terminate_after in apm plugin

* fix security roles FTR tests

* fix reference

* fix post_privilidges test

* fix post_privilidges

* bump client to 26

* add meta for index_management test helpers

* remove ts-expect-error caused by bad type in reason

* bump client to 27

* REMOVE me. workaround until fixed in the es client

* fix incorrect type casting

* swtich from camelCase params

* use `HttpConnection` for FTR-related clients

* bump client to 29

* Revert "REMOVE me. workaround until fixed in the es client"

This reverts commit c038850c09.

* fix new util

* revert repository changes

* do not crash if cannot store event_loop data

* fix new estypes imports

* fix more types

* fix security test types and add ts-ignore for custom ES client

* fix more estypes imports

* yet more ts violations

* line by line fixing is hard

* adapt `evaluateAlert` from infra as it's also used from FTR tests

* use convertToKibanaClient in FTR test instead of meta:true in plugin code

* migrate from deprecated API in fleet

* fix intergration tests

* fix fleet tests

* fix another fleet test

* fix more tests

* let's call it a day

* Removes custom header check on 404 responses, includes es client ProductNotSupportedError in EsUnavailableError conditional (#116029)

* Removes custom header check on 404 responses, includes es client ProductNotSupportedError in EsUnavailableError conditional

* Updates proxy response integration test

* disable APM until compatible with client v8

* skip async_search FTR test

* use kbnClient in integration tests

* bump version to 29

* bump to 30

* have configureClient return a KibanaClient instead of Client, remove resolved violations.

* bump to 31

* bump to 31

* Revert "bump to 31"

This reverts commit 5ac713e640.

* trigger stop to unusubscribe

* update generated docs

* remove obsolete test

* put "as" back

* cleanup

* skip test

* remove new type errors in apm package

* remove ErrorCause casting

* update a comment

* bump version to 32

* remove unnecessary ts-expect-error in apm code

* update comments

* update to client v33

* remove outdated type definition

* bump to 34 without params mutation

* unskip the test that should not fail anymore

* remove unnecessary ts-expect-error comments

* update to v35. body can be string

* move `sort` to body and use body friendly syntax

* fix a failing test. maps register the same SO that has been already registered by home

Co-authored-by: pgayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2021-10-26 14:08:22 +02:00
Matthew Kime
d2dea6816c
[data view mgmt] change urls from indexPatterns to dataViews (#114912)
* index pattern management to data view url changes
2021-10-21 05:42:13 -05:00
Matthew Kime
64f1dddcb0
[feature branch] index pattern => data view for user facing content (#109821)
* [index pattern management] index pattern => data view for user facing content (#109577)
2021-10-20 18:53:39 -05:00
Tyler Smalley
4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00
Matthew Kime
bc5e6edfea
convert deep imports to top level imports (#112281) 2021-09-15 11:40:42 -05:00
Dzmitry Lemechko
b324ca3115
[jest] update config files to get coverage per plugin (#111299)
* [jest] update config files to get coverage per plugin

* [docs] add details about plugin coverage collection

* fix path for newsfeed jest config

* fix lint error

* update documentation

* fix lint errors again

* update doc

* fix another lint error

* Update src/plugins/telemetry_management_section/jest.config.js

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>

* Update src/plugins/telemetry_management_section/jest.config.js

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>

* [kibana_legacy] fix path

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-09 08:14:56 +02:00
Spencer
fecdba7eba
[eslint] add rule to prevent export* in plugin index files (#109357)
* [eslint] add rule to prevent export* in plugin index files

* deduplicate export names for types/instances with the same name

* attempt to auto-fix duplicate exports too

* capture exported enums too

* enforce no_export_all for core too

* disable rule by default, allow opting-in for help fixing

* update tests

* reduce yarn.lock duplication

* add rule but no fixes

* disable all existing violations

* update api docs with new line numbers

* revert unnecessary changes to yarn.lock which only had drawbacks

* remove unnecessary eslint-disable

* rework codegen to split type exports and use babel to generate valid code

* check for "export types" deeply

* improve test by using fixtures

* add comments to some helper functions

* disable fix for namespace exports including types

* label all eslint-disable comments with related team-specific issue

* ensure that child exports of `export type` are always tracked as types

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-01 18:05:45 -07:00
Spencer
72f6700270
[eslint] prevent async Promise constructor mistakes (#110349)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-31 17:54:13 -04:00
James Gowdy
fb1c3ca5a6
[ML] Fixing missing final new line character issue (#109274)
* [ML] Fixing missing final new line character issue

* adding tests

* tiny refactor

* test fixes based on review

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-25 14:00:32 +01:00
Spencer
c0395c9ef6
[build_ts_refs] improve caches, allow building a subset of projects (#107981)
* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-08-10 22:12:45 -07:00
Nathan Reese
37a97b435e
[file_upload] include caused_by field for import failures (#107907)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-08-10 09:53:50 -06:00
Tim Roes
ff3029f1b7
Make onChange in CodeEditor optional (#107128)
* Make onChang in CodeEditor optional

* Update api docs
2021-07-29 15:37:43 +02:00
James Gowdy
aa85de3fbf
Removing async from file upload and data visualizer plugins start lifecycle (#105197) 2021-07-13 09:08:40 +01:00
James Gowdy
21dad7edb5
[ML] Update file data visualizer permissions (#101169)
* [ML] Update file data visualizer permissions

* adding home bundle

* fixing translations

* removing home from bundles

* switching to current user for analysis

* adding find structure permission check

* clean up

* updating text

* updating maps

* removing has_find_file_structure_permission endpoint

* removing more code

* adding permission error message

* renaming variable

* adding fileUpload:analyzeFile back into ML

* updating error text

* updating snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-29 21:07:07 +01:00
Pete Harverson
9ead1fc96b
[ML] Add description and owner to kibana.json for ML owned plugins (#103254) 2021-06-24 17:49:56 +01:00