Commit graph

420 commits

Author SHA1 Message Date
Kibana Machine
b1e400d36c
[8.7] [ftr] fix scripts/functional_tests to respect cli flags (#155734) (#155907)
# Backport

This will backport the following commits from `main` to `8.7`:
- [[ftr] fix scripts/functional_tests to respect cli flags
(#155734)](https://github.com/elastic/kibana/pull/155734)

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

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-04-26T16:33:54Z","message":"[ftr]
fix scripts/functional_tests to respect cli flags (#155734)\n\n##
Summary\r\n\r\nThis\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29091#01879988-ecd2-4e4f-bfb4-108939f145a1)\r\nclearly
shows that `--bail` flag is ignored when passed
to\r\n`scripts/functional_tests.js` script, and
since\r\n`scripts/functional_tests.js --help` list these flags I think
we need to\r\nfix it:\r\n\r\n```\r\n --include-tag Tags that suites must
include to be run, can be included multiple times\r\n --exclude-tag Tags
that suites must NOT include to be run, can be included multiple
times\r\n --include Files that must included to be run, can be included
multiple times\r\n --exclude Files that must NOT be included to be run,
can be included multiple times\r\n --grep Pattern to select which tests
to run\r\n --bail Stop the test run at the first failure\r\n --dry-run
Report tests without executing them\r\n --updateBaselines Replace
baseline screenshots with whatever is generated from the test\r\n
--updateSnapshots Replace inline and file snapshots with whatever is
generated from the test\r\n```\r\n\r\nI was able to reproduce it
locally:\r\n1.
Break\r\n[test/functional/apps/console/_console.ts](test/functional/apps/console/_console.ts)\r\nby
adding `expect(1).to.be(2);` in the first `it` function\r\n2. Run `node
scripts/functional_tests.js --bail
--config\r\ntest/functional/apps/console/config.ts`\r\nActual: Tests
continue to run after failure\r\nExpected: Stop tests after first
failure\r\n\r\nIt turned out `scripts/functional_test_runner.js`
respects the flags so\r\nI just copied the logic
from\r\n[packages/kbn-test/src/functional_test_runner/cli.ts](https://github.com/elastic/kibana/blob/main/packages/kbn-test/src/functional_test_runner/cli.ts#L41-L63)\r\n\r\nLet
me know if you think we need to add jest
tests.\r\n\r\n\r\nTested:\r\n\r\n```\r\nnode scripts/functional_tests.js
--bail --config test/functional/apps/console/config.ts --grep \"multiple
requests
output\"\r\n```","sha":"4211e03a5f7651afeea492e44116eb614b54f00c","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v7.17.10","v8.8.0","v8.7.2"],"number":155734,"url":"https://github.com/elastic/kibana/pull/155734","mergeCommit":{"message":"[ftr]
fix scripts/functional_tests to respect cli flags (#155734)\n\n##
Summary\r\n\r\nThis\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29091#01879988-ecd2-4e4f-bfb4-108939f145a1)\r\nclearly
shows that `--bail` flag is ignored when passed
to\r\n`scripts/functional_tests.js` script, and
since\r\n`scripts/functional_tests.js --help` list these flags I think
we need to\r\nfix it:\r\n\r\n```\r\n --include-tag Tags that suites must
include to be run, can be included multiple times\r\n --exclude-tag Tags
that suites must NOT include to be run, can be included multiple
times\r\n --include Files that must included to be run, can be included
multiple times\r\n --exclude Files that must NOT be included to be run,
can be included multiple times\r\n --grep Pattern to select which tests
to run\r\n --bail Stop the test run at the first failure\r\n --dry-run
Report tests without executing them\r\n --updateBaselines Replace
baseline screenshots with whatever is generated from the test\r\n
--updateSnapshots Replace inline and file snapshots with whatever is
generated from the test\r\n```\r\n\r\nI was able to reproduce it
locally:\r\n1.
Break\r\n[test/functional/apps/console/_console.ts](test/functional/apps/console/_console.ts)\r\nby
adding `expect(1).to.be(2);` in the first `it` function\r\n2. Run `node
scripts/functional_tests.js --bail
--config\r\ntest/functional/apps/console/config.ts`\r\nActual: Tests
continue to run after failure\r\nExpected: Stop tests after first
failure\r\n\r\nIt turned out `scripts/functional_test_runner.js`
respects the flags so\r\nI just copied the logic
from\r\n[packages/kbn-test/src/functional_test_runner/cli.ts](https://github.com/elastic/kibana/blob/main/packages/kbn-test/src/functional_test_runner/cli.ts#L41-L63)\r\n\r\nLet
me know if you think we need to add jest
tests.\r\n\r\n\r\nTested:\r\n\r\n```\r\nnode scripts/functional_tests.js
--bail --config test/functional/apps/console/config.ts --grep \"multiple
requests
output\"\r\n```","sha":"4211e03a5f7651afeea492e44116eb614b54f00c"}},"sourceBranch":"main","suggestedTargetBranches":["7.17","8.7"],"targetPullRequestStates":[{"branch":"7.17","label":"v7.17.10","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/155734","number":155734,"mergeCommit":{"message":"[ftr]
fix scripts/functional_tests to respect cli flags (#155734)\n\n##
Summary\r\n\r\nThis\r\n[failure](https://buildkite.com/elastic/kibana-on-merge/builds/29091#01879988-ecd2-4e4f-bfb4-108939f145a1)\r\nclearly
shows that `--bail` flag is ignored when passed
to\r\n`scripts/functional_tests.js` script, and
since\r\n`scripts/functional_tests.js --help` list these flags I think
we need to\r\nfix it:\r\n\r\n```\r\n --include-tag Tags that suites must
include to be run, can be included multiple times\r\n --exclude-tag Tags
that suites must NOT include to be run, can be included multiple
times\r\n --include Files that must included to be run, can be included
multiple times\r\n --exclude Files that must NOT be included to be run,
can be included multiple times\r\n --grep Pattern to select which tests
to run\r\n --bail Stop the test run at the first failure\r\n --dry-run
Report tests without executing them\r\n --updateBaselines Replace
baseline screenshots with whatever is generated from the test\r\n
--updateSnapshots Replace inline and file snapshots with whatever is
generated from the test\r\n```\r\n\r\nI was able to reproduce it
locally:\r\n1.
Break\r\n[test/functional/apps/console/_console.ts](test/functional/apps/console/_console.ts)\r\nby
adding `expect(1).to.be(2);` in the first `it` function\r\n2. Run `node
scripts/functional_tests.js --bail
--config\r\ntest/functional/apps/console/config.ts`\r\nActual: Tests
continue to run after failure\r\nExpected: Stop tests after first
failure\r\n\r\nIt turned out `scripts/functional_test_runner.js`
respects the flags so\r\nI just copied the logic
from\r\n[packages/kbn-test/src/functional_test_runner/cli.ts](https://github.com/elastic/kibana/blob/main/packages/kbn-test/src/functional_test_runner/cli.ts#L41-L63)\r\n\r\nLet
me know if you think we need to add jest
tests.\r\n\r\n\r\nTested:\r\n\r\n```\r\nnode scripts/functional_tests.js
--bail --config test/functional/apps/console/config.ts --grep \"multiple
requests
output\"\r\n```","sha":"4211e03a5f7651afeea492e44116eb614b54f00c"}},{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2023-04-26 10:49:13 -07:00
Pierre Gayvallet
e70fceaf9d
[FTR] KbnClientSavedObjects improvements (#149582)
## Summary

Follow-up of https://github.com/elastic/kibana/pull/149188


- Use the bulkDelete API for `KbnClientSavedObjects.bulkDelete`
- Create a dedicated `/_clean` endpoint for
`KbnClientSavedObjects.clean` and
`KbnClientSavedObjects.cleanStandardList`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-30 09:05:53 -07:00
Pierre Gayvallet
cd9a53f284
Create the ftrSoApis FTR plugin (#149188)
## Summary

Fix https://github.com/elastic/kibana/issues/148412

More and more SO types will not be accessible from the HTTP APIs (either
`hidden:true` or `hiddenFromHTTPApis: true`).

However, the FTR SO client (`KbnClientSavedObjects`) still needs to be
able to access and manipulate all SO types.

This PR introduces a `ftrSoApis` plugin that is loaded for all FTR
suites. This plugin exposes SO APIs that are used by the FTR client
instead of the public SO HTTP APIs. These APIs are configured to know
about all types, even hidden ones.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-26 01:47:29 -07:00
Tiago Costa
e38350f7f9
chore(NA): upgrades uuid to v9.0.0 (#149135)
This PR upgrades uuid into its latest version `9.0.0`.
The previous default used version `v4` was kept where it was previously
used and places using `v1` or `v5` are still using it.

In this latest version they removed the deep import feature and as we
are not using tree shaking it increased our bundles by a significant
size. As such, I've moved this dependency into the `ui-shared-deps-npm`
bundle.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 19:48:07 +00:00
Spencer
d6be4a4b06
Implement package linter (#148496)
This PR implements a linter like the TS Project linter, except for
packages in the repo. It does this by extracting the reusable bits from
the TS Project linter and reusing them for the project linter. The only
rule that exists for packages right now is that the "name" in the
package.json file matches the "id" in Kibana.jsonc. The goal is to use a
rule to migrate kibana.json files on the future.

Additionally, a new rule for validating the indentation of tsconfig.json
files was added.

Validating and fixing violations is what has triggered review by so many
teams, but we plan to treat those review requests as notifications of
the changes and not as blockers for merging.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-09 16:49:29 -07: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
Karl Godard
0b19cfafa3
Custom fleet policy UX for new integration (cloud defend v1) (#147300)
## Summary

New Kibana plugin created for an integration called "Cloud defend for
containers" which will have a corresponding agent service which can
proactively block and alert on executable creation or modification in a
running container.

This plugin is purely in place to configure the fleet policy UX around
this new integration. For now we have added a yaml editor as a custom
input to our integration. The monaco-yaml libary was added to allow
support for JSON schema validation support for yaml.

Integration PR is up, and a work in progress: (waiting on some content
for the doc page)
https://github.com/elastic/integrations/pull/4680

### Screenshot


![image](https://user-images.githubusercontent.com/16198204/207160791-73e11e05-953b-42ba-b4dd-a4904bd95451.png)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

Co-authored-by: Karl Godard <karlgodard@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-19 17:37:39 -07:00
Spencer
2763af3a4e
[ftr] remove @types/mocha, define custom ambient-ftr-types (#147284)
After moving away from composite projects in the IDE we now have an
issue where projects like security solutions are getting `@types/jest`
and `@types/mocha` loaded up, even though the "types" compiler option in
security solutions focuses on jest. To fix this I've removed the
`@types/mocha` package, implemented/copied a portion of the mocha types
into a new `@kbn/ambient-ftr-types` package which can be used in ftr
packages to define the describe/it/etc. globals.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-19 10:42:12 -07:00
Spencer
c107f8a73a
[jest/ci] disable console methods (#146910)
Removes all the noise from poorly written React tests and includes a
warning to explain the situation to folks

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-12-02 15:28:55 -07:00
Spencer
c38315f91c
[jest] parse CLI flags correctly (#146844)
Fixes https://github.com/elastic/kibana/issues/144051

Rather than just parsing process.argv with the default config of
getopts, which treats flags like `-u` into a "value collecting" flag,
this updates the way we call getopts so that all known jest CLI flags
are properly handled. This is accomplished by parsing the output of
`yarn jest --help` and then using that information to power `node
scripts/jest`.

To update the known CLI flags we just need to run `yarn jest --help |
node scripts/read_jest_help.mjs` (for some reason I don't understand,
Jest does not produce it's entire `--help` output when called from node,
only when called from a terminal).
2022-12-02 10:04:15 -07:00
Spencer
cfdb8553ba
[pkgs/peggy] automatically transform peggy files with babel-register and webpack (#145615)
In order to get us closer to the developer experience we want for
packages, we are trying to move package builds out of bazel and instead
we want to build files on demand. In the case of .peggy files this means
importing them directly and teaching babel/jest/webpack how to handle
these imports by automatically transpiling and caching the results.

This change does just that, adding a `@kbn/peggy` package which wraps
peggy for types, and also adds support for defining peggy config
adjacent to a peggy grammar file in a `${basename}.config.json` file.
This file will be parsed and used to configure things like
`allowedStartRules` as described in [the peggy
docs](https://peggyjs.org/documentation.html#generating-a-parser-javascript-api).

This PR also implements `@kbn/peggy-loader` which uses `@kbn/peggy` to
transpile peggy files in webpack, and a peggy transform for both Jest
and our custom babel register hook.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-22 11:25:50 -07:00
Jonathan Budzenski
2ac7ebe3bf
Upgrade to Jest 29 (#143319)
https://jestjs.io/blog/2022/04/25/jest-28
https://jestjs.io/blog/2022/08/25/jest-29

- jest.useFakeTimers('legacy') -> jest.useFakeTimers({ legacyFakeTimers:
true });
- jest.useFakeTimers('modern'); -> jest.useFakeTimers();
- tests can either use promises or callbacks, but not both
- test runner jasmine is no longer included, switch all suites to
jest-circus

Co-authored-by: Andrew Tate <andrew.tate@elastic.co>
2022-11-18 09:40:16 -06:00
Thomas Watson
b02d976a3b
Remove dependencies for empty @types/* packages (#144324)
The removed packages were empty becuase the packages for which they provide
types now ship with their own types. So they are no longer needed.

The following command was run to find them:

    find node_modules/@types \
      -mindepth 1 \
      -maxdepth 1 \
      -type d '!' \
      -exec test -e "{}/index.d.ts" ';' \
      -print

In this case that produced the following output:

    node_modules/@types/moment-timezone
    node_modules/@types/strip-ansi
    node_modules/@types/joi
    node_modules/@types/rrule
    node_modules/@types/vfile-message
    node_modules/@types/reduce-reducers
    node_modules/@types/react-resize-detector
    node_modules/@types/pretty-ms

Except for `vfile-message` all of these were direct dependencies and could be
removed.
2022-11-07 04:37:43 -07:00
Tiago Costa
e41569b4a6
fix(NA): wrongly spread stripInternal and rootDir configs across packages (#144463)
* chore(NA): remove overrides for rootDir on packages

* chore(NA): replace './target_types' with 'target_types' on packages

* chore(NA): removes stripInternal false configs

* chore(NA): remove unused strip internals
2022-11-03 01:04:55 +00: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
spalger
42879f7656
[bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05:00
Jonathan Budzenski
7a056a84d9
fix flaky test 'produces a valid junit report for failures' (#143995)
* fix flaky test 'produces a valid junit report for failures'

After the upgrading to Jest 27, it appears the runtime of this test is
occasionally reported as 0.  0 is evaluated to false and time is left
out of the junit report.  This updates the conditional to check for type
number.

Closes #143993

* unskip
2022-10-26 10:49:00 -05:00
Jonathan Budzenski
2d1cdfdc28 skip flaky test. #143993 2022-10-25 19:31:24 -05:00
Jonathan Budzenski
be432c0d89
Upgrade to Jest 27 (#139335)
* Upgrade to Jest 27

* fix test
2022-10-25 14:38:38 -05:00
Nicolas Chaulet
ad95c571b4
[Fleet] Add new APIs and preconfiguration for Fleet server hosts per policy (#142746) 2022-10-06 14:40:28 -07:00
Paul Tavares
b2ab340425
[Security Solution][Endpoint] Move all endpoint responder jest tests for response actions to (jest) integration tests (#142006)
* un-skip tests in endpoint_responder

* move endpoint responder tests to integration tests

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

* Add jest integration config file

* add standard setup for react testing `data-test-subj` testIdAttribute

* change `@kbn/test/jest_integration` preset to include all `setupFilesAfterEnv` from base preset

* Fix jest testing warning/error about missing react `key` in command_usage.tsx component

* Stabilise test when checking calls to action details api

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-29 09:40:41 -04:00
Spencer
c494c0402f
[stack_functional_integration] remove esArchiver service (#141842) 2022-09-26 12:50:28 -07:00
Spencer
a5afcd7ae9
[ftr/startServers] resolve relative config arguments at CLI (#141450) 2022-09-22 09:00:30 -07: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
Karl Godard
9a77d2408c
[Terminal Output] tty toggle now shows number of bytes in tooltip, if no output we disa… (#141174)
* tty toggle now shows number of bytes in tooltip, if no output we disable button (instead of hide)

* fixed tests

Co-authored-by: Karl Godard <karlgodard@elastic.co>
2022-09-20 19:06:09 -07:00
renovate[bot]
b0cec96d38
Update dependency cypress to v10 (main) (#133168) 2022-09-13 18:20:20 +02:00
Spencer
1530f8e1d3
[ftr] support redirecting server logs to a file (#140334) 2022-09-09 10:44:00 -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
Nicolas Chaulet
feeee2a5fe
[Fleet] API integration test make docker server waitForLogline timeout configurable (#140128) 2022-09-07 12:26:10 -04:00
Lee Drengenberg
892e6327d4
[Archive Migrations] remove es_archiver/empty_kibana from Fleet api tests (#139505)
* remove use of empty_kibana es_archive

* remove empty_kibana archives again

* replace es_archiver/empty_kibana with cleanStandardList

* remove more empty_kibana uses

* add cleanup of a package

* remove comment

* add Fleet saved object types to cleanStandardList

Co-authored-by: Spencer <spencer@elastic.co>
2022-09-01 13:57:46 -04:00
Pierre Gayvallet
383d8fab58
Move client-side application service to packages (#139502)
* deletes unused utils file

* just some fix while I see it

* creating empty packages

* moving all the things

* package build success

* start fixing usages

* fix the scoped history type issue

* export internal utils

* add default for mock

* fix test import

* fix external import

* start fixing external usages

* more usages

* more usages

* more usages

* More usages

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

* fix integration test imports

* fix more test types

* remove public/utils from the core bundle

* trying to import from the package

* updating README's

* remove unused test types from mock package

* cleanup test types

* use import type

* add author to packages

* more import type

* remove dead path from some config

* remove src/core/utils/index.ts (and pray)

* update tsdoc

* fix new file usage

* fix paths

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 10:08:44 -07:00
Tiago Costa
1cbf83f73c
chore(NA): remove src folder requirement from packages (part 2) (#138476)
* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

* chore(NA): first attempt to complete removal of src folder on a small group of pkgs

* Revert "chore(NA): first attempt to complete removal of src folder on a small group of pkgs"

This reverts commit b6f34b7530.

* chore(NA): remove src folder requirement from xpack pkgs

* chore(NA): remove src folder from analytics pkgs

* chore(NA): remove src folder from home pkgs

* chore(NA): remove src folder from shared_ux pkgs

* fix(NA): remove missing src folder inputs on sharedux pkg

* chore(NA): remove src folder from kbn-a* pkgs

* chore(NA): remove src folder from kbn-b* pkgs

* chore(NA): remove src folder from kbn-c* pkgs

* chore(NA): correct exclude pattern for each changed pkg

* chore(NA): remove src folder from kbn-y* pkgs

* chore(NA): remove src folder from kbn-e* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-h** pkgs

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

* Revert "chore(NA): remove src folder from kbn-h** pkgs"

This reverts commit dcdf72bcc1.

* fix(NA): grammar location

* test(NA): fix tests for kbn/config-schema

* test(NA): fix tests for kbn/config-schema

* chore(NA): multiple errors fixed

* chore(NA): remove kuery grammar fix

* fix(NA): @kbn/ace imports

* fix(NA): grammar location

* fix(NA): add missing files to tsconfigs

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

* chore(NA): complete tsconfigs

* Revert "chore(NA): complete tsconfigs"

This reverts commit f48c616864.

* chore(NA): remove src folder from kbn-core* pkgs

* chore(NA): remove src folder from kbn-u* pkgs

* chore(NA): remove src folder from kbn-ui-shared-deps* pkgs

* chore(NA): fix problems on core pkgs

* chore(NA): fix problems on core pkgs

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

* fix(NA): shared_built_assets correct location'

* test(NA): update @kbn/optimizer integration snapshots

* chore(NA): remove src folder from kbn-t* p1 pkgs

* chore(NA): remove src folder from kbn-t* p2 pkgs

* chore(NA): update rootDir on utility types pkg

* chore(NA): include missing files on @kbn/test

* chore(NA): include missing files on @kbn/test

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): fix eslint

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): remove exclusion for mocks folde on @kbn/test

* fix(NA): several imports from target_node

* fix(NA): @kbn/test mocha and jest types clash

* chore(NA): remove src folder from kbn-storybook pkg

* chore(NA): remove src folder from kbn-stdio-dev-helpers pkg

* chore(NA): remove src folder from kbn-std pkg

* chore(NA): remove src folder from kbn-sort-pkg-json pkg

* chore(NA): remove src folder from kbn-some-dev-log and kbn-shared-ux-utility pkgs

* chore(NA): remove src folder from kbn-ux-storybook pkg

* chore(NA): remove src folder from kbn-shared-ux-services pkg

* chore(NA): remove src folder from kbn-shared-ux-components pkg

* chore(NA): remove src folder from kbn-shared-svg pkg

* chore(NA): remove src folder from kbn-server-http-tools pkg

* chore(NA): remove src folder from kbn-securitysolution-* pkgs

* chore(NA): remove src folder from kbn-r-* pkgs

* chore(NA): remove src folder from kbn-p* pkgs

* chore(NA): remove src folder from kbn-o* pkgs

* chore(NA): remove src folder from kbn-m* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-io-ts-utils* pkgs

* chore(NA): remove src folder from kbn-* pkgs except a few

* chore(NA): update @kbn/generate

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): remove src folder from kbn-monaco pkg

* chore(NA): remove src folder from kbn-interpreter pkg

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): update every require for target_*/src

* chore(NA): remover src folder from @kbn/handlebars

* fix(NA): license for @kbn/handlebars

* chore(NA): copy templates as part of the jsts_transpiler macro for @kbn/storybook

* chore(NA): update handlebars

* fix(NA): @kbn/plugin-generator import paths

* fix(NA): bundle sizes

* fix(NA): web bundle for @kbn/i18n-react

* Revert "fix(NA): bundle sizes"

This reverts commit 8aefe84fbc.

* Revert "Revert "fix(NA): bundle sizes""

This reverts commit e9d87d72a4.

* fix(NA): @kbn/docs-utils index.ts path expectation

* chore(NA): merge and solve conflicts with main

* fix(NA): relative import to index

* chore(NA): merge and solve conflicts with main

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

* chore(NA): apply eslint fix

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-30 15:57:35 +01:00
Sander Philipse
9307cacf7d
Bump redux (4.2.0), reselect (4.1.6), @reduxjs/toolkit (1.7.2), redux-thunk (2.4.1) and immer (9.0.15) (#138818)
* Upgrade Redux to 4.2.0 and Reselect to 4.1.6

* Fix typing in timelines TypedUseSelectorHook

* Upgrade reduxjs-toolkit and fix types

* Upgrade more dependencies and fix types

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

* Undo unnecessary type fixes

* Add renovate.json config for redux

* Add caret to @reduxjs/toolkit version

* Update package.json

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>

* Update package.json

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>

* Update package.json

Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>

* yarn bootstrap

* Ts-ignore failing types in presentation_util redux_embeddables

* Downgrade @reduxjs/toolkit to 1.7.2

* Undo ts-ignores in redux-embeddables

* Remove CombinedState comment

* Rebase onto main

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
2022-08-25 17:39:50 +02:00
Thomas Watson
84e8e54a6e
Bump undici sub-dependency from v5.5.1 to v5.8.2 (#138877) 2022-08-23 06:50:22 -07:00
Patryk Kopyciński
5b7a8d84cb
Bump React@17 (#128239) 2022-08-22 00:45:49 -07:00
Brian Seeders
28f7c425d9
[docs] Fix kbn-test README issue breaking docs (#138940) 2022-08-17 02:11:20 +09:30
Baturalp Gurdin
ed5d0eaaaf
docs(NA): adds @kbn/test into ops devdocs (#138803) 2022-08-16 11:48:56 +03:00
Tiago Costa
df8b62aa98
chore(NA): allow packages to not have an obligation for a src folder on packages (#138038)
* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-08-08 15:54:05 +01:00
Spencer
20f9cf9fd4
[eslint] add rule for validating cross-boundary imports (#137116) 2022-07-25 18:49:17 -05:00
Dzmitry Lemechko
10cd177456
[kbn-performance-testing-dataset-extractor] update json structure, filter out static resources on ci (#136651)
* [kbn-performance-testing-dataset-extractor] update json structure, filter out static res on ci

* convert body to string

* update schema and ftr configs

* update extractor

* fix headers combining

* update json structure

* re-order fields for easy read
2022-07-21 10:42:36 +02:00
Spencer
b9436617f1
[ftr] prevent configs from using --oss flag (#136756) 2022-07-20 12:20:58 -07:00
Tiago Costa
302bd423f3
chore(NA): eslint rule for disallowing naked eslint-disable (#136408)
* chore(NA): eslint rule for disallowing naked eslint-disable

* chore(NA): export new rule and update docs

* chore(NA): creation of rule in ts

* chore(NA): new corrected rule in ts

* refact(NA): remove old logic from older plugin

* docs(NA): update documentation

* docs(NA): update documentation

* docs(NA): update documentation

* refact(NA): include edge cases for better locating errors

* chore(NA): changed regex name

* docs(NA): correct name rule on docs

* refact(NA): use dedent in the template literals

* refact(NA): check for undefined

* fix(NA): introduces support for eslint-disable-line

* chore(NA): fix extra space

* test(NA): created more test cases

* chore(NA): rename plugin to eslint-plugin-disable

* docs(NA): update nav and operations landing page ids for eslint rule

* test(NA): use messageIds on test

* chore(NA): complete naked eslint disables with specific rules

* chore(NA): specific rules for a few naked eslint disable

* chore(NA): add focused eslint disable on big reindex_operation_with_large_error_message.ts file

* chore(NA): changes according PR feedback

* chore(NA): include specific eslint rules on latest naked eslint disable

* chore(NA): missing eslint disable specific rule

* fix(NA): remove comment for js annotator

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

* chore(NA): re add eslint focused disable rule to x-pack/plugins/osquery/cypress/support/coverage.ts

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-19 17:11:04 +01:00
Spencer
7231d7c5a1
[ftr] use correct script path when running outside of repo root (#136397) 2022-07-14 13:14:59 -05:00
Spencer
f074c397c5
[ftr] add support for launching a dedicated task runner Kibana node (#135875)
* [ftr] add support for launching a dedicated task runner Kibana node

* Update run_kibana_server.ts

* disable the optimizer in kbn-tasks proc when running locally

* remove paths module

* include decicated task proc in promises array

* add getSupertest() helper to DedicatesTaskRunner service

* avoid caching a supertest instance, just create one on request

* remove surprise dependents on KIBANA_ROOT const

* remove modifications to test/analytics/config.ts
2022-07-13 16:36:39 -05:00
Spencer
9ff26f9de9
[jest] throw on module collision in node presets (#136012) 2022-07-11 07:02:21 -07:00
Spencer
f5688a68a5
[ftr] rework kibana arg parsing, extend loggers correctly (#135944) 2022-07-08 08:54:56 -05:00
Spencer
1134d35e03
[jest] refactor config check (#135960) 2022-07-08 08:54:38 -05: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
Spencer
ed51e0fe0a
[testGroupRunOrder] allow defining a queue name for each ftr config (#135349) 2022-06-30 14:12:06 -07:00