Commit graph

223 commits

Author SHA1 Message Date
Alejandro Fernández Haro
fd09c26d15
async-import plugins in the server side (#170856)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-15 00:55:56 -07:00
Yulia Čech
cecd175d34
[Index Management] Add index name badges to the details page (#170558)
## Summary
Fixes https://github.com/elastic/kibana/issues/170335

This PR adds index name badges to the index details page. The badges
used to be rendered in the index details flyout but were not
re-implemented for the new details page in
https://github.com/elastic/kibana/pull/165705.
Currently, there are only 3 possible badges: "frozen", "rollup" and
"follower".

### Screenshots
#### Short index name
<img width="1486" alt="Screenshot 2023-11-03 at 17 53 18"
src="92bc5ae0-b4ef-4710-a9c2-8dd505b0febf">

#### Long index name


1b89381b-5b9a-4a59-9473-e5887a473250






### Checklist

- [ ] 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
- [ ] [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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-11-07 10:29:59 +00:00
Ignacio Rivas
9d0c7d7df2
[ES UI Shared] Remove old ace based EuiCodeEditor (#169613) 2023-10-25 21:14:43 +02:00
Cee Chen
121353cf45
[rollup][licensing_management][grokdebugger] Migrate deprecated EuiPage* components (#168300)
## Summary

EUI will shortly be removing several deprecated `EuiPage*` components,
and we're updating a few remaining Kibana usages of these deprecated
components ahead of time.

See https://github.com/elastic/kibana/issues/161872 for other similar
tasks with more information about this effort.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-18 10:18:42 -07:00
Yulia Čech
79411d97c7
[Rollups] Disable Rollups index data enricher if Rollups UI is disabled (#167295)
## Summary

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

This PR introduces following changes, if the config
`xpack.rollup.ui.enabled` is set to `false`:
- on the client side:
  - don't add the Rollup toggle to Index Management
  - don't add the Rollup badge to Index Management
- on the server side: 
  - don't add Rollup data enricher to Index Management
- don't enable Rollup in data views and data search (the same is done on
the client side already)
2023-10-04 16:52:04 +02:00
Matthew Kime
b1b9340c10
[data views] Disable rollup ui elements on serverless (#164098)
## Summary
While rollup functionality is deprecated in serverless, its still
possible to import a rollup data view. Lets hide any mention of this
since it will be lacking all rollup functionality.
2023-09-06 13:52:02 -07:00
Alejandro Fernández Haro
e98b4b3e88
[config-schema] offeringBasedSchema helper (#163786)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-22 03:59:15 -07:00
Yulia Čech
c7053d4d4b
[Rollup] Add a comment about api use by the data view plugin (#163432)
## Summary
Adds a comment that the API endpoint /rollup/indices is used by the data
view plugin.

With https://github.com/elastic/kibana/pull/162674 merged, the issue
https://github.com/elastic/kibana/issues/152708 has been closed. The
Data Discovery team is not planning any further work around rollup api
use due to the feature being deprecated. I think adding a comment to the
API code directly will help us remember this dependency for when we are
going to edit or remove the endpoint.
2023-08-08 10:42:10 -07:00
Matthew Kime
a69870b950
[data / data views] Disable rollup functionality when rollup plugin is disabled (#162674)
## Summary

Rollup functionality will be disabled on serverless instances. The
`rollup` plugin will be disabled. While it won't be possible to create
rollups on serverless, it will be possible to import data view saved
objects which may be configured for use with rollups. We will make a
'best effort' to improve functionality as to help users transition away
from rollups.

- In classic environments, the `rollup` plugin will enable `dataViews`
and `data` plugin rollup functionality.
- The data plugin will run an async search instead of a rollup search.
- The data views plugin will fetch normal fields, omitting a query for
rollup fields - which would fail anyway.

Closes https://github.com/elastic/kibana/issues/152708

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-08 11:25:13 -05:00
Alison Goryachev
75f68da623
Disable management plugins using contextRef (#160671) 2023-07-18 13:21:37 +02:00
Patryk Kopyciński
a1d02824f1
[shared-ux-router] Add Router and Routes components (#159834)
## Summary

Why?

To simplify the process of migration to react-router@6.
https://github.com/remix-run/react-router/discussions/8753

What problems exactly it solves?

- In my previous PR I added `CompatRouter`
https://github.com/elastic/kibana/pull/159173, which caused changes in
~50 files and pinged 15 Teams. And this is just meant to be a temporary
change, so when we're done with the migration I would have to revert
these changes and engage everyone to review the PR again. And it is just
a single step in the migration strategy. So to make our lives easier I
think it would be better to have a common place where we do import our
router components because it will allow us to surface some extra logic
in single place instead of going through the whole source code again.

- `react-router@6` doesn't support a custom `Route` component, so that
means our custom `Route` component that we're using almost everywhere
today, will need to be replaced by a different solution. I have decided
to add `Routes` component, which will be responsible for rendering the
proper component (`react-router@6` renamed `Switch` to `Routes`, so I
have named this component to align with the dictionary of the new
router) and also is going to add the logic that today is done in `Route`
(moving logic to `Routes` will be done in the follow-up PR, here I just
wanted to focus on using the common router components to make the review
process easier)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-23 10:02:06 -05:00
Clint Andrew Hall
6690c445e3
[serverless] Add ability to disable certain plugins for Serverless. (#155583)
> Derived from https://github.com/elastic/kibana/pull/153274

## Summary

This PR extracts configuration settings for enabling/disabling plugins
in Serverless projects based on current requirements.

It seemed prudent to create an independent PR to K.I.S.S, rather than
include in PRs with more ornate changes, (e.g.
https://github.com/elastic/kibana/pull/155582)
2023-04-26 13:44:31 -04:00
Ignacio Rivas
5ed5fd4555
[Rollup Jobs] Migrate EuiCodeEditor to EuiCodeBlock (#155494) 2023-04-25 16:11:32 +02:00
Gerard Soldevila
21351df953
Split the .kibana saved objects index into multiple indices (#154888)
## Description 

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

This PR move some of the SO types from the `.kibana` index into the
following ones:
- `.kibana_alerting_cases`
- `.kibana_analytics`
- `.kibana_security_solution`
- `.kibana_ingest`

This split/reallocation will occur during the `8.8.0` Kibana upgrade
(*meaning: from any version older than `8.8.0` to any version greater or
equal to `8.8.0`*)

**This PR main changes are:**
- implement the changes required in the SO migration algorithm to
support this reallocation
- update the FTR tools (looking at you esArchiver) to support these new
indices
- update hardcoded references to `.kibana` and usage of the
`core.savedObjects.getKibanaIndex()` to use new APIs to target the
correct index/indices
- update FTR datasets, tests and utility accordingly 

## To reviewers

**Overall estimated risk of regressions: low**

But, still, please take the time to review changes in your code. The
parts of the production code that were the most impacted are the
telemetry collectors, as most of them were performing direct requests
against the `.kibana` index, so we had to adapt them. Most other
contributor-owned changes are in FTR tests and datasets.

If you think a type is misplaced (either we missed some types that
should be moved to a specific index, or some types were moved and
shouldn't have been) please tell us, and we'll fix the reallocation
either in this PR or in a follow-up.

## .Kibana split

The following new indices are introduced by this PR, with the following
SO types being moved to it. (any SO type not listed here will be staying
in its current index)

Note: The complete **_type => index_** breakdown is available in [this
spreadsheet](https://docs.google.com/spreadsheets/d/1b_MG_E_aBksZ4Vkd9cVayij1oBpdhvH4XC8NVlChiio/edit#gid=145920788).

#### `.kibana_alerting_cases`
- action
- action_task_params
- alert
- api_key_pending_invalidation
- cases
- cases-comments
- cases-configure
- cases-connector-mappings
- cases-telemetry
- cases-user-actions
- connector_token
- rules-settings
- maintenance-window

#### `.kibana_security_solution`
- csp-rule-template
- endpoint:user-artifact
- endpoint:user-artifact-manifest
- exception-list
- exception-list-agnostic
- osquery-manager-usage-metric
- osquery-pack
- osquery-pack-asset
- osquery-saved-query
- security-rule
- security-solution-signals-migration
- siem-detection-engine-rule-actions
- siem-ui-timeline
- siem-ui-timeline-note
- siem-ui-timeline-pinned-event

#### `.kibana_analytics`

- canvas-element
- canvas-workpad-template
- canvas-workpad
- dashboard
- graph-workspace
- index-pattern
- kql-telemetry
- lens
- lens-ui-telemetry
- map
- search
- search-session
- search-telemetry
- visualization

#### `.kibana_ingest`

- epm-packages
- epm-packages-assets
- fleet-fleet-server-host
- fleet-message-signing-keys
- fleet-preconfiguration-deletion-record
- fleet-proxy
- ingest_manager_settings
- ingest-agent-policies
- ingest-download-sources
- ingest-outputs
- ingest-package-policies

## Tasks / PRs

### Sub-PRs

**Implementation**
- 🟣 https://github.com/elastic/kibana/pull/154846
- 🟣 https://github.com/elastic/kibana/pull/154892
- 🟣 https://github.com/elastic/kibana/pull/154882
- 🟣 https://github.com/elastic/kibana/pull/154884
- 🟣 https://github.com/elastic/kibana/pull/155155

**Individual index split**
- 🟣 https://github.com/elastic/kibana/pull/154897
- 🟣 https://github.com/elastic/kibana/pull/155129
- 🟣 https://github.com/elastic/kibana/pull/155140
- 🟣 https://github.com/elastic/kibana/pull/155130

### Improvements / follow-ups 

- 👷🏼 Extract logic into
[runV2Migration](https://github.com/elastic/kibana/pull/154151#discussion_r1158470566)
@gsoldevila
- Make `getCurrentIndexTypesMap` resillient to intermittent failures
https://github.com/elastic/kibana/pull/154151#discussion_r1169289717
- 🚧 Build a more structured
[MigratorSynchronizer](https://github.com/elastic/kibana/pull/154151#discussion_r1158469918)
- 🟣 https://github.com/elastic/kibana/pull/155035
- 🟣 https://github.com/elastic/kibana/pull/155116
- 🟣 https://github.com/elastic/kibana/pull/155366
## Reallocation tweaks

Tweaks to the reallocation can be done after the initial merge, as long
as it's done before the public release of 8.8

- `url` should get back to `.kibana` (see
[comment](https://github.com/elastic/kibana/pull/154888#discussion_r1172317133))

## Release Note

For performance purposes, Kibana is now using more system indices to
store its internal data.

The following system indices will be created when upgrading to `8.8.0`:

- `.kibana_alerting_cases`
- `.kibana_analytics`
- `.kibana_security_solution`
- `.kibana_ingest`

---------

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2023-04-25 09:43:42 +02:00
Jason Stoltzfus
c339ca8394
Upgraded EUI to v76.0.0 (#152506)
👋 Hi all - the biggest breaking change of this PR is around two icon
type changes/renames.

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

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

## Summary

`eui@75.1.2`  `eui@76.0.2`

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

**Bug fixes**

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

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

**Bug fixes**

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

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

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

**Bug fixes**

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

**Breaking changes**

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

---------

Co-authored-by: Davey Holler <daveyholler@hey.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2023-03-14 14:27:40 -05:00
Rachel Shen
50a4fc4916
[Shared UX] Adoption of Shared UX Route component (#150357)
## Summary

This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.

### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:

> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.

### Future PR

Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)

> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.

This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'


### Checklist

Delete any items that are not applicable to this PR.

- [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>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2023-02-14 19:25:04 +00: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
Rudolf Meijering
cfee703139
Bump elasticsearch-js to 8.6.0-canary.3 (#148521)
## Summary

Bump elasticsearch-js to 8.6.0-canary.3 to unblock
https://github.com/elastic/kibana/issues/145653

The updated version of elasticsearch-js comes with some type changes
that causes typescript type checking to fail. I've fixed the type errors
that were obvious/easy but left todo's for some types which were harder
for me to figure out. If any of these todo's are in your team's code,
please contribute directly to the branch to fix them.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] 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
- [ ] [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))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thom Heymann <thom.heymann@elastic.co>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
2023-01-24 05:49:30 -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
5efededc06
Upgrade @elastic/elasticsearch@8.5.0-canary.1 (#145416)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-11-23 18:01:51 -07:00
Tiago Costa
016e3e03a4
chore(NA): enables isolatedModules on base tsconfig file (#144841)
This PR enables `isolatedModules` on our `tsconfig.base.json`. Enabling
this means that our codebase is safe for tools that use TypeScript APIs
like `transpileModule` or alternative compilers like Babel. The
requirements introduced by enabling `isolatedModules` were already in
place for every piece of code transpiled with babel so we feel like its
time to make it the default across the board inside our repository.

The DX shouldn't be impacted negatively by these change as we introduced
a lint rule verification for the critical part around `isolatedModules`
which is around `const enums`. The PR also has a couple of `TODOs` to be
removed once we upgrade into typescript v4.8 where we would be able to
say everything that is typescript inside our repo should be consider a
module by default.

More information about `isolatedModules` can be found at
https://www.typescriptlang.org/tsconfig#isolatedModules

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-11-18 19:39:11 +00: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
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
Jonathan Budzenski
be432c0d89
Upgrade to Jest 27 (#139335)
* Upgrade to Jest 27

* fix test
2022-10-25 14:38:38 -05:00
Constance
98f73d674a
Upgrade EUI to v63.0.6 - updates to new EuiPageTemplate and deprecates old page components (#139524)
* Update all usages of EuiPageTemplate to EuiPageTemplate_Deprecated

* EuiPageContent_Deprecated as EuiPageContent

* EuiPageContentBody_Deprecated as EuiPageContentBody

* EuiPageContentHeader_Deprecated as EuiPageContentHeader

* EuiPageContentHeaderSection_Deprecated as EuiPageContentHeaderSection

* EuiPageSideBar_Deprecated as EuiPageSideBar

* EuiPageContent__Deprecated to EuiPageContent_Deprecated

* Fix rogue semi-colons

* WIP: NoDataConfigPage & NoDataPage converted to new template

- `withSolutionNav` not yet handled

* WIP: KibanaPageTemplateInner converted to use new template

- Pushes existing `pageHeader` prompts onto created EuiPageTemplate.PageHeader
- Uses `isEmptyState` to push `pageHeader` props to EuiPageTemplate.EmptyPrompt instead (if `children` are not supplied)

* WIP: `withSolutionNav` now renders the sidebar content properly

- Collapsing isn’t working (minWidth isn’t updating)

* Fixing stickiness of sidebar

* [Security] Fixed SecuritySolutionTemplateWrapper’s usage

- Moved `bottomBar` to EuiPageTemplate.BottomBar (now contained in just the page contents)
- Change EuiPanel children wrapper with EuiPageTemplate.Section

* [O11y] Wrap `children` with EuiPageTemplate.Section

* Fix getting_started usage

* WIP: Fixing types

* Removing `template` pass through

* Set EUI to 63.0.0

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

* More import fixes

* Sidebar component update

* Expand `KibanaPageTemplate` to all namespaced EUI counterparts

- Updated `docs/tutorials` mdx page
- Fixed SolutionNav prop types

* Updated the tutorial mdx page

* [Stack Management] Updated app layout to new template

- Some temporary props applied for BWC until all other pages can be converted
- Converted `API Keys` page’s layout (and especially prompt usags) to new paradigm

* Fix circular dep

* Fix new circular dependency

- copying and pasting types from KibanaPageTemplateProps, but ah well

* [Security Solution] Remove `template` prop - no longer a prop on Kibana/EuiPageTemplate

* [O11y] Allow customizing EuiPageTemplate.Section wrapper

- converts pageBodyProps
- fixes non-centered loading template

* [Enterprise Search] Update page templates

- fix layouts by auto-wrapping an EuiPageSection for padding, while adding a `customPageSections` prop for more custom sections/layouts

- re-center 404 errors

- update tests

* Update KibanaPageTemplate tests

* Update snapshots

* Fix FTR test with removed EUI classNames

* Fix FTR tests with changed kbn classNames

* Update failing dashboard snapshots

- drop shadow changed slightly in EUI

* Fix failing Security Cypress test

* [O11y] Fix Inventory page using deprecated CSS hooks

* [O11y][Uptime] Fix missing bottom bars

- Modifies ObservabilityPageTemplate to accept a `bottomBar` prop (a la the old EuiPageTemplate behavior)

NOTE: This opinionated page layout structure is starting to feel like it could be potentially limiting / have all the same pitfalls the previous EuiPageTemplate did. If so, consider something closer to the Enterprise Search page template conversion (`customPageSections`).

- Misc cleanup: Use `KibanaPageTemplate` over `EuiPageTemplate`

* [O11y] Fix route template typing

- Since theObservabilityPageTemplate is using the new Eui/KibanaPageTemplate, its child templates and types need to be updated accordingly

* Fix broken minWidth behavior

- was an EUI issue that required a patch release
+ update snapshots

* [Security Solution] Type fixes, restore empty state

- Fix empty state logic removed in a previous commit
- bogarts KibanaPageTemplate's `isEmptyState` prop instead of using `template="noData"`

- extend template wrappers to past ...rest to underlying Kibana/EuiPageTemplate

+ replace EuiPageTemplate with KibanaPageTemplate for consistency

* Fix failing synthetics selector

* Grab EUI v63.0.6

- for deprecation tags and section tag support

* Fix Kibana Overview plugin layout

- needs to use KibanaPageTemplate.Section to get padding back

- use `bottomBorder` prop over horizontal rules

- restore previous page color via panelled=false

* Convert Home plugin to new KibanaPageTemplate

- use KibanaPageTemplate.Section instead to preserve page width/paddings

- use `bottomBorder` instead of `EuiHorizontalRule`

- NOTE: This causes margins to decrease slightly from xxl to xl (largest padding available for EuiPageSection) - this can be restored by CSS overrides if desired

- update CSS to preserve previous looks, + convert to logical properties

* [O11y] Fix non-centered empty/loading states

* [O11y] Restore subdued background on various empty state prompts

* [O11y] Fix all instances of views that require a scrollable full-height child

+ restore comment for inventory view

* [O11y][ux] Fix broken sidebar

- The entire app was missing a wrapping EuiProvider, and as such breakpoint utils were not working, and the sidebar was missing

+ misc cleanup
  - remove unnecessary fragment
  - remove role="main" attr - now that EuiPageTemplate sets a `main` tag, they'll conflict
  - add isEmptyState to center loading component

* [APM Cypress tests] harden flaky test

* [APM Cypress tests] Fix failing Cypress test, again

Co-authored-by: cchaos <caroline.horn@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-07 15:35:23 -05:00
Gerard Soldevila
4824d9da8c
Migrate types to packages: Client-side HTTP service (#135562)
* Migrate types to packages: Client-side HTTP service

* Fix linting issues, compactify some imports

* Fix incorrect typing, remove unnecessary exports

* Remove unnecessary export

* Fix trailing spaces removed by mistake

* Move Sha256 to new @kbn/crypto-browser package

* Support deprecated 'req' property in isHttpFetchError() method

* Fix failing UT in lens

* Update API docs

* Reorder imports, absolute imports first

* Provide createHttpFetchError() convenience method

* Fix typing issue

* Fix rebase issues

* Fix incorrect import

* Avod using core internals for plugin testing

* Fix automerge issues

* Misc enhancements following PR review
2022-07-11 12:25:55 -07:00
Bree Hall
b7c4d890c0
Upgrade EUI to v58.0.0 (#132257)
* Initial commit for EUI 57.0.0 upgrade

* Handle i18n changes

* Resolved type errors in DatePicker and Markdown Editor

* Resolve test failures in Jest Test Suite #1. Updated multiple snapshots for euiLink and euiTitle as they have been converted to Emotion

* Resolved failing tests for Jest Suite #2. Updated snapshots for euiHealth, euiAvatar, euiSpacer, euiTitle, and euiLink as they have recently been converted to Emotion

* Resolved failing tests for Jest Suite 3. Updated failing snapshots as EuiSpacer, EuiText, EuiCallout, EuiHorizontalRule, EuiTitle, and EuiLink have been converted to Emotion. Updated the i18n translation snapshots

* Upgrade EUI verion to 58.0.0

* Resolved tests failures from Jest Test Suite 4. Updated snapshots as EuiLink, EuiTitle, EuiHorizontalRule, EuiSpace, and EuiCallout have been converted to Emotion

* Resolved failing test cases for Jest Test Suite 5. Updated snapshots as EuiLoader has been converted to Emotion

* Resolved failing tests in Jest Test Suite 6. Updated snapshots as EuiSpacer, EuiHorizontalRule, Eui Callout, and EuiLink have been converted to Emotion

* Resolved type errors for EuiDatePicker component

* Resolved type error within EuiContextMenu by removing the watchedItemProps prop. It was recently deprecated in EUI PR# 5880 (https://github.com/elastic/eui/pull/5880) as is no longer needed

* Resolved type error within EuiContextMenu by removing the watchedItemProps prop. It was recently deprecated in EUI PR# 5880 (https://github.com/elastic/eui/pull/5880) as is no longer needed

* Resolved type error within EuiContextMenu by removing the watchedItemProps prop. It was recently deprecated in EUI PR# 5880 (https://github.com/elastic/eui/pull/5880) as is no longer needed

* Resolved type errors by updating the popoverPlacement prop for the EuiDatePicket component with new / valid values. A list of values were deprecated and new values were added in EUI PR #5868 (https://github.com/elastic/eui/pull/5868)

* Resolved type error within EuiTabs by removing instances of display: condensed as it is no longer a part of the Amsterdam theme via EUI PR #5868(https://github.com/elastic/eui/pull/5868)

* Remove deprecated `display` prop from EuiTabs

* Deprecate `.eui-textOverflowWrap`

* Deprecate EuiSuggestItem `labelDisplay` prop

* [EuiStepsHorizontal] Replace deprecated `isComplete`/`isSelected` with `status`

* Update last EuiStepsHorizontal `status` migration

- this one was more complex than the previous commit due to existing `status` usage and conditional steps. Some amount of logic was simplified via `completedStep`

* Resolved type error within EuiTabs by removing instances of display: condensed as it is no longer a part of the Amsterdam theme via EUI PR #5868(https://github.com/elastic/eui/pull/5868)

* Resolved failing test cases in Jest Test Suite 5. Updated snapshots as EuiTitle has been converted to Emotion

* Resovlved failing test cases in Jest Test Suite 4. Updated snapshots as EuiTitle and EuiSpacer have been converted to Emotion. Resolved failing tests for EuiLink click simlulations by esuring the test is referencing the correct element.

* Resolved failing test cases in Jest Test Suite 3. Updated snapshots as EuiLink, EuiSpacr, and EuiTItle have been converted to Emotion. Updated various test cases to ensure that the references to EuiLink are correct

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

* Resolved failing test cases in Jest Test Suite 1. Updated snapshots as EUI text utilities have been converted to Emotion. Updated referenes to EuiLink to ensure test are simulating clicks on the correct elements

* Resolved failing test for Jet Test Suite 2. Updated required snapshots. Updated references to EuiLink to ensure that tests are simulating clicks on the correct elements

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

* Resolved failing test cases for Jest Test Suite 5. Updated references to EuiLink to ensure tests are targeting the correct element

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

* Resolved failing test cases across the Jest Test Suites. Updated required snaphots for components recently converted to Emotion. Updated test cases to ensure that tests targeting EuiLink are using the correct element.

* Resolved failing tests from multiple Jest test suites. Updated snapshots for components that have recently been converted to Emotion. Updated tests that reference the EuiLink component to ensure the correct element is being targeted

* Updated the getEuiStepsHorizontal function. Previously, this function used the .euiStepHorizontal-isSelected class (now deprecated) to determine which step was current. The function has been updated to use the status prop.

* Updated Jest integration test snapshots to account for the recent conversion of EuiLoader to Emotion

* Resolved failing tests in Jest suites 2 and 4. Updated required snapshots and references for tests using EuiLink

* Removed a console statement. Extracted a nested turnary operation into its own function.

* Rollback new turnary function and replace it with a simple if/else

* Rollback new turnary function and replace it with a simple if/else

* Rollback new turnary function and replace it with a simple if/else

* Rollback new turnary function and replace it with a simple if/else

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

* Resolved failing test cases in Jest Suites 3 and 5 by updating required snapshots

* revert doc_viewer_source test and snapshot changes

* Take care of merge conflict in license_checker:

* Reverted .render() change for analytics_no_data_page.component.test.tsx. Restored snapshot

* Reverted .render() change for analytics_no_data_page.component.test.tsx. Restored snapshot

Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
2022-06-08 10:18:11 -04:00
Pierre Gayvallet
a02c00b8a3
Change ContextContainer to lazily initialize providers (#129896)
* Change ContextContainer to lazily initialize providers

* Introduce CustomRequestHandlerContext, start adapting usages

* adapt IContextProvider's return type

* start fixing violations

* fixing violations - 2

* adapt home routes

* fix remaining core violation

* fix violations on core tests

* fixing more violations

* fixing more violations

* update generated doc...

* fix more violations

* adapt remaining RequestHandlerContext

* fix more violations

* fix non-async method

* more fixes

* fix another await in non async method

* add yet another missing async

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

* add yet yet another missing async

* update fleet's endpoints

* fix telemetry endpoints

* fix event_log endpoints

* fix some security unit tests

* adapt canvas routes

* adapt alerting routes

* adapt more so_tagging routes

* fix data_enhanced routes

* fix license_management routes

* fix file_upload routes

* fix index_management routes

* fix lists routes

* fix snapshot_restore routes

* fix rule_registry routes

* fix ingest_pipelines routes

* fix remote_clusters routes

* fix index_lifecycle_management routes

* improve and fix the lazy implementation

* fix triggers_actions_ui endpoints

* start fixing unit tests

* fix cases routes

* fix transform routes

* fix upgrade_assistant routes

* fix uptime route wrapper

* fix uptime route wrapper bis

* update osquery routes

* update cross_cluster_replication routes

* fix some ML routes / wrappers

* adapt maps routes

* adapt rollup routes

* fix some canvas unit tests

* fix more canvas unit tests

* fix observability wrapper

* fix (?) infra type hell

* start fixing monitoring

* fix a few test plugins

* woups

* fix yet more violations

* fixing UA  tests

* fix logstash handlers

* fix fleet unit tests

* lint?

* one more batch

* update security_solution endpoints

* start fixing security_solution mocks

* start fixing security_solution tests

* fix more security_solution tests

* fix more security_solution tests

* just one more

* fix last (?) security_solution tests

* fix timelion javascript file

* fix more test plugins

* fix transforms context type

* fix ml context type

* fix context tests

* fix securitySolution withEndpointAuthz tests

* fix features unit tests

* fix actions unit tests

* fix imports

* fix duplicate import

* fix some merge problems

* fix new usage

* fix new test

* introduces context.resolve

* down the rabbit hole again

* start fixing test type failures

* more test type failures fixes

* move import comment back to correct place

* more test type failures fixes, bis

* use context.resolve for security solution rules routes

* fix new violations due to master merge

* remove comment

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-04-22 13:15:58 +02:00
Pierre Gayvallet
813193d8c3
no longer use an enum for home's FeatureCatalogueCategory (#129599)
* no longer use an enum for home's FeatureCatalogueCategory

* use export type for `FeatureCatalogueCategory`

* fix unused import

* remove home as requiredBundle for more kibana manifests

* fix imports

* how did I mess that?

* fixing the mess, bis

* fix duplicate import

* fix some merge problems

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-04-19 13:32:25 +02:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Spencer
2ad2a4c271
[eslint] ensure that all imports are resolvable (#129002) 2022-04-04 15:37:06 -04:00
Alison Goryachev
b00ca41e38
Add execution context support for management plugins (#128415) 2022-03-31 08:40:44 -04:00
Mikhail Shustov
0393f3f261
[main] update ES client version (#126129)
* update renovate bot settings

* update es client to 8.1-canary3

* specify type explicitly when pass a serialized object

* attempt 1 in fleet.specify type explicitly when pass a serialized object

* fix the first batch of ts errors

* fix more violations

* fix unit test

* fix more violations 2

* fix more violations 3

* fix more violations 4

* review comments

Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-24 16:45:18 -07:00
Pierre Gayvallet
6627bd8b3a
Elasticsearch client: no longer default to using meta: true (#124488)
* Use `Client` interface instead of `KibanaClient`

* get rid of getKibanaEsClient and convertToKibanaClient

* get rid of last KibanaClient usages

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

* fix some violations

* add sugar method around client mock

* update SO repository calls

* adapt more core usages

* export mock types

* batch 1

* batch 2

* batch 3

* batch 4

* batch 5

* batch 6

* batch 7

* batch 8

* batch 9

* security - batch 1

* security - batch 2

* security - batch 3

* last batch of initial violations

* fix resolve_time_pattern

* update generated doc

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

* fix monitoring's getLegacyClusterShim

* fix /api/snapshot_restore/privileges route

* fix UptimeESClient

* fix transforms/_nodes endpoint

* lint

* unit test fix - batch 1

* unit test fix - batch 2

* unit test fix - batch 3

* integration test fix - batch 1

* lint

* adapt ML client

* unit test fix - batch 4

* fix uptime test helper

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

* fix ES client FTR test

* fix uptime unit test

* fix type errors on last unit tests

* fix RollupSearchStrategy call

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

* fix GET /api/index_lifecycle_management/policies route

* fix mlClient.getDataFrameAnalytics

* fix APMEventClient

* fix security solution getBootstrapIndexExists

* fix data_enhanced's getSearchStatus

* remove unused @ts-expect-error

* fix unit tests due to latest code changes

* fix more calls in security_solution routes

* fix more calls in ml routes

* fix POST /api/index_management/component_templates route

* fix unit tests due to latest changes

* fix rule_registry's ResourceInstaller.createOrUpdateIndexTemplate

* fix more fleet client calls

* fix UA's GET cloud_backup_status route

* fix createLifecycleExecutorApiTest

* fix hasFleetServers

* fix unit tests due to latest changes

* changes due to last merge

* fix ml modelProvider.getModelsPipelines

* fix security_solution LifecycleQuery.search

* fix new CoreUsageDataService usage

* fix security solution's StatsQuery.search

* improve ml FTR assertions

* fix security_solution's EventsQuery.search

* fix EsClient type as we're keeping transport

* NITs

* clean RepositoryEsClient type

* update generated doc

* review comments

* adapt mlClient.anomalySearch signature

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

* nit

* add unit tests for the client mocking functions

* fix new upgrade assistant /remote_clusters endpoint
2022-02-12 09:19:44 +01:00
Tiago Costa
a5b4b822ce
chore(NA): splits types from code on @kbn/test (#124469)
* 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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-04 03:27:39 +00:00
Sébastien Loix
20ab0ef0c3
[Rollup] Fix component integration tests (#121144) 2021-12-16 23:38:29 +00:00
Sébastien Loix
b5e8b126d8
[Stack mgt apps] Wrap all apps with KibanaThemeProvider (#120003) 2021-12-08 12:18:15 +00:00
Tiago Costa
9d662b77be
chore(NA): splits types from code on @kbn/i18n (#119256)
* chore(NA): auto creation of the package.json for the new types pkg rule

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

* chore(NA): support kbn-analytics

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

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

* chore(NA): missing todos

* chore(NA): node modules link mapping

* chore(NA): fully working pkg_npm_types rule

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

* docs(NA): remove todo

* docs(NA): last todo text correction

* chore(NA): removed commented lines

* fix(NA): include missing package version

* chore(NA): include license keys

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

* chore(NA): disable validator on ts_project rule

* chore(NA): use the wrapper for ts_project

* commit using @elastic.co

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

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

* chore(NA): update yarn.lock file

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

* chore(NA): missing import fix

* chore(NA): fix jest project configs

* chore(NA): change imports on kbn i18n

* chore(NA): change imports on kbn i18n

* chore(NA): correct loader imports

* chore(NA): missnig i18nLoader export key

* chore(NA): fix type exports

* chore(NA): export type only

* chore(NA): export type only

* fix(NA): type exports

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

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

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-24 17:18:03 +00:00
Greg Thompson
cd8c648012
Upgrade EUI to v41.0.0 (#117242)
* eui to v41.0.0

* update eui i18n tokens

* sass tokens

* EuiLoadingKibana

* EuiCodeEditor

* subdued

* betaBadgeProps

* EuiCodeEditor null-loader

* src secondary -> success

* [enterprise_search] Deprecate 'secondary' color prop

* [apm] Deprecate 'secondary' color prop

* [canvas] Deprecate 'secondary' color prop

* [cases] Deprecate 'secondary' color prop

* [cross_cluster_replication] Deprecate 'secondary' color prop

* [data_enhanced] Deprecate 'secondary' color prop

* [data_visualizer] Deprecate 'secondary' color prop

* [fleet] Deprecate 'secondary' color prop

* [index_management] Deprecate 'secondary' color prop

* [infra] Deprecate 'secondary' color prop

* [ingest_pipelines] Deprecate 'secondary' color prop

* [maps] Deprecate 'secondary' color prop

* [ml] Deprecate 'secondary' color prop

* [monitoring] Deprecate 'secondary' color prop

* [observability] Deprecate 'secondary' color prop

NB: conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified it

* [osquery] Deprecate 'secondary' color prop

* [painless_lab] Deprecate 'secondary' color prop

* [remote_clusters] Deprecate 'secondary' color prop

* [rollup] Deprecate 'secondary' color prop

* [security] Deprecate 'secondary' color prop

* [security_solution] Deprecate 'secondary' color prop

NB: several conditional became `type === 'success' ? 'success' : type` after find&replace, which felt fairly redundant, so I simplified them

* [snapshot_restore] Deprecate 'secondary' color prop

* [spaces] Deprecate 'secondary' color prop

* [transform] Deprecate 'secondary' color prop

* [triggers_actions_ui] Deprecate 'secondary' color prop

* [uptime] Deprecate 'secondary' color prop

* [watcher] Deprecate 'secondary' color prop

* [infra] replace ambiguous 'secondary' color

- GaugesSectionVis doesn't appear to use the color property but it's required by the SeriesOverrides types, so changing it just in case

* [examples] Deprecate 'secondary' color prop

* [uptime] deprecate 'subdued' prop on EuiButtonIcon

* revert EuiKeyPadMenuItem betaBadge props

* mobileOptions

* examples/ updates

* fix brace import

* fix type exports

* update expressions_explorer requiredBundles

* remove make_id mocks

* snapshot updates

* fix import 🤦

* Fix `ReferenceError: ace is not defined` Jest failures

* Remove unused brace import (?)

- Assuming here, as no code editor is actually being used in this file

* Fix failing Jest test due to EuiCodeEditor moving to es_ui_shared plugin

+ minor cleanup of `jest.mock()`s

* Fix failing Jest test due to snapshot update

* Fix failing `TypeError: Cannot read properties of undefined (reading 'euiBorderRadius')` Jest test

- since this is being mount()'d, EuiThemeProvider as a wrapper is needed to prevent the failure

* access uiSettings

* Move react-ace dependency into kbn-ui-shared-deps-npm

* Revert App Search shenanigans

- caused local unsaved changes shenanigans, somehow

* secondary -> success

Co-authored-by: Constance Chen <constance.chen.3@gmail.com>
Co-authored-by: Chandler Prall <chandler.prall@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Constance Chen <constance.chen@elastic.co>
2021-11-18 12:29:51 -06:00
Matthew Kime
1f263b8db1
[data views] copy fixes (#117967)
* rollup fixes

* copy fixes

* Update x-pack/plugins/rollup/server/plugin.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update form_schema.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-11-16 20:31:55 -06:00
Or Ouziel
f2b9acf67b
replace any with unknown in http client and types (#114265) 2021-11-02 13:53:56 +02:00
Pierre Gayvallet
106183551a
[8.0] remove kibana.index config property (#112773)
* remove kibana config

* remove kibanaConfig usages

* prettier fix

* fix some globalConfig.kibana.index access

* fix xpack_legacy globalConfig usage

* fix home globalConfig usage

* fix canvas globalConfig usage

* fix action globalConfig usage

* fix (all?) remaining usages

* fix more plugins

* fix more plugins bis

* yet more usages

* fix ml usages

* fix security_solution

* fix lens

* fix monitoring

* remove from settings docs

* move doc update

* fix unit tests

* update generated doc

* improve test

* adapt new usage in security_solution

* fix security_solution config

* fix createConfig, again

* fix mock config
2021-10-25 14:25:24 -07:00
Mikhail Shustov
c6fcde9a8b
[ES client] Rename deprecated params (#115528)
* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* rollback unnecessary changes
2021-10-20 16:46:37 +02:00
Sébastien Loix
f6a9afea61
[Stack management apps] Deprecate "enabled" Kibana setting (#114768) 2021-10-19 11:33:57 +01:00
Luke Elmers
878b1eeae9
Log deprecation warnings for plugins which won't be disable-able in 8.0 (#112602) 2021-09-22 15:58:57 -04:00
Stratoula Kalafateli
60500c20af
Move timeseries to vis_types folder (#112228)
* Move timeseries to vis_types folder

* Fix jest

* Fix types

* Fix more types

* Fix types

* fix jest tests

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-21 13:45:49 +03:00
Tyler Smalley
4681a80317
[DX] Upgrade prettier to v2.4.0 (#112359)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-09-19 22:34:30 -07:00
Spencer
2976f33618
[eslint] add rule to forbid async forEach bodies (#111637)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-09-14 13:20:53 -07:00
Dzmitry Lemechko
b324ca3115
[jest] update config files to get coverage per plugin (#111299)
* [jest] update config files to get coverage per plugin

* [docs] add details about plugin coverage collection

* fix path for newsfeed jest config

* fix lint error

* update documentation

* fix lint errors again

* update doc

* fix another lint error

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

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

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

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

* [kibana_legacy] fix path

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-09-09 08:14:56 +02:00