Commit graph

94 commits

Author SHA1 Message Date
Devon Thomson
76caf5669c
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-presentation (#204843)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> * This PR has been auto-generated.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

#### 21 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/canvas-plugin` | `x-pack/platform/plugins/private/canvas` |
| `@kbn/controls-plugin` | `src/platform/plugins/shared/controls` |
| `@kbn/dashboard-enhanced-plugin` |
`x-pack/platform/plugins/shared/dashboard_enhanced` |
| `@kbn/dashboard-plugin` | `src/platform/plugins/shared/dashboard` |
| `@kbn/embeddable-enhanced-plugin` |
`x-pack/platform/plugins/shared/embeddable_enhanced` |
| `@kbn/embeddable-plugin` | `src/platform/plugins/shared/embeddable` |
| `@kbn/expression-error-plugin` |
`src/platform/plugins/shared/expression_error` |
| `@kbn/expression-image-plugin` |
`src/platform/plugins/shared/expression_image` |
| `@kbn/expression-metric-plugin` |
`src/platform/plugins/shared/expression_metric` |
| `@kbn/expression-repeat-image-plugin` |
`src/platform/plugins/shared/expression_repeat_image` |
| `@kbn/expression-reveal-image-plugin` |
`src/platform/plugins/shared/expression_reveal_image` |
| `@kbn/expression-shape-plugin` |
`src/platform/plugins/shared/expression_shape` |
| `@kbn/file-upload-plugin` |
`x-pack/platform/plugins/private/file_upload` |
| `@kbn/input-control-vis-plugin` |
`src/platform/plugins/private/input_control_vis` |
| `@kbn/inspector-plugin` | `src/platform/plugins/shared/inspector` |
| `@kbn/links-plugin` | `src/platform/plugins/private/links` |
| `@kbn/maps-ems-plugin` | `src/platform/plugins/private/maps_ems` |
| `@kbn/maps-plugin` | `x-pack/platform/plugins/shared/maps` |
| `@kbn/presentation-panel-plugin` |
`src/platform/plugins/private/presentation_panel` |
| `@kbn/presentation-util-plugin` |
`src/platform/plugins/shared/presentation_util` |
| `@kbn/vis-type-markdown-plugin` |
`src/platform/plugins/private/vis_type_markdown` |




#### 6 packages(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/flot-charts` | `src/platform/packages/shared/kbn-flot-charts` |
| `@kbn/mapbox-gl` | `src/platform/packages/private/kbn-mapbox-gl` |
| `@kbn/maps-vector-tile-utils` |
`x-pack/platform/packages/private/maps/vector_tile_utils` |
| `@kbn/panel-loader` | `src/platform/packages/private/kbn-panel-loader`
|
| `@kbn/presentation-containers` |
`src/platform/packages/shared/presentation/presentation_containers` |
| `@kbn/presentation-publishing` |
`src/platform/packages/shared/presentation/presentation_publishing` |


<details >
<summary>Updated references</summary>

```
./.eslintignore
./.eslintrc.js
./.github/codeql/codeql-config.yml
./.github/paths-labeller.yml
./.i18nrc.json
./docs/developer/best-practices/index.asciidoc
./docs/developer/contributing/development-tests.asciidoc
./docs/developer/plugin-list.asciidoc
./legacy_rfcs/text/0018_timeslider.md
./package.json
./packages/kbn-cli-dev-mode/src/watcher.ts
./packages/kbn-docs-utils/src/utils.test.ts
./packages/kbn-repo-packages/package-map.json
./packages/kbn-test/src/jest/setup/polyfills.jsdom.js
./packages/kbn-ts-projects/config-paths.json
./src/dev/build/tasks/build_canvas_shareable_runtime.ts
./src/dev/build/tasks/create_archives_sources_task.ts
./src/dev/code_coverage/ingest_coverage/__tests__/mocks/team_assign_mock.txt
./src/dev/precommit_hook/casing_check_config.js
./src/dev/storybook/aliases.ts
./src/platform/packages/private/kbn-panel-loader/jest.config.js
./src/platform/packages/shared/presentation/presentation_containers/jest.config.js
./src/platform/packages/shared/presentation/presentation_publishing/jest.config.js
./src/platform/plugins/private/input_control_vis/jest.config.js
./src/platform/plugins/private/links/jest.config.js
./src/platform/plugins/private/maps_ems/jest.config.js
./src/platform/plugins/private/presentation_panel/jest.config.js
./src/platform/plugins/private/vis_type_markdown/jest.config.js
./src/platform/plugins/shared/controls/jest.config.js
./src/platform/plugins/shared/dashboard/jest.config.js
./src/platform/plugins/shared/dashboard/public/dashboard_container/component/empty_screen/__snapshots__/dashboard_empty_screen.test.tsx.snap
./src/platform/plugins/shared/embeddable/README.md
./src/platform/plugins/shared/embeddable/jest.config.js
./src/platform/plugins/shared/expression_image/jest.config.js
./src/platform/plugins/shared/expression_metric/jest.config.js
./src/platform/plugins/shared/expression_repeat_image/jest.config.js
./src/platform/plugins/shared/expression_reveal_image/jest.config.js
./src/platform/plugins/shared/expression_shape/jest.config.js
./src/platform/plugins/shared/inspector/jest.config.js
./src/platform/plugins/shared/presentation_util/jest.config.js
./src/platform/plugins/shared/presentation_util/storybook/manager.ts
./src/plugins/visualizations/public/visualize_app/utils/migrate_app_state.ts
./tsconfig.base.json
./x-pack/.i18nrc.json
./x-pack/platform/packages/private/maps/vector_tile_utils/jest.config.js
./x-pack/platform/plugins/private/canvas/jest.config.js
./x-pack/platform/plugins/private/canvas/scripts/jest.js
./x-pack/platform/plugins/private/canvas/shareable_runtime/constants.js
./x-pack/platform/plugins/private/canvas/storybook/canvas_webpack.ts
./x-pack/platform/plugins/private/file_upload/jest.config.js
./x-pack/platform/plugins/shared/dashboard_enhanced/common/drilldowns/dashboard_drilldown/constants.ts
./x-pack/platform/plugins/shared/dashboard_enhanced/jest.config.js
./x-pack/platform/plugins/shared/dashboard_enhanced/public/services/drilldowns/embeddable_to_dashboard_drilldown/constants.ts
./x-pack/platform/plugins/shared/embeddable_enhanced/jest.config.js
./x-pack/platform/plugins/shared/maps/README.md
./x-pack/platform/plugins/shared/maps/jest.config.js
./x-pack/plugins/reporting/server/config/ui_settings.ts
./x-pack/test/api_integration/apis/maps/fonts_api.js
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
src/platform/packages/private/kbn-mapbox-gl/tsconfig.json:2
src/platform/packages/private/kbn-panel-loader/jest.config.js:12
src/platform/packages/private/kbn-panel-loader/tsconfig.json:2
src/platform/packages/shared/kbn-flot-charts/tsconfig.json:2
src/platform/packages/shared/presentation/presentation_containers/jest.config.js:12
src/platform/packages/shared/presentation/presentation_containers/tsconfig.json:2
src/platform/packages/shared/presentation/presentation_publishing/jest.config.js:12
src/platform/packages/shared/presentation/presentation_publishing/tsconfig.json:2
src/platform/plugins/private/input_control_vis/jest.config.js:12
src/platform/plugins/private/input_control_vis/tsconfig.json:2
src/platform/plugins/private/links/jest.config.js:12
src/platform/plugins/private/links/public/_mixins.scss:1
src/platform/plugins/private/links/tsconfig.json:2
src/platform/plugins/private/maps_ems/jest.config.js:12
src/platform/plugins/private/maps_ems/tsconfig.json:2
src/platform/plugins/private/presentation_panel/jest.config.js:12
src/platform/plugins/private/presentation_panel/tsconfig.json:2
src/platform/plugins/private/presentation_panel/tsconfig.json:6
src/platform/plugins/private/vis_type_markdown/jest.config.js:12
src/platform/plugins/private/vis_type_markdown/tsconfig.json:2
src/platform/plugins/shared/controls/jest.config.js:12
src/platform/plugins/shared/controls/tsconfig.json:12
src/platform/plugins/shared/controls/tsconfig.json:2
src/platform/plugins/shared/dashboard/jest.config.js:12
src/platform/plugins/shared/dashboard/tsconfig.json:2
src/platform/plugins/shared/embeddable/jest.config.js:12
src/platform/plugins/shared/embeddable/tsconfig.json:2
src/platform/plugins/shared/expression_error/tsconfig.json:2
src/platform/plugins/shared/expression_image/jest.config.js:12
src/platform/plugins/shared/expression_image/tsconfig.json:2
src/platform/plugins/shared/expression_metric/jest.config.js:12
src/platform/plugins/shared/expression_metric/tsconfig.json:2
src/platform/plugins/shared/expression_repeat_image/jest.config.js:12
src/platform/plugins/shared/expression_repeat_image/tsconfig.json:2
src/platform/plugins/shared/expression_reveal_image/jest.config.js:12
src/platform/plugins/shared/expression_reveal_image/tsconfig.json:2
src/platform/plugins/shared/expression_shape/jest.config.js:12
src/platform/plugins/shared/expression_shape/tsconfig.json:2
src/platform/plugins/shared/inspector/jest.config.js:12
src/platform/plugins/shared/inspector/tsconfig.json:2
src/platform/plugins/shared/presentation_util/jest.config.js:12
src/platform/plugins/shared/presentation_util/storybook/main.ts:17
src/platform/plugins/shared/presentation_util/tsconfig.json:13
src/platform/plugins/shared/presentation_util/tsconfig.json:2
x-pack/platform/packages/private/maps/vector_tile_utils/jest.config.js:10
x-pack/platform/packages/private/maps/vector_tile_utils/tsconfig.json:2
x-pack/platform/plugins/private/canvas/CONTRIBUTING.md:3
x-pack/platform/plugins/private/canvas/PLUGINS.mdx:174
x-pack/platform/plugins/private/canvas/PLUGINS.mdx:175
x-pack/platform/plugins/private/canvas/PLUGINS.mdx:63
x-pack/platform/plugins/private/canvas/PLUGINS.mdx:64
x-pack/platform/plugins/private/canvas/jest.config.js:10
x-pack/platform/plugins/private/canvas/shareable_runtime/constants.js:11
x-pack/platform/plugins/private/canvas/storybook/constants.ts:10
x-pack/platform/plugins/private/canvas/storybook/storyshots.skipped_test.tsx:86
x-pack/platform/plugins/private/canvas/tsconfig.json:16
x-pack/platform/plugins/private/canvas/tsconfig.json:2
x-pack/platform/plugins/private/canvas/tsconfig.json:29
x-pack/platform/plugins/private/file_upload/jest.config.js:10
x-pack/platform/plugins/private/file_upload/tsconfig.json:2
x-pack/platform/plugins/shared/dashboard_enhanced/jest.config.js:10
x-pack/platform/plugins/shared/dashboard_enhanced/tsconfig.json:2
x-pack/platform/plugins/shared/embeddable_enhanced/jest.config.js:10
x-pack/platform/plugins/shared/embeddable_enhanced/tsconfig.json:2
x-pack/platform/plugins/shared/maps/jest.config.js:10
x-pack/platform/plugins/shared/maps/public/_main.scss:1
x-pack/platform/plugins/shared/maps/tsconfig.json:12
x-pack/platform/plugins/shared/maps/tsconfig.json:2
```

</details>

---------

Co-authored-by: Nick Peihl <nick.peihl@elastic.co>
Co-authored-by: Michael Dokolin <mikhail.dokolin@elastic.co>
2024-12-23 12:32:11 -06:00
Gerard Soldevila
0e2fc8f4e2
Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-reporting-services (#202741)
## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> This PR has been auto-generated.
> Do not attempt to push any changes unless you know what you are doing.
> Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.




#### 1 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/screenshotting-plugin` |
`x-pack/platform/plugins/shared/screenshotting` |


<details>
<summary>Updated references</summary>

```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-cli-dev-mode/src/watcher.ts
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js
./src/dev/precommit_hook/casing_check_config.js
./tsconfig.base.json
./x-pack/.gitignore
./x-pack/.i18nrc.json
./x-pack/platform/plugins/shared/screenshotting/README.md
./x-pack/platform/plugins/shared/screenshotting/jest.config.js
./x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js
./x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts
./x-pack/plugins/lens/public/app_plugin/share_action.ts
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
x-pack/platform/plugins/shared/screenshotting/jest.config.js:10
x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js:10
x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js:14
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:10
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:14
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:2
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-17 19:49:07 -06:00
Jordan McAlpine
83b282a63a
fix: kibana dev server not restarting for external plugin #171260 (#198246)
## Summary

Fixes #171260 the Kibana dev server not restarting during external
plugin development for server side code.

### Checklist


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note
Fixes #171260 the Kibana dev server not restarting during external
plugin development for server side code.

---------

Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
2024-11-20 20:24:58 +00:00
Alejandro Fernández Haro
e6e170e687
[Dev Server] Remove dead code (#193736) 2024-09-23 19:01:08 +02:00
Garrett Spong
47d308604f
[Security Assistant] Updates Knowledge Base ES Schema, OAS, and API to support IndexEntries (#186566)
## Summary

This is a follow-up to https://github.com/elastic/kibana/pull/184974
that updates the KB Entries API's (and underlying schema) to support
`IndexEntries` in addition to `DocumentEntries`. `IndexEntries` are
entries in the Knowledge Base that are not backed by an embedded raw
text source, but rather by an entire Index or Data Stream. The user can
set the data source name, the specific field to query (must be ELSER
embeddings in this initial implementation), and a description for when
the assistant should search this data source for Knowledge Base content.
This essentially enables the user to create custom retrieval tools
backed by their own data.


The changes in this PR, as with the other recent KB enhancements, are
behind the following feature flag:
```
xpack.securitySolution.enableExperimental:
  - 'assistantKnowledgeBaseByDefault'
```

however as code change is required to test the new mappings. For this
you can update the `knowledgeBaseDataStream` in
`x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts`
to

```ts
    this.knowledgeBaseDataStream = this.createDataStream({
      resource: 'knowledgeBase',
      kibanaVersion: options.kibanaVersion,
      fieldMap: knowledgeBaseFieldMapV2, // Update this to the V2 mapping
    });
```

Change set includes:
- [X] ES Knowledge Base data stream schema and OAS has been updated to
support `IndexEntries`.
- [X] OAS schema files have been moved to the `/entries` sub-directory
- [ ] Backend KB services have been updated to support `IndexEntries`
  - [X] Storage methods updated
- [ ] Retrieval methods updated (will round out these endpoint when
working the UI next)

---

With these API changes, I've also introduced a few sample `*.http` files
for easier development/testing. These files are supported out of the box
in JetBrains IDE's or in VSCode with the
[httpyac](https://httpyac.github.io/) (and many other) extensions. Since
the configuration for these files includes a `-` in the name, that's why
you'll see a few @elastic/kibana-operations files updated.

You can read more about `http` files
[here](https://www.jetbrains.com/help/webstorm/http-client-in-product-code-editor.html)
and for the spec see this repo
[here](https://github.com/JetBrains/http-request-in-editor-spec/blob/master/spec.md).
If we find these useful, we could add support to our [OpenAPI
Generator](https://openapi-generator.tech/docs/generators/jetbrains-http-client)
to create these automatically. They currently live co-located next to
the OAS and generated schema files here:

```
x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.http
x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.http
```

and the main config here:

```
x-pack/packages/kbn-elastic-assistant-common/env/http-client.env.json
```

The `x-pack/packages/kbn-elastic-assistant-common/.gitignore` has been
updated to ignore `http-client.private.env.json` files locally, which is
how you can override the config as you'd like. This is helpful to add
variables like `basePath` as below:

```
{
  "dev": {
    "basePath": "/kbn"
  }
}
```

To use them, just open the corresponding `*.http` for the API you want
to test, and click `Send`, and the response will open in another tab.
Here is what that looks like for creating one of the new `IndexEntry` KB
documents that have been introduced in this PR:

<p align="center">
<img width="500"
src="https://github.com/user-attachments/assets/c9e70d1a-28d2-4eb3-9853-ab6d8e1c7acf"
/>
</p> 





### 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
* Feature currently behind feature flag. Documentation to be added
before flag is removed. Tracked in
https://github.com/elastic/security-docs/issues/5337
- [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-10 02:01:59 -06:00
Luke Elmers
b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
Larry Gregory
74d88580a5
Migrate codebase to use Object.hasOwn instead of Object.hasOwnProperty (#186829)
## Summary

This PR has breadth, but not depth. This adds 3 new `eslint` rules. The
first two protect against the use of code generated from strings (`eval`
and friends), which will not work client-side due to our CSP, and is not
something we wish to support server-side. The last rule aims to prevent
a subtle class of bugs, and to defend against a subset of prototype
pollution exploits:

- `no-new-func` to be compliant with our CSP, and to prevent code
execution from strings server-side:
https://eslint.org/docs/latest/rules/no-new-func
- `no-implied-eval` to be compliant with our CSP, and to prevent code
execution from strings server-side:
https://eslint.org/docs/latest/rules/no-implied-eval. Note that this
function implies that it prevents no-new-func, but I don't see [test
cases](https://github.com/eslint/eslint/blob/main/tests/lib/rules/no-implied-eval.js)
covering this behavior, so I think we should play it safe and enable
both rules.
- `no-prototype-builtins` to prevent accessing shadowed properties:
https://eslint.org/docs/latest/rules/no-prototype-builtins


In order to be compliant with `no-prototype-builtins`, I've migrated all
usages and variants of `Object.hasOwnProperty` to use the newer
[`Object.hasOwn`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn).
2024-08-13 10:30:19 -05:00
Alejandro Fernández Haro
ea620c4163
[Move @kbn/config-schema to server] @kbn/cli-dev-mode (#189523) 2024-07-30 12:47:04 -06:00
Pierre Gayvallet
b6fcfac9c1
[Kibana logging system] Add conditional evaluation based on level for logging APIs (#187225)
## Summary

*(Yeah, the title is pretty bad I apologize, I couldn't find something
sexy. OTOH, "sexy" and "logging" are usually antonyms, like "sport car"
and "fiat panda", or "server language" and "javascript")*

### 1. Provide a more developer-friendly alternative to
`Logger.isLevelEnabled`.


**With `isLevelEnabled`**
```ts
if(logger.isLevelEnabled('info')) {
  const message = someExpensiveMessageProbablyBasedOnJsonStringifyOrSomething(); 
  logger.info(message);
}
```

**With this PR:**
```ts
logger.info(() => someExpensiveMessageProbablyBasedOnJsonStringifyOrSomething());
``` 

### 2. Adapt calls to `log.debug` (arguably) costly to use this syntax

Aka any call relying on `JSON.stringify` or function calls.

I used the new syntax for those, except when the tests were too
complicated to fix or when the code did not allow it (e.g. untyped let
variables infered from return from assignations don't play well with
closures)
2024-07-08 23:53:02 +10:00
Pierre Gayvallet
dea26c6450
Add http2 support for Kibana server (#183465)
## Summary

Part of https://github.com/elastic/kibana/issues/7104

Add support for `http2` to the Kibana server. `http2` can be enabled by
setting `server.protocol: http2` in the Kibana config file.

*Note: by default, enabling `http2` requires a valid `h2c`
configuration, meaning that it can only run over HTTPS with TLS1.2+*

```yaml
## kibana.yaml
server.protocol: http2
server.ssl.enabled: true
server.ssl.key: path/to/key
server.ssl.certificate: path/my/cerf
```

## What is this PR doing

### Add HTTP2 support for the Kibana server

#### - Plug http2 to the Kibana server 

Even if HAPI was never officially updated to really support HTTP2,
node's `http`/`https`/`http2` modules are compatible enough to be able
to just instantiate an http2 server/listener and provide it to HAPI "as
a plain https listener". There were some tweaks to do (mostly silencing
a few warnings that HAPI was causing by sending http2-illegal headers
such as `Connection`), but overall, it went smoothly.

#### - Add config validation

By default, Kibana will require a valid `h2c` configuration to accept
enabling `http2`. It means that TLS must be enabled and that TLS1.2+
should at least be in the list of supported SSL protocols
(`server.ssl.supportedProtocols`). Note that default value of this
setting includes TLS1.2 and 1.3.

#### - Add escape hatch to run `h2` without `h2c`

In some situations, it may be required to enable http2 without a valid
`h2c` configuration. Kibana supports it, by setting
`server.http2.allowUnsecure` to `true`.

(*Note, however, that if http2 is enabled without TLS, ALPN protocol
negotiation won't work, meaning that most http2 agents/clients will fail
connecting unless they're explictly configured to use http2.*)

### Add documentation about this new feature

#### - Update the user-facing doc about this new `server.protocol`
setting

Update the user-facing Kibana settings documentation to include this
`http.protocol` setting (and refer to `server.http2.allowUnsecure`)

**Note: this setting, and this feature, are considered as experimental**

### Adapt our dev tooling to support running Kibana with http2 enabled

#### - Add a `--http2` flag to the dev CLI

Enabling this flag will add the proper configuration settings to run
Kibana with `http2` enabled in an (almost) valid `h2c` configutation.

*Note: when using this flag, even if listening on the same port, the
Kibana server will be accessible over https, meaning that you need to
use https in your browser to access it. Aka `http://localhost:5601`
won't work, you need to use `https://localhost:5601`. Also, we're using
the self-signed dev certificates, meaning that you must go though the
scary warning of your browser*

#### - Implement an http2-compatible base-path proxy

The current base path proxy is based on `hapi` and `hapi/h2o2`. I tried
for a bunch hours trying to hack around to make it work with http2
proxying, but ultimately gave up and implemented a new version from
scratch.

Note that with some additional efforts, this new http2 basepath proxy
could probably fully replace the existing one and be used for both http1
and http2 traffic, but it's an optimization / refactoring that did not
feel required for this PR.

### Adapt the FTR to run suites against http2

#### - Add support to run FTR test suite against an h2c-enabled Kibana

Note that with ALPN, clients using http1 should be (and are) able to
communicate with http2 Kibana, given h2c/alpn allows protocol
negitiation. So adapting our FTR tooling was not really about making it
work with http2 (which worked out of the box), but making it work with
**the self signed certifcates we use for https on dev mode**

Note that I'm not a big fan of what I had to do, however, realistically
this was the only possible approach if we want to run arbitrary test
suites with TLS/HTTP2 enabled without massively changing our FTR setup.

Operations and QA, feel free to chime in there, as this is your
territory.

#### - Change some FTR test suites to run against an HTTP2-enabled
server

I added a quick `configureHTTP2` helper function to take any "final" FTR
suite config and mutate it to enable `http2`. I then enabled it on a few
suites locally, to make sure the suites were passing correctly.

I kept two suites running with http2 enabled:
- the `console` oss functional tests
- the `home` oss functional tests

We could possibly enable it for more, but we need to figure out what
kind of strategy we want on that matter (see below)

## What is this pull request NOT doing

#### - Making sure everything works when HTTP2 is enabled

I navigated the applications quite a bit, and did not see anything
broken, however I obviously wasn't able to do a full coverage. Also, the
self-signed certificate was a huge pain to detect issues really caused
by http2 compared to issues because the local setup isn't valid `h2c`.

In theory though (famous last words) anything not doing http/1.1
specific hacks such as bfetch should work fine with http2, given that
even if using non-http2 clients, ALPN should just allow to fallback to
http/1.x (this part was tested)

#### - Enabling HTTP2 by default

PR isn't doing it for obvious reasons. 

#### - Enabling HTTP2 for all FTR suites

First of all, it's not that easy, because it requires adapting various
parts of the config (and even some var env...), and we don't have any
proper way to override config "at the end". For instance, if you add the
http2 config on a top level config (e.g. the oss functional one that is
reuse by the whole world - learned the hard way), it won't work because
higher-level configs redefined (and override) the `browser` part of the
config, loosing the settings added to run the browser in insecure mode.

Secondly, I'm not sure we really need to run that many suites with http2
enabled. I learned working on that PR that we only have like one suite
where https is enabled for the Kibana server, and I feel like it could
be fine to have the same for http2. In theory it's just a protocol
change, unless parts of our apps (e.g. bfetch) are doing things that are
specific to http/1.1, switching to http2 should be an implementation
detail.

But I'd love to get @elastic/kibana-operations and @elastic/appex-qa
opinion on that one, given they have more expertise than I do on that
area.

- Running performances tests

We should absolutely run perf testing between http/1.1 over https and
http/2, to make sure that it goes into the right directly (at least in
term of user perceived speed), but I did not do it in the scope of this
PR (and @dmlemeshko is on PTO so... 😅)

## Release Note

Add support for `http2` to the Kibana server. `http2` can be enabled by
setting `server.protocol: http2` in the Kibana config file.

Note: by default, enabling `http2` requires a valid `h2c` configuration,
meaning that it can only run over HTTPS with TLS1.2+

Please refer to the Kibana config documentation for more details.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-03 09:34:13 +02:00
Pierre Gayvallet
db316ad475
[http] explicitly create the server listener (#183591)
## Summary

Related to https://github.com/elastic/kibana/issues/7104
Adapted from https://github.com/elastic/kibana/pull/183465

For `http2` support, we will have to change the way we configure the
HAPI server to manually provide the listener instead of passing down the
options for HAPI to create it.

This PR prepares that work, by creating the `http` or `https` (`tls`)
listener and passing it when creating the HAPI server instead of just
passing the `tls` options.

**Note:** no integration tests were added, because we already have the
right coverage for both tls and non-tls mode, so any change of behavior
introduced by the PR should be detectable by them.
2024-05-21 08:11:20 -07:00
Pierre Gayvallet
148eeec0fe
Update supertest and superagent to latest version (#183587)
## Summary

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

Update supertest, superagent, and the corresponding type package, to
their latest version.

(of course, types had some signature changes and we're massively using
supertest in all our FTR suites so the whole Kibana multiverse has to
review it)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-17 04:23:21 -07:00
Alejandro Fernández Haro
1c1e20afdb
Use rxjs instead of rxjs/operators (#179553) 2024-04-02 11:41:33 -07:00
Pierre Gayvallet
38a3b9675d
Add http.payloadTimeout config option (#177309)
## Summary

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

- Add a `http.payloadTimeout` configuration option, to control the
payload timeout
- Set the default value for this option to `20s` (was `10s` previously)
2024-02-22 12:33:49 +01:00
Christiane (Tina) Heiligers
7bbe92f085
Enables preventing access to internal APIs (#156935)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-05-10 04:25:15 -07:00
Clint Andrew Hall
43fa5174f8
[kibana] Thank you for everything, Spencer! 🧔🏻‍♂️ (#150759)
## Summary

> _Inspired by @kertal, and extracted from his PR
https://github.com/elastic/kibana/pull/150660, specifically
@thomasneirynck's
[proposal](https://github.com/elastic/kibana/pull/150660/files#r1101795511)._
>
> _Holding for 24 hours, for our friends in later time zones._

Several of us felt a dev-only easter egg-- where, if you're lucky,
@spalger joins you as you test your latest feature-- would be a fun
tribute as he leaves us for new and exciting opportunities.

Elasticians, feel free to send your love to @spalger in the channel of
your choice, of course, but we'd appreciate your review of this pull
request. ❤️


![image](https://user-images.githubusercontent.com/1178348/217867285-b23dcf1f-1a4a-45fd-b828-f6b24215fef2.png)

---------

Co-authored-by: spalger <spencer@elastic.co>
2023-02-10 16:57:43 -06: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
Spencer
1ee97e1657
[kbn/babel-register] improve cache performance (#150261)
After https://github.com/elastic/kibana/pull/146212 it feels like the
babel-register cache is getting invalidated more frequently for some
reason. The current version of the cache only stores a single cache
entry for each file path, which shouldn't be too big of a problem but
with these changes several versions of a file will be cached. The
performance seems about equal, but because the cache contains multiple
versions of a single file we should spend less time transpiling files
when switching branches often.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-06 19:50:42 -07:00
Spencer
376bed5d16
implement "plugin" package type (#149370)
This PR updates the core discovery logic to support loading plugins from
packages. This logic is additive, so that the existing plugins in the
repo and third-party plugins can continue to be loaded via the existing
mechanism, but with https://github.com/elastic/kibana/pull/148130 we
will be automatically migrating all plugins in the repo to packages,
which will use this logic.

The logic is already in-use in that PR, and was developed there, but
extracted here for easier review.

The logic is relatively simple, where a list of packages in the repo are
attached to the core `Env` and then filtered by core before converting
all plugin packages to `PluginWrapper`. The `PluginWrapper` still
exposes the plugin manifest to the rest of the code, and it is used in
many places, so rather than making changes to the `PluginWrapper` I'm
faking a legacy plugin manifest with the plugin package manifest.

@elastic/kibana-core: I'm going to need some help identifying what we
need to get test coverage for. This is a pretty simple addition to the
core IMO, and if it didn't work then nothing would work, so I'm pretty
confident in it, but would still appreciate your feedback.
2023-01-30 10:47:53 -07:00
Spencer
2dd9c3a337
[dev-cli] restart Kibana when config is changed (#149334)
Restores the behavior of the dev cli prior to
https://github.com/elastic/kibana/pull/148924, allowing changes in
`config/**/*.yml` files to trigger server restarts.
2023-01-23 09:21:24 -07:00
Tiago Costa
ebd6a4ec8e
fix(NA): @kbn/cli-dev-mode nonPackageMatcher patterns (#148971)
This PR fixes the pattern matchers for `nonPackageMatcher` into our new
watcher logic as well as correctly classifies all the files found inside
the `screenshotting plugin`
2023-01-16 16:56:36 +00:00
Spencer
99013bdab8
switch out chokidar for @parcel/watcher in dev cli (#148924)
After the recent changes to limit the dev-cli watcher to relevant
packages, the watcher started logging tons of unnecessary changes, and
in some cases breaking based on the state of the repo. I have seen this
happen with Chokidar before, and I'm not convinced we'll be able to fix
it, so instead I decided to swap it out with `@parcel/watcher`, which is
a conceptually simpler implementation that automatically batches changes
and watches an entire directory, rather than tons of unique
directories/files.

This new implementation is conceptually simpler, and because of the
design of the `@parcel/watcher` module I was pushed to reuse the
`RepoSourceClassifier` to determine if we should restart the server
based on a specific change. This means we now have a single source of
truth for test files and the like (the classifier will tell us if a file
is a test file, regardless of where it exists in the repo).

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-13 16:42:13 -07: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
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
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
spalger
52f2b33a07
[auto] migrate existing plugin/package configs 2022-10-28 14:06:46 -05:00
Pierre Gayvallet
4ab9ef5784
Implement Logger.isLevelEnabled (#144033)
* Implement `Logger.isLevelEnabled`

* fix manual logger

* fix more manual logger

* updating snapshots

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-10-28 00:31:32 -07:00
spalger
42879f7656
[bazel] fix some BUILD.bazel file inconsistencies 2022-10-26 11:07:55 -05: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
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
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
a07fb3063b
[cli-dev-mode/base-path-proxy] switch to integration tests (#136545) 2022-07-18 10:49:22 -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
Shahzad
d6f2dc1042
[Exploratory view] Add e2e tests (#135148)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-06-28 13:31:12 +02:00
Tiago Costa
93204a9297
docs(NA): adds @kbn/cli-dev-mode into ops devdocs (#133012)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-06-01 23:19:42 +01:00
Abdul Wahab Zahid
eab8ece3fb
[User Experience] Synthetics e2e tests. (#132896)
Co-authored-by: shahzad31 <shahzad.muhammad@elastic.co>
2022-05-31 18:03:25 +02:00
Shahzad
edbcf8f35b
[Synthetics] Re-enable synthetics e2e tests (#133100)
* Re-enable synthetics e2e tests

* more renaming
2022-05-30 17:44:23 +02:00
Spencer
fa7323769d
[jest] try running unit tests in parallel (#130823) 2022-04-21 16:37:06 -05:00
Spencer
2a78f350e1
break out parts of @kbn/dev-utils (#130509)
* break out parts of @kbn/dev-utils

* autofix imports and kbn/pm dist

* update readme for @kbn/stdio-dev-helpers

* finish renames
2022-04-19 12:24:58 -05: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
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
Spencer
614139b8e5
[bazel] avoid a little boilerplate in packages (#126309)
* [bazel] avoid a little boilerplate for @types packages

* [bazel/ts] stop building sourcemaps since they're ignored
2022-02-24 12:43:12 -06:00
Tiago Costa
a926a57e03
chore(NA): splits types from code on @kbn/logging (#124688)
* chore(NA): splits types from code on @kbn/test

* chore(NA): create new @kbn/test-jest-helpers

* chore(NA): move wrong files into @kbn/test

* chore(NA): remove @kbn/test/jest references

* chore(NA): splits types from code on @kbn/logging

* chore(NA): import type from new @kbn/logging-mocks pkg

* chore(NA): missing deps on bazel build files

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-07 13:46:50 +00:00
Tiago Costa
64468b7a3e
chore(NA): splits types from code on @kbn/utils (#121924) 2021-12-23 03:18:10 +00:00
Tiago Costa
e1a86bac32
chore(NA): splits types from code on @kbn/std (#121815) 2021-12-22 09:45:10 +01:00
Tiago Costa
f7a0afc5e1
chore(NA): splits types from code on @kbn/server-http-tools (#121807) 2021-12-22 02:37:29 +00:00
Tiago Costa
ecf2265d56
chore(NA): splits types from code on @kbn/optimizer (#121426) 2021-12-16 20:04:20 +00:00
Tiago Costa
de5dd787b1
chore(NA): splits types from code on @kbn/dev-utils (#120531)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-07 20:12:18 +00:00
Tiago Costa
561031efd5
chore(NA): splits types from code on @kbn/docs-utils (#120533) 2021-12-06 22:01:36 +00:00