Commit graph

283 commits

Author SHA1 Message Date
Lion Ralfs
e8f88cbcd6
[Cases] enforce type imports for entire cases folder (#143399)
ESLint's --fix did the heavy lifting here
2022-10-17 12:07:46 +03:00
Lion Ralfs
e46da93553
[Cases] Enforce type imports (#142428)
* [Cases] enforce type imports

ESLint's --fix did the heavy lifting here

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

* fix remaining rule violation

* fix remaining rule violation

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-14 20:37:29 +03:00
Sander Philipse
25c883eaee
[Enterprise Search]Allow snake_case variables in server (#142881) 2022-10-07 08:44:18 -07:00
Ying Mao
d41e5ab127
[Response Ops] [Connectors] Move connectors type UI components to stack_connectors plugin (#140444)
* Initial commit of stack connectors plugin

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

* Fixing up xmatters. Moving library functions around

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

* Fixing up webhook

* Fixing up teams and slack

* Fixing up index, email, pagerduty, server log

* Fixing i18n

* wip

* Moving well know email route to stack connectors plugin

* Fixing types

* Fixing unit tests

* Adding index.ts

* Cleanup

* Updating READMEs

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

* Moving to domain specific folders and updating codeowners

* Fixing codeowners

* Fixing types

* Initial commit moving client code to stack connectors plugin

* Updated all imports

* Updating email

* Updating index

* Updating stack connectors

* Updating cases connectors

* Cleanup

* Splitting test_utils

* Fixing all imports

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

* Fixing types and limits

* Fixing unit tests

* Fixing CI

* Updating codeowners

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-27 10:44:04 -04:00
Spencer
50b3b57d9e
[ftr] add first-class support for playwrite journeys (#140680)
* [ftr] add first-class support for playwrite journeys

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

* fix jest test

* remove ability to customize kibana server args, if we need it we can add it back

* remove dev dir that doesn't exist

* fix typo

* prevent duplicated array converstion logic by sharing flag reader

* remove destructuring of option

* fix scalability config and config_path import

* fix start_servers args and tests

* include simple readme

* fix jest tests and support build re-use when changes are just to jest tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-22 01:06:46 -07:00
Ying Mao
914d1cd41c
[Response Ops] [Connectors] Move connectors to own plugin (#139867)
* Initial commit of stack connectors plugin

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

* Fixing up xmatters. Moving library functions around

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

* Fixing up webhook

* Fixing up teams and slack

* Fixing up index, email, pagerduty, server log

* Fixing i18n

* wip

* Moving well know email route to stack connectors plugin

* Fixing types

* Fixing unit tests

* Adding index.ts

* Cleanup

* Updating READMEs

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

* Moving to domain specific folders and updating codeowners

* Fixing codeowners

* Fixing types

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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-15 15:50:15 -04:00
Dario Gieselaar
b66cf585ca
[Profiling] Add Profiling application (#140722)
Co-authored-by: Joseph Crail <jbcrail@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Joseph Crail <joseph.crail@elastic.co>
Co-authored-by: Stephanie Boomsma <stephanieboomsma@optimyze.cloud>
Co-authored-by: inge4pres <fgualazzi@gmail.com>
Co-authored-by: inge4pres <francesco.gualazzi@elastic.co>
Co-authored-by: Francesco Gualazzi <inge4pres@users.noreply.github.com>
Co-authored-by: Tim Rühsen <tim.ruhsen@elastic.co>
Co-authored-by: Tim Rühsen <tim.ruehsen@gmx.de>
2022-09-15 19:24:41 +02:00
Tyler Smalley
44ab700f3d
Removes Percy based visual regression tests (#139252)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jonathan Budzenski <jon@elastic.co>
2022-09-12 13:08:52 -07:00
Spencer
32491462a9
add kibana.jsonc files to existing packages (#138965)
* [packages] add kibana.jsonc files

* auto-migrate to kibana.jsonc

* support interactive pkg id selection too

* remove old codeowners entry

* skip codeowners generation when .github/CODEOWNERS doesn't exist

* fall back to format validation if user is offline

* update question style

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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-08 13:31:57 -07:00
James Gowdy
76fcb3fab9
[ML] Removing global ml exhaustive-deps rule (#139907)
* [ML] Removing global ml exhaustive-deps rule

* changes after main merge
2022-09-06 09:41:52 +01:00
Spencer
9003353729
rename @elastic/* packages to @kbn/* (#138957)
* rename @elastic/* packages to @kbn/*

* update yarn.lock

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

* update lint task

* review feedback

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-18 08:54:42 -07:00
John Dorlus
47bc3592c4
Adding fleet cypress a11y tests (#138192)
* Updated test to use uiSettings.

* Added initial files for adding Fleet A11y tests.

* Added setup for a11y test.

* Still working with combobox

* Got combobox to work.

* Added tests for Agents tag.

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

* More tests.

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

* Fixed typo.

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

* Added more tests and stuff.

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

* Added more tests and stuff.

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

* Finished the fleet screens.

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

* Added exception for cypres-real-events devDependency.

* Skipped test with a11y violation.

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

* Ignoring dev dependencies.

* Look for input before trying to type into it.

* Updated cypress readme about a11y checks.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-12 22:36:27 -04:00
Joe Reuter
fcf3b8bb21
[Discover] Split saved searches out of discover plugin (#138388) 2022-08-12 11:19:40 +02:00
Spencer
bebec37f04
[eslint] fix and skip violations for cross-boundary imports (#136911) 2022-07-29 13:57:55 -05:00
Cauê Marcondes
bca30a8e6e
[APM] Breadcrumbs not updating from service jump on service map (#136144)
* invalidating useEffect to update breadcrumbs

* removing useEffect

* removing callback function

* adding callback

* adding usEffect

* fixing

* adding fnDeps param

* addressing pr comments

* addressing pr comments
2022-07-19 15:57:38 -04:00
Jonathan Budzenski
33b743c84e
Revert "Remove percy based visual regression tests (#136359)" (#136437)
* Revert "Remove percy based visual regression tests (#136359)"

This reverts commit a91aeb42ff.

* update codeowners
2022-07-14 14:53:12 -05:00
Jonathan Budzenski
a91aeb42ff
Remove percy based visual regression tests (#136359)
* Remove percy based visual regression tests

These have been disabled for ~3 years, the agent is deprecated, and our
snapshot environment is inactive.

* [CI] Auto-commit changed files from 'yarn kbn run build -i @kbn/pm'

* update codeowners

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-07-14 10:03:49 -07:00
Ashokaditya
6efef04960
[Security Solution][Osquery] Enforce type imports (#135744) 2022-07-09 01:00:04 -07:00
Spencer
a3b2757e4e
[type-summarizer] reimplement for broader support (#135163)
* [type-summarizer] reimplement for broader support

* Enable sourceMaps in all packages

* include naming collision in summarizePackage test

* fix readmes

* remove unnecessary transient dependency

* remove code that was commented out

* remove outdated todo comment

* ensure errors triggered by untyped-exports are ligible

* remove unused import

* break out snippet generation from AstIndexer

* refactor several massive files into smaller pieces and add more inline docs

* fix typos

* update jest snapshots

* add sections to readme that points people to the useful parts of the source code along with a high-level overview of how the type-summarizer works

* remove --dump flag, it doesn't work

* use decName instead of calling names.get a second time

* include `export` as invalid name
2022-07-06 13:48:45 -05:00
Jonathan Budzenski
5d85008aa9
Bump prettier to 2.7.1 (#135143)
* Bump prettier to 2.7.1

* bump eslint-config-prettier

* update .eslintrc
2022-07-05 14:39:20 -05:00
Dmitry Tomashevich
789e2e9ceb
[Graph] Remove Venn diagram dependency (#135007)
* [Graph] remove venn diagram dependency

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

* [Discover] add license changes

* Update x-pack/plugins/graph/public/components/venn_diagram/vennjs/LICENSE

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* [Graph] apply suggestions

* [Graph] update yarn lock

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2022-07-05 15:04:28 +03:00
Brian Seeders
0b0b68786a
[CI] Move kibana-buildkite-library into kibana (#134787) 2022-06-28 13:19:05 -04:00
Byron Hulcher
00712763d1
[Enterprise Search] Add eslint warning for unsorted keys (#135070)
* Add eslint warning for unsorted keys

* Move rules to main .eslintrc.js file
2022-06-24 20:56:13 -04:00
Shahzad
d32d9f571c
[Synthetics] Prevent imports from legacy_uptime (#134185)
* commit

* update usage

* update type
2022-06-13 16:09:33 +02:00
Baturalp Gurdin
e2515aa926
performance tests journey based configs (#132119)
* restructure performance tests for per journey config

* add cleanup hook to performance service for browser instance cleanup

* only enable APM in performance configs when TEST_PERFORMANCE_PHASE is set

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Spencer <spencer@elastic.co>
2022-06-06 15:31:40 +02:00
Thomas Watson
dc9f2732a1
Add csp.disableUnsafeEval config option to remove the unsafe-eval CSP (#124484)
Adds a new experimental Kibana setting called `csp.disableUnsafeEval` which will default to `false`. When set to `true`, it will remove `unsafe-eval` from our CSP.

Also introduces a new module called `@kbn/handlebars` which is a replacement for the official `handlebars` module used in the frontend. This new module is necessary in order to avoid calling `eval`/`new Function` from within `handlebars` which is not allowed once `unsafe-eval` is removed from our CSP.

The `@kbn/handlebars` module is simply an extension of the main `handlebars` module which adds a new compile function called `compileAST` (as an alternative to the regular `compile` function). This new function will not use code-generation from strings to compile the template but will instead generate an AST and return a render function with the same API as the function returned by the regular `compile` function.

This is a little bit slower method, but since this is only meant to be used client-side, the slowdown should not be an issue.

The following limitations exists when using `@kbn/handlebars`:

The Inline partials handlebars template feature is not supported.

Only the following compile options will be supported:
- `knownHelpers`
- `knownHelpersOnly`
- `strict`
- `assumeObjects`
- `noEscape`
- `data`

Only the following runtime options will be supported:
- `helpers`
- `blockParams`
- `data`

Closes #36311
2022-05-23 11:01:56 -07:00
Dmitrii Shevchenko
1135ee71b4
[Security Solution] Implement generic approach to execution context propagation (#131805) 2022-05-23 14:24:13 +02:00
Tiago Costa
dea9159c5d
chore(NA): rename @elastic/eslint-config-kibana as @kbn/eslint-config (#132278) 2022-05-16 13:02:02 -07:00
Dario Gieselaar
7af6915581
[APM] Progressive fetching (experimental) (#127598)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-21 12:11:46 +02:00
Patryk Kopyciński
e8f59a5888
[Osquery] Update eslint config (#129637) 2022-04-19 02:09:32 -07:00
Frank Hassanabad
ce2f6171c1
[Security Solutions] Removes POC transforms (#129673)
## Summary

Removes the `metrics_entities` plugin and POC. As a different direction will be taken and people can look back at the git history for it as they see fit if they need to refer to it. Once it's re-added it it will be through an RFC process and re-discussed.

Earlier PR's which added the POC:

https://github.com/elastic/kibana/pull/96446
https://github.com/elastic/kibana/pull/104559

### Checklist

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2022-04-11 13:41:09 -06:00
Tiago Costa
eb0ef19583
chore(NA): upgrades bazel rules nodejs to v5 (#129522)
* chore(NA): upgrade bazel into v5

* chore(NA): initial work to upgrade to rules v5

* chore(NA): remove @elastic/datemath jest unit test for eslint plugin imports

* chore(NA): removed packager tsc_wrapped added my mistake
2022-04-08 20:42:37 +01:00
Spencer
2ad2a4c271
[eslint] ensure that all imports are resolvable (#129002) 2022-04-04 15:37:06 -04:00
Thomas Watson
98306f162d
Remove invalid syntax from .eslintrc.js (#129164)
The exclamation mark prefix doesn't have any effect in the `files` list.
You instead need to override the matched path later with a different
rule in order to change the behavior.
2022-04-04 00:11:56 -07:00
Sander Philipse
bfc7de92dc
[Enterprise Search] Enable unused var linting (#127305) 2022-03-09 14:12:22 -07:00
Spencer
1f514d7c00
[eslint] automatically determine dev packages (#127089)
* [eslint] automatically determine dev packages

* remove old eslint overrides that are not needed anymore
2022-03-08 07:42:06 -06:00
Spencer
eb68e95acd
[ts] enable sourcemaps in summarized types of @kbn/crypto (#126410)
* [ts] enable sourcemaps in summarized types of @kbn/crypto

* update snapshots

* remove unnecessary exports of @kbn/type-summarizer package

* remove tsc from the build process

* use `@kbn/type-summarizer` to summarize its own types

* add tests for interface and function

* switch to export type where necessary

* ignore __tmp__ in global jest preset

* ignore __tmp__ globally

* remove `@kbn/crypto` types path
2022-03-04 08:02:02 -06:00
Dario Gieselaar
0202164153
[APM] Lint rule for explicit return types (#124771) 2022-02-15 02:38:07 -07:00
Shahzad
e445280fe6
[User Experience App] Move UX public code out of apm (#88645) 2022-02-04 11:47:52 +01:00
Esteban Beltran
3e7611b647
[Cases] Add eslintrule to enforce display names and ignore existing problems (#123692) 2022-01-26 17:03:20 -07:00
Tiago Costa
735948de4d
chore(NA): splits types from code on @kbn/io-ts-utils (#123431)
* chore(NA): splits types from code on @kbn/io-ts-utils

* chore(NA): missing import keys

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-21 00:17:38 +00:00
Tiago Costa
356861d23b
chore(NA): splits types from code on @kbn/ui-shared-deps-src (#123313)
* chore(NA): splits types from code on @kbn/ui-shared-deps-src

* chore(NA): break flot-charts into another package

* chore(NA): skip failing tests

* chore(NA): remove skip and add correct value

* chore(NA): fix new ui-theme import

* chore(NA): adding fleet cloned test

* chore(NA): remove cloned test

* chore(NA): remove added typo
2022-01-20 22:04:19 +00:00
Tiago Costa
aa6fe695af
chore(NA): splits types from code on @kbn/rule-data-utils (#121535)
* chore(NA): splits types from code on @kbn/rule-data-utils

* chore(NA): remove old style imports for this pkg

* chore(NA): eslint fix

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-20 20:41:46 +00:00
Spencer
0f68fcf5af
[kbn/rule-data-utils] add submodules and require public use them (#117963)
* [kbn/rule-data-utils] add submodules and require public use them

* fix lint errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-15 15:23:52 -07:00
Tyler Smalley
139a3c9866
[ci] Run Jest tests in parallel (#117188)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-11-09 11:25:25 -08:00
Spencer
4e443cca4f
[kbn/io-ts] export and require importing individual functions (#117958) 2021-11-09 11:42:39 -07:00
Christos Nasikas
d38fb03820
[Cases] Align cases lint rules with security solution (#117177)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-04 17:51:02 +02:00
Anton Dosov
c6be6c019c
[kibanaUtils] Don't import full semver client side (#114986) 2021-10-18 13:20:44 +02:00
Patryk Kopyciński
411816c1c7
[Osquery] Add packs (#107345) 2021-10-18 09:55:07 +02:00
Frank Hassanabad
ed9859ac14
[Security solutions] Adds linter rule to forbid usage of no-non-null-assertion (TypeScript ! bang operator) (#114375)
## Summary

Fixes: https://github.com/elastic/kibana/issues/114535

**What this linter rule does:**
* Sets the [@typescript-eslint/no-non-null-assertion](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md) linter rule to become an error if seen.

If you try to use the `!` operator you get an error and nice helper message that tries to encourage better practices such as this one:

<img width="1635" alt="Screen Shot 2021-10-07 at 11 26 14 AM" src="https://user-images.githubusercontent.com/1151048/136474207-f38d3461-0af9-4cdc-885b-632cb49d8a24.png">

**Why are we deciding to set this linter rule?**
* Recommended from Kibana [styleguide](https://github.com/elastic/kibana/blob/master/STYLEGUIDE.mdx#avoid-non-null-assertions) for ~2 years now and still recommended.
* A lot of TypeScript has evolved and has operators such as `?` which can replace the `!` in most cases. Other cases can use a throw explicitly or other ways to manage this.
* Some types can change instead of using this operator and we should just change the types.
* TypeScript flows have improved and when we upgrade the linter will cause errors where we can remove the `!` operator which is 👍 better than leaving them when they're not needed anymore.
* Newer programmers and team members sometimes mistake it for the `?` when it is not the same thing.
* We have had past bugs and bugs recently because of these.
* It's easier to use the linter to find bugs than to rely on manual tests. 

**How did Frank fix all the 403 areas in which the linter goes off?**
* Anywhere I could remove the `!` operator without side effects or type script errors I just removed the `!` operator.
* Anywhere in test code where I could replace the code with a `?` or a `throw` I went through that route.
* Within the code areas (non test code) where I saw what looks like a simple bug that I could fix using a `?? []` or `?` operator or `String(value)` or fixing a simple type I would choose that route first. These areas I marked in the code review with the words `NOTE:` for anyone to look at.
* Within all other areas of the code and tests where anything looked more involved I just disabled the linter for that particular line. When in doubt I chose this route.

### Checklist

- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2021-10-14 20:24:01 -06:00