Commit graph

38 commits

Author SHA1 Message Date
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
Spencer
c8f83ed2eb
Move real plugins out of 'fixtures' dirs (#148756)
The location of plugins was previously somewhat irrelevant, but as we
move into packages it's more important that we can find all plugins in
the repository, and we would like to be able to do that without needing
to maintain a manifest somewhere to accomplish this. In order to make
this possible we plan to find any plugin/package by spotting all
kibana.json files which are not "fixtures". This allows plugin-like code
(but not actual plugin code) to exist for testing purposes, but it must
be within some form of "fixtures" directory, and any plugin that isn't
in a fixtures directory will be automatically pulled into the system
(though test plugins, examples, etc. will still only be loaded when the
plugin's path is passed via `--plugin-path`, the system will know about
them and use that knowledge for other things).

Since this is just a rename Operations will review and merge by EOD Jan
12th unless someone has a blocking concern.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-12 12:38:49 -07:00
Christiane (Tina) Heiligers
5f9678143b
Removes deprecated <IHttpFetchError.res>, <IHttpFetchError.req> (#147727)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-12-27 10:55:21 -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
Alejandro Fernández Haro
a5f5d8682e
[EBT] Add flush method and call it during stop (#144925)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Resolves https://github.com/elastic/kibana/issues/140521
2022-11-16 14:48:11 +01:00
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Alejandro Fernández Haro
a30f691a43
[EBT] Report viewport size (#143854) 2022-10-25 04:18:55 -07:00
Kibana Machine
796dcb9915 skip failing test suite (#142548) 2022-10-04 07:58:43 -06:00
Nathan Reese
999bc84c81
[Sample data] replace legacy control visualizations with dashboard controls (#141824)
* [Sample data] replace legacy control visualizations with dashboard controls

* i18n wrappings for title and description

* update screen shots

* fix functional tests

* update functional test expects

* more functional test expect updates

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-03 20:06:05 -06:00
Liza Katz
af45ef831e
add flexible EBT Performance Metric Schema (#136395) 2022-08-03 15:21:24 +03:00
Alejandro Fernández Haro
d217e2cdfd
Flaky test 133800 (#136518) 2022-07-18 14:54:30 +02:00
Tiago Costa
d5a66ac763
skip flaky suite (#133800) 2022-07-15 12:20:31 +01:00
Liza Katz
142661cffb
[EBT] Dashboard data loaded event (#134243)
* timing dashboard data loading

* reporting loading \ error from all embeddables

* report event

* lint

* comment out console

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

* Update embeddable_child_panel.tsx

* Make analytics optional

* Telemetry report to include both time to load data and time to render

* Measure load time from beginning of mount

* lint

* fix onDataLoadEnd and onDataLoadError event handler callbacks only called for source data requests

* dataLoadEnd

* code review

* imports

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

* comment

* Fix dedupe of events!

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

* Rendered discover
Fix refresh not firing event

* oops

* Code review + DashboardLoadedEvent

* reportsEmbeddableLoad

* type

* isNil

* fix sync unsubscribe

* use store state instead of eventHandlers

* [EBT] Better FTR helper APIs

* dashboard loaded telemetry test

* timestamp

* tests

* tests

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

* test

* docs + longer timeout

* fix

* Fix property inheritance and map events

* type error

* reportsEmbeddableLoad

* tests

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

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: nreese <reese.nathan@elastic.co>
Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
2022-07-12 15:17:17 +03:00
Alejandro Fernández Haro
6a043110cd
[Flaky tests] Click a more explicit button (#136091) 2022-07-11 19:02:44 +02:00
Spencer
1134d35e03
[jest] refactor config check (#135960) 2022-07-08 08:54:38 -05:00
Alejandro Fernández Haro
dd43c2d129
[EBT] Validate event&context payloads in dev-mode (#135061)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-04 15:42:08 +02:00
Alejandro Fernández Haro
a2b0927e65
[EBT] Better FTR helper APIs (#135298) 2022-06-29 14:11:13 +02:00
Liza Katz
071c878717
Report kibana protocol (#135202)
* kibana protocol

* oops

* Update loaded_kibana.ts

* Update core_system.ts
2022-06-27 18:13:53 +03:00
Liza Katz
8133605b89
[EBT] Enrich kibana loaded with timings (#134770)
* Add timings to kibana loaded event

* jest

* PR failures

* code review

* docs

* add first_app_nav and first_app

* tests

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

* Update src/core/public/core_system.ts

Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>

* Update src/core/public/core_system.ts

Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>

* review @afjaro

* typo

* KBN_LOAD_MARKS

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2022-06-23 12:46:07 +03:00
Alejandro Fernández Haro
608ce66a0b
[EBT FTR Helpers] Rename getLastEvents to getEvents (#133094) 2022-05-30 02:48:44 -07:00
Alejandro Fernández Haro
85638ebb88
[FTR analytics] Unskip flaky tests (#132925) 2022-05-30 09:55:52 +02:00
Kibana Machine
93b619714a skip failing test suite (#132953) 2022-05-25 11:41:14 -05:00
Kibana Machine
f268096982 skip failing test suite (#132931) 2022-05-25 09:25:09 -05:00
Kibana Machine
a7caee80e7 skip failing test suite (#132910) 2022-05-25 08:21:31 -05:00
Kibana Machine
18ae9db1c4 skip failing test suite (#132907) 2022-05-25 08:19:19 -05:00
Alejandro Fernández Haro
003474c5b4
[EBT] Call optIn(false) if the telemetry plugin is disabled (#132748) 2022-05-25 13:13:19 +02:00
Christiane (Tina) Heiligers
68a62969d2
Updates functional test to handle future server-side events (#132824) 2022-05-24 10:37:46 -07:00
Alejandro Fernández Haro
10915c90d4
[EBT] Fix flaky test for Context Providers in the browser (#131957) 2022-05-11 08:17:16 +02:00
Alejandro Fernández Haro
ab43a29f01
[EBT] Track "click" events (#131755)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-05-10 14:04:45 +02:00
Tiago Costa
53d170aeca
skip flaky suite (#131729) 2022-05-09 17:34:43 +01:00
Alejandro Fernández Haro
8539a912b5
[EBT] Core Context Providers (#130785) 2022-05-06 10:42:05 +02:00
Spencer
542b381fa5
[ftr] automatically determine config run order (#130983)
* [ftr] automatically determine config run order

* split lens config into two groups

* support ftr configs always running against CI

* Split detection_engine_api_integration rule exception list tests

* Add configs from previous commit

* [ftr] remove testMetadata and maintain a unique lifecycle instance per run

* Revert "[ftr] remove testMetadata and maintain a unique lifecycle instance per run"

This reverts commit d2b4fdb824.

* Split alerting_api_integration/security_and_spaces tests

* Add groups to yaml

* Revert "Revert "[ftr] remove testMetadata and maintain a unique lifecycle instance per run""

This reverts commit 56232eea68.

* stop ES more forcefully and fix timeout

* only cleanup lifecycle phases when the cleanup is totally complete

* only use kill when cleaning up an esTestInstance

* fix broken import

* fix runOptions.alwaysUseSource implementation

* fix config access

* fix x-pack/ccs config

* fix ml import file paths

* update kibana build id

* revert array.concat() change

* fix baseConfig usage

* fix pie chart data

* split up maps tests

* pull in all of group5 so that es archives are loaded correctly

* add to ftr configs.yml

* fix pie chart data without breaking legacy version

* fix more pie_chart stuff in new vis lib

* restore normal PR tasks

* bump kibana-buildkite-library

* remove ciGroup validation

* remove the script which is no longer called from checks.sh

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

* adapt flaky test runner scripts to handle ftrConfig paths

* fix types in alerting_api_integration

* improve flaky config parsing and use non-local var name for passing explicit configs to ftr_configs.sh

* Split xpack dashboard tests

* Add configs

* [flaky] remove key from ftr-config steps

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

* restore cypress builds

* remove ciGroups from FTR config files

* fixup some docs

* add temporary script to hunt for FTR config files

* use config.base.js naming for clarity

* use script to power ftr_configs.yml

* remove usage of removed x-pack/scripts/functional_tests

* fix test names in dashboard snapshots

* bump kibana-buildkite-library

* Try retrying only failed configs

* be a little quieter about trying to get testStats from configs with testRunners defined

* Remove test code

* bump kibana-buildkite-library

* update es_snapshot and on_merge jobs too

* track duration and exit code for each config and print it at the end of the script

* store results in order, rather than by key, in case there are duplicates in $config

* bash is hard

* fix env source and use +e rather than disabling e for whole file

* bash sucks

* print config summary in jest jobs too

* define results in jest_parallel.sh

* simplify config summary print, format times a little better

* fix reference to unbound time variable, use better variable name

* skip the newline between each result

* finish with the nitpicking

* sync changes with ftr_configs.sh

* refuse to execute config files which aren't listed in the .buildkite/ftr_configs.yml

* fix config.edge.js base config import paths

* fix some readmes

* resolve paths from ftr_configs manifest

* fix readConfigFile tests

* just allow __fixtures__ configs

* list a few more cypress config files

* install the main branch of kibana-buildkite-library

* split up lens group1

* move ml data_visualizer tests to their own config

* fix import paths

* fix more imports

* install specific commit of buildkite-pipeline-library

* sort configs in ftr_configs.yml

* bump kibana-buildkite-library

* remove temporary script

* fix env var for limiting config types

* Update docs/developer/contributing/development-functional-tests.asciidoc

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>

* produce a JUnit report for saved objects field count

* apply standard concurrency limits from flaky test runner

* support customizing FTR concurrency via the env

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2022-05-04 17:05:58 -05:00
Alejandro Fernández Haro
7226982759
[EBT] Add Elastic V3 Shippers (#130696)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-05-04 09:22:34 -07:00
Alejandro Fernández Haro
fbc8a7176b
[EBT] Split @elastic/analytics package (#130574)
Co-authored-by: Spencer <spencer@elastic.co>
2022-04-20 15:45:37 +02:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Alejandro Fernández Haro
bed793a6a1
[EBT] Add Shipper "FullStory" (#129927) 2022-04-13 17:34:07 +02:00
Alejandro Fernández Haro
9d5aca591b
Upgrade RxJS to 7 (#129087)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-12 12:40:55 -07:00
Alejandro Fernández Haro
fcf862220b
Create @elastic/analytics package (#128407)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-05 08:21:57 -07:00