Commit graph

6742 commits

Author SHA1 Message Date
Alexey Antonov
9ee5741134
fix: [Analytics:Discover page]Elements missing title from announcement (#217821)
Closes: #214335

**Description**
Dialog modal, flyout, field visible title should be announced for the
users, especially using assistive technology to know what dialog modal,
flyout opened, what field is active and what is needed to enter in it.

**Changes made:**
1. Added `aria-labelledby={flyoutTitleId}` for mentioned places
2025-04-15 17:33:40 -06:00
Alex Szabo
a1a0d3462d
[ci] increase inspector limit to allow for recent updates (#218053)
## Summary
It seems there's been some sort of unintended bundle limit branch
through 2 minor changes (greenlit separately on PRs) - and this one
broke the camel's back: https://github.com/elastic/kibana/pull/212163
2025-04-14 10:56:32 +02:00
Marco Liberati
6984530aa0
[Expression] Cached expression can keep their own side effects (#216519)
## Summary

Fixes the #207204 

This PR introduces a new complementary function for an Expression
definition named `sideEffects`, this goes together with the other `fn`
function and it is used to restore any side effect when the caching
system kicks in.


![side_effects_cache](https://github.com/user-attachments/assets/74b1ddff-a45c-4983-ac09-57559155fba8)

I haven't found how to programmatically test this.
Will add an FTR if it can be reliable to reproduce an expression caching
scenario.

### 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

### Release notes

The request inspector now shows the correct request and response in any
successful scenario.
2025-04-11 14:50:47 +02:00
Tiago Vila Verde
1bf39845da
[Entity Analytics][Privilege Monitoring] Engine initialization API (#215663)
## Summary 

This PR introduces the first building blocks for the [Entity Analytics
Privileged
Monitoring](https://github.com/elastic/security-team/issues/9971).
We follow the approach used in the Entity Store and add a new "Engine",
which consists of the following components:
* Public API
  * INIT and HEALTH routes
* Kibana task 
* Privilege Monitoring Data Client
* Engine Saved Object
* API key manager
* Related storage indices
* Feature Flag: `privilegeMonitoringEnabled` set to `false` by default.
* API integration test configuration
  * only tests that the health endpoint is available
* Auditing and Telemetry 


## Testing steps

1. Make sure to add `privilegeMonitoringEnabled` to your
`kibana.dev.yaml`
2. In devtools, ensure the API is working with `GET
kbn:/api/entity_analytics/monitoring/privileges/health`
3. Start the engine with: `POST
kbn:/api/entity_analytics/monitoring/engine/init`
4. Look for `DEBUG` logs mentioning the
`entity_analytics:monitoring:privileges:engine` task

---------

Co-authored-by: CAWilson94 <charlotte.wilson@elastic.co>
Co-authored-by: Charlotte Alexandra Wilson <CAWilson94@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-11 13:25:24 +02:00
Jill Guyonnet
79058c6529
[Fleet] Sync uninstalled integrations on remote clusters (#217144)
## Summary

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

This PR adds a setting to remote ES outputs for also uninstalling
integrations on remote clusters when integrations sync is enabled.

This new setting can be toggled in the UI with a new switch:

<img width="1728" alt="Screenshot 2025-04-09 at 11 53 43"
src="https://github.com/user-attachments/assets/34544aa9-28fd-4360-a32f-5031e3d4293f"
/>

### Testing

* Follow the steps in
https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/dev_docs/local_setup/remote_clusters_ccr.md
to set up two clusters with integrations syncing.
* Add some integrations in your main cluster and check that they are
also installed in the remote cluster.
* Disable uninstalling integrations on remote.
* Remove an integration in your main cluster and check that it is NOT
removed from the remote cluster.
* Enable uninstalling integrations on remote.
* Remove an integration in your main cluster and check that it is also
removed from the remote cluster.
* In your remote cluster, enroll an agent onto a policy that points to
at least 1 package policy of the installed integrations (cf. Docker
commands below if using dockerized fleet-server/agent).
* In your main cluster, uninstall the integration that is used by the
agent policy in the remote. This should cause the uninstall to fail into
the remote cluster.
* In your remote cluster, inspect the package SO of that integration
with `GET .kibana_ingest/_search?q=type:epm-packages`: the
`latest_uninstall_failed_attempts` field should be populated.

Docker command for running a fleet-server in your remote cluster:
```
docker run \
    -e ELASTICSEARCH_HOST=http://host.docker.internal:9500 \
    -e KIBANA_HOST=http://host.docker.internal:5701/<path> \
    -e KIBANA_USERNAME=elastic \
    -e KIBANA_PASSWORD=changeme \
    -e KIBANA_FLEET_SETUP=1 \
    -e FLEET_INSECURE=1 \
    -e FLEET_SERVER_ENABLE=1 \
    -e FLEET_SERVER_POLICY_ID=fleet-server-policy \
    -p 8220:8220 \
    --rm docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT
```

Docker command for enrolling an agent in your remote cluster:
```
docker run \
    -e ELASTICSEARCH_HOST=http://host.docker.internal:9500 \
    -e KIBANA_HOST=http://host.docker.internal:5701/<path> \
    -e FLEET_URL=https://host.docker.internal:8220 \
    -e FLEET_ENROLL=1 \
    -e FLEET_ENROLLMENT_TOKEN=<token> \
    -e FLEET_INSECURE=1 \
    --rm docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT
```

### 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/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

This feature is currently in development and behind the
`enableSyncIntegrationsOnRemote` feature flag.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-10 08:36:15 -07:00
Coen Warmer
46b4e1fc6d
Add support for wrapping elements in eslint-plugin-eui-a11y plugin (#216339)
## Summary

Adds support for wrapping elements.

| Code | Turns into |
|--------|--------|
| <img width="764" alt="Screenshot 2025-04-01 at 09 25 09"
src="https://github.com/user-attachments/assets/9b5d2743-3b61-4d21-b726-0a0be9539d99"
/> | <img width="827" alt="Screenshot 2025-04-01 at 09 25 20"
src="https://github.com/user-attachments/assets/9879d1cb-e22f-4c80-a666-001b273d6d7d"
/>
| <img width="744" alt="Screenshot 2025-04-01 at 09 25 54"
src="https://github.com/user-attachments/assets/c4320ff8-baa2-4fcc-9b3c-f7ab86c1cb23"
/> | <img width="838" alt="Screenshot 2025-04-01 at 09 26 07"
src="https://github.com/user-attachments/assets/d81a1232-a643-4775-ac83-a1a97bcbc528"
/> |

**Message**
<img width="804" alt="Screenshot 2025-03-25 at 13 59 36"
src="https://github.com/user-attachments/assets/8eaa2f54-aee6-4828-b1d5-15d4d2bfb4c0"
/>

**Exceptions**
If elements have a `aria-label`, `aria-labelledby` or `label`, they are
not flagged.

**Autofix suggestion**
- autofixes are translated with `i18n.translate`
- if `i18n` is not imported yet, an import statement is added
- If a `placeholder` prop is found, it uses that as the `i18n.translate`
default message for `aria-label`
- If the element has children, it uses the text value of the children as
the default message for the `i18n.translate` default message for
`aria-label`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Milosz Marcinkowski <38698566+miloszmarcinkowski@users.noreply.github.com>
2025-04-09 18:16:00 +02:00
Robert Oskamp
e710e98fe0
[workchat] Initial FTR test setup (#216828)
## Summary

This PR adds the structure for workchat FTR tests and adds a few initial
tests as an example.

### Details about initially added tests

New test directories:
- `x-pack/test_serverless/api_integration/test_suites/chat`
  - load a few common tests (that run on all project types)
- run `platform` security tests (taken over from `search` project type)
- `x-pack/test_serverless/functional/services/svl_chat_navigation.ts`
  - load the `home page` common test
- run a simple navigation test, using the `svlChatNavigation` service
that has been introduced as an example

Note that these tests mostly serve as examples to prove things are
actually running and will have to be adjusted / removed / extended over
time. The purpose of this PR is NOT to add proper test coverage.

Closes #213469

---------

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2025-04-09 10:31:12 +02:00
Melissa Alvarez
f51ac13197
[ML] Moves job and trained model management features into Stack Management (#204290)
## Summary

Updates the navigation for Machine Learning pages, moving admin tasks
for managing ML jobs and models to a single place inside Stack
Management, and leaving exploratory tasks in a consolidated top-level
Machine Learning menu.

The available items vary by solution, so that the navigation for an
Elasticsearch project, for example, contains a single item for managing
trained models.

#### Stack management menu for classic/observability/security nav
<img width="275" alt="Screenshot 2025-04-04 at 16 10 04"
src="https://github.com/user-attachments/assets/14b6e8d4-7111-4fbd-ae5d-9f389f83f23c"
/>

#### Stack management for search:
<img width="271" alt="Screenshot 2025-04-07 at 14 38 45"
src="https://github.com/user-attachments/assets/e104bf20-8a4d-4eed-9b5b-9c05944091ca"
/>


#### Machine Learning menu for Classic nav
<img width="341" alt="Screenshot 2025-04-07 at 14 22 03"
src="https://github.com/user-attachments/assets/610efd59-311f-410f-9881-548359ca7997"
/>


#### Machine Learning menu for Observability
<img width="522" alt="Screenshot 2025-04-04 at 16 11 48"
src="https://github.com/user-attachments/assets/ef16acf1-4d39-4494-a5d3-0fb078d74730"
/>


#### Machine Learning menu for Security
<img width="528" alt="Screenshot 2025-04-04 at 17 46 43"
src="https://github.com/user-attachments/assets/2df20c20-b894-4421-a732-9370bb5d6f2d"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: Quynh Nguyen <quynh.nguyen@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2025-04-08 19:52:16 +02:00
Dominique Clarke
9d56263413
[Chore] Remove Investigate plugin, Investigate app plugin, and Investigation-schema package (#216342)
## Summary

Removes unused code from the Investigate and Investigate app plugin.

Removes all references to those plugins in storybook, i18n, types, etc.

Removes codeowner requirements for those plugins

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-08 12:25:21 -04:00
Tim Sullivan
ef907a32f2
[Security Solution] Use static declaration for navigation hierarchy (#215969)
## Summary

Part of Epic: https://github.com/elastic/kibana-team/issues/1439
Addresses https://github.com/elastic/kibana/issues/212903, but does not
remove the landing page access. The landing page access will be removed
in https://github.com/elastic/kibana/pull/210893

**Changes**
1. Converts the declaration of the Security Solution side navigation for
serverless and stateful projects into a static declaration, rather than
algorithmically parsing registered links to dynamically build the
declaration.
2. Updates the contents of the "Assets" panel to prepare for removal of
that landing page.
3. Eliminates the top-level nesting of the nav items, which removes the
extra space between the project title and the first nav items. See
45454bdc4d

**Known issue**: Clicking the "Browse integrations" button does not
close the secondary nav panel. Doing that will be a relatively simple
chore, but will require some changes in the SharedUX chrome-navigation
package, as well as the `LinkButton` component in the Security Solution
navigation-links package.

### Screenshots
Serverless

![static-nav-declaration-security-serverless-3iorteikghiskhgkseh](https://github.com/user-attachments/assets/47bcbea9-7e3c-481e-b1b8-4b13bb5d63b1)

Stateful/ECH

![static-nav-declaration-security-stateful-3iorteikghiskhgkseh](https://github.com/user-attachments/assets/3d3c8a0e-95d1-4da7-a657-c824577b6ec1)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-03 08:38:04 -07:00
Weronika Olejniczak
7e46d2e756
chore: update eslint-plugin-eui to 0.1.1 (#210082)
## Summary

Bring in the changes from https://github.com/elastic/eui/pull/8304,
specifically ESLint rules:

- `no-restricted-eui-imports`
- `no-css-color` (migrated from `@kbn/eslint-plugin-css`)
- `prefer-css-attribute-for-eui-components` (migrated from
`@kbn/eslint-plugin-css`)

Relates to https://github.com/elastic/eui/issues/8201,
https://github.com/elastic/eui-private/issues/275

## QA

### Instructions

1. Checkout this branch: `gh pr checkout 210082`.
2. Reinstall dependencies: `yarn kbn bootstrap`.
3. See output of ESLint. There should be no errors.
4. Test below cases.

### Test cases

#### `no-restricted-eui-imports`

Example files:

- JSON imports: `src/platform/packages/shared/kbn-ui-theme/src/theme.ts`
- `@kbn/ui-theme`:
`src/platform/plugins/private/vis_types/vega/public/data_model/utils.ts`

#### `no-css-color`

Example file:
`src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx:50`

![Screenshot 2025-02-26 at 15 01
53](https://github.com/user-attachments/assets/ec6f49bd-5832-4d1c-9cfd-74c40ad5498e)

#### `prefer-css-attribute-for-eui-components`

Example file:
`x-pack/examples/alerting_example/public/alert_types/always_firing.tsx:166`
2025-04-02 14:06:17 +02:00
Pierre Gayvallet
c05dda37e2
[workchat] reintegrate into main (#215627)
## Summary

~**DO NOT MERGE:** depends on
https://github.com/elastic/kibana/issues/213468~

This PR reintegrates the work from the `workchat_m1` branch into `main`:

- introduces a 4th solution type, `chat`, that will be used for the
*WorkChat* project type.
- edit things in various platform code to introduce/handle that new
project type
- add plugins and packages for the workchat app. 

### To AppEx reviewers:

File change count is scary, but you can safely ignore anything from
`xpack/solutions/chat` (given it's solution code), and focus on your
owned changes, which are way more reasonable

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe McElroy <joseph.mcelroy@elastic.co>
Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
Co-authored-by: Jedr Blaszyk <jedrazb@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Meghan Murphy <meghan.murphy@elastic.co>
2025-04-02 11:00:32 +01:00
Marta Bondyra
dc1d36b50b
[Markdown] migrate scss to emotion (#216351)
## Summary

Part of https://github.com/elastic/kibana/issues/207852
Migrates markdown to emotion.
2025-03-31 22:35:13 +02:00
Marta Bondyra
a7142c0d7b
[Inspector] Migrate scss to emotion (#216195)
## Summary

Part of https://github.com/elastic/kibana/issues/207852 for inspector.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-28 16:01:35 +01:00
Elena Shostak
7a41906d88
[Authz] Mandatory Security Config (#215180)
## Summary

This PR makes `security` a required field for route registration. To
incorporate the new required filed, changes has been made:

1. **Test file updates**. A lot of the updates made in this PR were made
in tests.
2. **Versioned route security configuration**. For the versioned route
`security` config has been lifted up to the top-level definition:

    Before
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
      });
    ```
    
    After
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
      });
    ```

3. **Type adjustments for route wrappers**. Type changes has been made
in:
-
`x-pack/solutions/observability/plugins/infra/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts`
-
`x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts`

Security was made an optional field for the wrappers defined in those
files, since the default security is provided in the wrapper itself and
then passed down to the core router.

### 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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)


__Closes: https://github.com/elastic/kibana/issues/215331__

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 12:04:53 -07:00
Nathan Reese
3bc1465365
[unified search] optimize async chunk loading (#214483)
PR reduces unifiedSearch chunks into ui chunk, action chunk, and a
autocomplete chunk.

### Before
<img width="350" alt="Screenshot 2025-03-14 at 8 47 10 AM"
src="https://github.com/user-attachments/assets/f54fe21e-7548-48a1-8874-e36377826701"
/>

### After
The second chunk request is because search bar loads KQL suggestions.
This will be addressed in a follow up PR and the search bar will lazy
load suggestions only when interacted with.
<img width="350" alt="Screenshot 2025-03-14 at 12 56 28 PM"
src="https://github.com/user-attachments/assets/8f23ee56-a57a-489b-aeab-caa30f739d03"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-26 18:39:58 -06:00
Coen Warmer
54add717b6
Create eslint-plugin-eui-a11y plugin (#215859)
## Summary

This adds an additional custom ESLint rule package which checks certain
Eui elements for the existence of an `aria-label` prop.

If it exists, it will leave it untouched. If it doesn't, it will warn
the engineer it needs to be added, and offers a autofix suggestion for
those engineers who have fix on save enabled in their IDE.

<img width="739" alt="Screenshot 2025-03-25 at 13 59 28"
src="https://github.com/user-attachments/assets/0813b317-c752-40d7-b569-e866a3ecf6b0"
/>

<img width="804" alt="Screenshot 2025-03-25 at 13 59 36"
src="https://github.com/user-attachments/assets/3c45c49c-6db8-4740-b5de-89aa534c248b"
/>

This package is an offshoot of the `kbn-eslint-plugin-i18n` and
`kbn-eslint-plugin-telemetry` packages.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 23:00:31 +02:00
Jiawei Wu
f0c33547ef
[Response Ops][Task Manager] Task Schema Changes for User Scoped Tasks (#215431)
## Summary

Resolves: https://github.com/elastic/kibana/issues/190661
Related: https://github.com/elastic/kibana/pull/205577

This PR contains the schema changes for
https://github.com/elastic/kibana/pull/205577, which is needed for an
intermediate release allowing for backwards compatibility.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 20:44:46 +02:00
Ievgen Sorokopud
760b0cfca3
[Security Solution] Move rule actions field and its validation into the common folder (#215494)
## Summary

With this PR we make `RuleActionsField` component and relevant
validations reusable outside of and not bound to the rules management.

As part of the Attack Discovery Scheduling
[feature](https://github.com/elastic/security-team/issues/10142) we
would like to be able to setup schedules (similar to detection rules,
just named differently within the feature space) and be able to add
actions (email, slack, webhook etc.).

Currently `RuleActionsField` lives inside the
`x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/`
folder. We could just reference it from within the Attack Discovery
folder, but for better code structure it will be good to put it into a
common place.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
-
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8075

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-25 20:50:08 +01:00
Philippe Oberti
4b28464520
[Security Solution] Move files from detections folder to detection_engine folder (#215085)
## Summary

This PR is - at its core - only moving a handful of files around. A lot
of of these files lived under the `detections` folder, but were almost
exclusively used in files under the `detection_engine` folder. This is
why the PR seems so huge. Almost everything modified here is only files
imports...

Here are the few files that were actually moved around:

1. The files `detection_engine.tsx`, `detection_engine_no_index.tsx`,
`detection_engine_user_unauthenticated.tsx` (and their respective test
files) have been moved from
`security_solution/public/detections/pages/detection_engine` to
`security_solution/public/detections/pages/alerts`. I thought about
renaming them as well, but felt like there was already enough changes.
Renaming will be done in a follow up PR.

2. The content of the
`security_solution/public/detections/pages/detection_engine/rules`
folder was moved to `security_solution/public/detection_engine/common`
as almost the entire folder content is only used within the
`security_solution/public/detection_engine` folder.

#### Notes

_If there is a better folder for the files moved to the
`detection_engine/common` folder, feel free to suggest. I'll be happy to
make the change!_

The CODEOWNERS file has been updated and simplified accordingly.

Only imports should have been modified. No code, logic or UI changes!

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-25 08:51:50 -05:00
Alex Szabo
e40b17aa22
Disable allowAbsoluteUrls for axios (#215138)
## Summary
After https://github.com/elastic/kibana/pull/214843, `axios` client
usages need to set a flag to prevent the vulnerable behavior.

To reviewers: if you think it's a mistake, and you created a client to
request for absolute URLs, consider unsetting the `baseURL` to
communicate intent.
2025-03-25 09:52:36 +01:00
Efe Gürkan YALAMAN
62f8027c57
[Query Rules]Query rules UI plugin (#215029)
## Summary

Adds Query Rules UI Plugin. It is disabled and pretty much empty as we
want to split the implementation in multiple parts and enable the
feature once implementation is done.

It is disabled for Security.
It is disabled for Observability.
It is enabled but behind a feature flag for Search while it is not
useful to enable it with partial implementations.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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/src/platform/packages/shared/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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-03-21 15:19:25 +01:00
Umberto Pepato
4aab9d4c48
[ResponseOps][Alerts] Create embeddable alerts table plugin (#213909)
## Summary

Creates a wrapper plugin around the alerts table, that registers a basic
alerts table embeddable panel for dashboards.

> [!NOTE]
> This PR is a preparation work for the [embeddable alerts
table](https://github.com/elastic/kibana/issues/197483). The feature is
disabled for end-users while waiting for other dependent PRs to be
integrated with this, and uses a partially hard-coded table
configuration for testing purposes. The final panel will be fully
configurable by the user.

## Verification steps

1. Uncomment this line

4d49e98b4d/x-pack/platform/plugins/shared/embeddable_alerts_table/public/plugin.ts (L34)
(I'm using a comment to avoid polluting the embeddable examples app with
this panel for a short time)
2. Create one or more ES Query rules that fire alerts
3. Visit the Dashboards page and create a dashboard, then enter edit
mode
4. Click "Add panel"
5. Under "Visualizations" choose "Alerts table"
6. Check that the table panel was created correctly
6.1. Shows any alerts fired by the ES Query rule(s)
6.2. Check that the table adapts correctly to the panel when resizing,
and all normal interactions with the alerts table work correctly
(adding/removing fields, opening alerts in flyouts, using row/bulk
actions)
6.3. Check that panels respond to the global time filter (only time
filters, not KQL search or filters)
6.4. Check that panels respond to individual time filters (⛭ icon >
Apply custom time range)
11. Create a role with access to dashboards but without any alerting
capability and a user assigned to that role
12. Repeat steps 3 and 4, and verify that the "Alerts table" option
isn't available under "Visualizations"
13. Add any alerting capability to the role, such as Management > Stack
rules
14. Repeat steps 3 and 4, and verify that the "Alerts table" is
available again

## References

Closes #203611

### Checklist

- [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/src/platform/packages/shared/kbn-i18n/README.md)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-21 12:02:54 +02:00
Gerard Soldevila
adb4bdf8d8
SKA: Extract list of Kibana solutions into a dedicated package (#213353)
## Summary

The intent is to have a centralised place to store the list of Kibana
solutions and serverless project types.
To that end, this PR creates a `@kbn/projects-solutions-groups` package.
It also adds the new solution type `'chat'`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-20 10:20:07 +01:00
Gonçalo Rica Pais da Silva
54d9cf45cb
[Discover][APM] Refactor APM sources for better trace enablement (#212634)
## Summary

This PR reworks how APM handles getting its sources data, elevating the
necessary code to a private shared plugin so that Discover for Traces
can access the data and handle user provided configuration. It also
removes the need for Discover for Traces to rely on the APM static data
view, so the Trace data source and document profile will work on any
compatible/configured index, even in ESQL mode.

Closes #211414

<img alt="ESQL Discover Traces Screenshot 2025-03-04 173032"
src="https://github.com/user-attachments/assets/f5bbb736-8b8b-45dc-ac23-4bf7083aa47e"
/>

## How to test

Test with olbt-cli instance for now, will post for doing with synthtrace
data. Ensure the following is added to your kibana.dev.yml:

```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
```

- Make sure your space has the Observability solution view configured
- Go to Discover page
- Select Data Views mode if required and create a view with a `traces`
specific index. Or use the APM static data view.
- The default columns on the page should show the summary column with
four of the following badges: `service.name`, `event.outcome`,
`transaction.name`, `transaction.duration.us`, `span.name`,
`span.duration.us`
- Go to ESQL mode with the query targetting a `traces` index
- The default columns should show the same as in Data View mode

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
2025-03-19 15:52:30 +01:00
Alex Szabo
702c9c49dc
[CI] Only emit .d.ts when running typecheck (#209259)
## Summary
Stop emitting any `.js` files during typechecking. We only depend on the
declarations, not the emitted, compiled javascript files.

An added benefit, is making some bad import errors more obvious.  
We'll no longer try to build javascript files in place if a poor
import/require is made, rather the error of importing outside projects
(in the forest of a bunch of errors possibly) will be visible in the
typescript logs:
```
# instead of:
proc [tsc] error TS5055: Cannot write file '/opt/buildkite-agent/builds/bk-agent-prod-gcp-1741789017236110254/elastic/kibana-pull-request/kibana/src/platform/packages/shared/kbn-babel-register/cache/no_cache_cache.js' because it would overwrite input file.

# we'll see:
... several others like this
 proc [tsc] src/platform/packages/shared/kbn-grok-ui/scripts/generate_patterns.js:10:9 - error TS6307: File '/Users/alex/Git/elastic-kibana/src/setup_node_env/index.js' is not listed within the file list of project '/Users/alex/Git/elastic-kibana/src/platform/packages/shared/kbn-grok-ui/tsconfig.type_check.json'. Projects must list all files or use an 'include' pattern.
 proc [tsc] 
 proc [tsc] 10 require('../../../../../setup_node_env');
... several others like this
```
2025-03-18 11:48:14 +01:00
Gerard Soldevila
355a834659
SKA: Relocate /test to /src/platform/test (#210956)
## Summary

Part of https://github.com/elastic/kibana-team/issues/1503

This is a first step towards the relocation of all the Kibana tests.

The `/test/` folder at the root, which is in itself a package
(`@kbn/test-suites-src`), and contains a large number of tests and test
plugins, is being relocated under `src/platform/test`.

All the tests under this folder should be related to common platform
features, and they should not have any dependency towards
solution-specific components or features.

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

```
src/platform/test/analytics/plugins/analytics_ftr_helpers/jest.config.js:12
src/platform/test/analytics/plugins/analytics_ftr_helpers/package.json:10
src/platform/test/analytics/plugins/analytics_ftr_helpers/package.json:11
src/platform/test/analytics/plugins/analytics_ftr_helpers/tsconfig.json:11
src/platform/test/analytics/plugins/analytics_ftr_helpers/tsconfig.json:2
src/platform/test/analytics/plugins/analytics_plugin_a/package.json:10
src/platform/test/analytics/plugins/analytics_plugin_a/package.json:11
src/platform/test/analytics/plugins/analytics_plugin_a/tsconfig.json:10
src/platform/test/analytics/plugins/analytics_plugin_a/tsconfig.json:2
src/platform/test/api_integration/jest.config.js:12
src/platform/test/common/plugins/newsfeed/tsconfig.json:2
src/platform/test/common/plugins/otel_metrics/tsconfig.json:2
src/platform/test/functional/jest.config.js:12
src/platform/test/harden/child_process.js:13
src/platform/test/harden/lodash_template.js:13
src/platform/test/harden/prototype.js:10
src/platform/test/health_gateway/plugins/status/tsconfig.json:2
src/platform/test/interactive_setup_api_integration/plugins/test_endpoints/tsconfig.json:2
src/platform/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json:11
src/platform/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json:12
src/platform/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json:11
src/platform/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json:2
src/platform/test/node_roles_functional/plugins/core_plugin_initializer_context/package.json:11
src/platform/test/node_roles_functional/plugins/core_plugin_initializer_context/package.json:12
src/platform/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json:2
src/platform/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json:9
src/platform/test/package/Vagrantfile:2
src/platform/test/plugin_functional/README.md:40
src/platform/test/plugin_functional/plugins/app_link_test/package.json:11
src/platform/test/plugin_functional/plugins/app_link_test/package.json:12
src/platform/test/plugin_functional/plugins/app_link_test/tsconfig.json:10
src/platform/test/plugin_functional/plugins/app_link_test/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_app_status/package.json:11
src/platform/test/plugin_functional/plugins/core_app_status/package.json:12
src/platform/test/plugin_functional/plugins/core_app_status/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_app_status/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_a/package.json:11
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_a/package.json:12
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_a/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_a/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_b/package.json:11
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_b/package.json:12
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_b/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_dynamic_resolving_b/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_history_block/package.json:11
src/platform/test/plugin_functional/plugins/core_history_block/package.json:12
src/platform/test/plugin_functional/plugins/core_history_block/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_history_block/tsconfig.json:6
src/platform/test/plugin_functional/plugins/core_http/package.json:11
src/platform/test/plugin_functional/plugins/core_http/package.json:12
src/platform/test/plugin_functional/plugins/core_http/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_http/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_a/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_a/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_a/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_plugin_a/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_appleave/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_appleave/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_b/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_b/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_b/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_plugin_b/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_chromeless/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_chromeless/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_deep_links/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_deep_links/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_deprecations/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_deprecations/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json:11
src/platform/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_execution_context/package.json:10
src/platform/test/plugin_functional/plugins/core_plugin_execution_context/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_helpmenu/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json:8
src/platform/test/plugin_functional/plugins/core_plugin_static_assets/package.json:11
src/platform/test/plugin_functional/plugins/core_plugin_static_assets/package.json:12
src/platform/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json:2
src/platform/test/plugin_functional/plugins/core_provider_plugin/package.json:11
src/platform/test/plugin_functional/plugins/core_provider_plugin/package.json:12
src/platform/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json:10
src/platform/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json:2
src/platform/test/plugin_functional/plugins/data_search/package.json:10
src/platform/test/plugin_functional/plugins/data_search/package.json:9
src/platform/test/plugin_functional/plugins/data_search/tsconfig.json:2
src/platform/test/plugin_functional/plugins/data_search/tsconfig.json:8
src/platform/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json:10
src/platform/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json:9
src/platform/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json:2
src/platform/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json:8
src/platform/test/plugin_functional/plugins/eui_provider_dev_warning/package.json:11
src/platform/test/plugin_functional/plugins/eui_provider_dev_warning/package.json:12
src/platform/test/plugin_functional/plugins/eui_provider_dev_warning/tsconfig.json:10
src/platform/test/plugin_functional/plugins/eui_provider_dev_warning/tsconfig.json:2
src/platform/test/plugin_functional/plugins/hardening/package.json:11
src/platform/test/plugin_functional/plugins/hardening/package.json:12
src/platform/test/plugin_functional/plugins/hardening/tsconfig.json:12
src/platform/test/plugin_functional/plugins/hardening/tsconfig.json:2
src/platform/test/plugin_functional/plugins/index_patterns/package.json:11
src/platform/test/plugin_functional/plugins/index_patterns/package.json:12
src/platform/test/plugin_functional/plugins/index_patterns/tsconfig.json:10
src/platform/test/plugin_functional/plugins/index_patterns/tsconfig.json:2
src/platform/test/plugin_functional/plugins/kbn_sample_panel_action/package.json:11
src/platform/test/plugin_functional/plugins/kbn_sample_panel_action/package.json:12
src/platform/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json:10
src/platform/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json:2
src/platform/test/plugin_functional/plugins/kbn_top_nav/package.json:11
src/platform/test/plugin_functional/plugins/kbn_top_nav/package.json:12
src/platform/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json:11
src/platform/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json:2
src/platform/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json:11
src/platform/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json:12
src/platform/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json:10
src/platform/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json:2
src/platform/test/plugin_functional/plugins/management_test_plugin/package.json:11
src/platform/test/plugin_functional/plugins/management_test_plugin/package.json:12
src/platform/test/plugin_functional/plugins/management_test_plugin/tsconfig.json:10
src/platform/test/plugin_functional/plugins/management_test_plugin/tsconfig.json:2
src/platform/test/plugin_functional/plugins/rendering_plugin/package.json:11
src/platform/test/plugin_functional/plugins/rendering_plugin/package.json:12
src/platform/test/plugin_functional/plugins/rendering_plugin/tsconfig.json:11
src/platform/test/plugin_functional/plugins/rendering_plugin/tsconfig.json:2
src/platform/test/plugin_functional/plugins/saved_object_export_transforms/package.json:11
src/platform/test/plugin_functional/plugins/saved_object_export_transforms/package.json:12
src/platform/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json:2
src/platform/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json:9
src/platform/test/plugin_functional/plugins/saved_object_import_warnings/package.json:11
src/platform/test/plugin_functional/plugins/saved_object_import_warnings/package.json:12
src/platform/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json:11
src/platform/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json:2
src/platform/test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type/package.json:11
src/platform/test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type/package.json:12
src/platform/test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type/tsconfig.json:2
src/platform/test/plugin_functional/plugins/saved_objects_hidden_from_http_apis_type/tsconfig.json:9
src/platform/test/plugin_functional/plugins/saved_objects_hidden_type/package.json:11
src/platform/test/plugin_functional/plugins/saved_objects_hidden_type/package.json:12
src/platform/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json:2
src/platform/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json:9
src/platform/test/plugin_functional/plugins/session_notifications/package.json:11
src/platform/test/plugin_functional/plugins/session_notifications/package.json:12
src/platform/test/plugin_functional/plugins/session_notifications/tsconfig.json:11
src/platform/test/plugin_functional/plugins/session_notifications/tsconfig.json:2
src/platform/test/plugin_functional/plugins/telemetry/package.json:11
src/platform/test/plugin_functional/plugins/telemetry/package.json:12
src/platform/test/plugin_functional/plugins/telemetry/tsconfig.json:2
src/platform/test/plugin_functional/plugins/telemetry/tsconfig.json:6
src/platform/test/plugin_functional/plugins/ui_settings_plugin/package.json:11
src/platform/test/plugin_functional/plugins/ui_settings_plugin/package.json:12
src/platform/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json:2
src/platform/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json:8
src/platform/test/plugin_functional/plugins/usage_collection/package.json:11
src/platform/test/plugin_functional/plugins/usage_collection/package.json:12
src/platform/test/plugin_functional/plugins/usage_collection/tsconfig.json:11
src/platform/test/plugin_functional/plugins/usage_collection/tsconfig.json:2
src/platform/test/server_integration/plugins/status_plugin_a/package.json:10
src/platform/test/server_integration/plugins/status_plugin_a/package.json:11
src/platform/test/server_integration/plugins/status_plugin_a/tsconfig.json:2
src/platform/test/server_integration/plugins/status_plugin_a/tsconfig.json:9
src/platform/test/server_integration/plugins/status_plugin_b/package.json:10
src/platform/test/server_integration/plugins/status_plugin_b/package.json:11
src/platform/test/server_integration/plugins/status_plugin_b/tsconfig.json:2
src/platform/test/server_integration/plugins/status_plugin_b/tsconfig.json:9
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-14 16:57:23 +00:00
Cristina Amico
2105648730
[Fleet] Tweak new SSL settings (#214060)
## Summary

Follow up of https://github.com/elastic/kibana/pull/208091,
https://github.com/elastic/kibana/pull/213211 and
https://github.com/elastic/kibana/pull/213211

Small UI enhancements to the SSL options introduced with the mentioned
PRs
- All the forms are now nested under an accordion to avoid taking too
much space

<details>
  <summary>Fleet server hosts</summary>
  
<img width="804" alt="Screenshot 2025-03-12 at 11 38 01"
src="https://github.com/user-attachments/assets/5835811a-6a22-470e-9e74-6dfc78761d8b"
/>
<img width="806" alt="Screenshot 2025-03-12 at 11 38 11"
src="https://github.com/user-attachments/assets/865f02b0-ec36-489f-904c-97c91a29ffca"
/>
<img width="787" alt="Screenshot 2025-03-12 at 11 51 39"
src="https://github.com/user-attachments/assets/494e20b7-a44b-45e9-aead-c7d51260da72"
/>
<img width="795" alt="Screenshot 2025-03-12 at 11 51 51"
src="https://github.com/user-attachments/assets/ba0abb37-0142-4ae1-ab5f-f2af96602c7a"
/>
</details>

<details>
  <summary>Agent Binary source</summary>

<img width="801" alt="Screenshot 2025-03-12 at 11 39 38"
src="https://github.com/user-attachments/assets/915b4ed9-d23d-4764-9805-aef5cce5798e"
/>
<img width="801" alt="Screenshot 2025-03-12 at 11 39 44"
src="https://github.com/user-attachments/assets/ea0347fb-a1fa-4454-b296-a132dffe6611"
/>

</details>

<details>
  <summary>ES Outputs</summary>
<img width="801" alt="Screenshot 2025-03-12 at 11 38 30"
src="https://github.com/user-attachments/assets/7ae7fdd4-f693-4d12-bb7e-79ddee2c6c3b"
/>
<img width="803" alt="Screenshot 2025-03-12 at 11 38 36"
src="https://github.com/user-attachments/assets/179463c2-9cbb-4dec-8f80-44c08a53073d"
/>

</details>

<details>
  <summary>Remote ES Outputs</summary>
<img width="802" alt="Screenshot 2025-03-12 at 11 46 39"
src="https://github.com/user-attachments/assets/b1f151a9-433a-4699-8aec-79f8174d069f"
/>
</details>
<details>
  <summary>Logstash Outputs</summary>
<img width="803" alt="Screenshot 2025-03-12 at 11 39 25"
src="https://github.com/user-attachments/assets/1f4da34c-ba2a-47e8-a258-61d943e9af7a"
/>

</details>


### 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/src/platform/packages/shared/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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2025-03-14 11:34:26 +00:00
Cristina Amico
382630ecd1
[Fleet] Add ssl fields to agent binary source settings (#213211)
closes https://github.com/elastic/kibana/issues/207324
follow up of https://github.com/elastic/kibana/issues/207322

## Summary
Add ssl fields to agent binary source settings. The new fields allow
users to set a TLS connection to the agent binary source uri.
- The cert key will be stored either as an encrypted SO or a secret
(latter option will be available once fleet server will have this
functionality: https://github.com/elastic/fleet-server/issues/4470).
- The secret field is only available when the feature flag
`enableSSLSecrets` is enabled, otherwise the cert key is saved as an
encrypted SO.

<details>
  <summary>Screenshots</summary>
<img width="809" alt="Screenshot 2025-03-11 at 14 53 44"
src="https://github.com/user-attachments/assets/e93a04cf-c699-4e13-8cb6-870986197f92"
/>
<img width="804" alt="Screenshot 2025-03-11 at 14 53 34"
src="https://github.com/user-attachments/assets/c2c13c8f-e65c-4843-a538-d317e1359bf0"
/>



Generated policy:
<img width="797" alt="Screenshot 2025-03-06 at 17 43 02"
src="https://github.com/user-attachments/assets/12411fea-9a8b-4ee9-aa7c-123c6aefea4a"
/>

</details>

### 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/src/platform/packages/shared/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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-12 09:50:32 +01:00
Davis McPhee
e1bffa6a9b
[Discover] Optimize Discover plugin page load bundle (#208298)
## Summary

This PR optimizes the Discover page load bundle by reducing it to only
code which is actually required on startup, and dynamically loading
other code when it's needed, resulting in a 55% decrease in the bundle
size.

Before (44.15 KB):

![before](https://github.com/user-attachments/assets/989d1626-4dd7-4710-a9bc-8d80220101eb)

After (20.12 KB):

![after](https://github.com/user-attachments/assets/ff68b367-3293-47cf-9d3f-5c35d0aea27a)

### 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/src/platform/packages/shared/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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-11 17:30:25 -03:00
Nathan Reese
99d8400328
move static presentationUtil code into package @kbn/expression-utils (#213659)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-11 14:24:00 -06:00
Mason Herron
35bfbf0484
[Fleet] Add integrations page gate (#213637)
Closes [#4169](https://github.com/elastic/ingest-dev/issues/4169)
## Summary


![image](https://github.com/user-attachments/assets/ad07e2c9-a37b-4a34-a87d-bdcb29f31e27)


Ths PR fixes an issue with integrations not being gated by
authentication rules by adding an auth check and returning error card if
the user doesnt have appropriate permissions.

- Moves `errors` layout file from fleet application to shared layouts
for both fleet and integrations

- Adds `callingApplication` prop to `permissionError` component to
properly display verbiage based on application its being used in

- Updated `fleet` application to have its own check when visiting the
`add-integrations` path that checks for appropriate permissions. Uses
`integrations.all` for check.

- Updated verbiage on error component with `guideLink`

- Adds top-level permission check on `integrations` application to
ensure user has permissions by using `integrations.read || fleet.all`
(may need to be extended in the future to make it more robust)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/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
- [ ] 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 was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

N/A

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-11 21:04:58 +01:00
Ido Cohen
aa850d4b9f
Deprecate Cloud Defend 2025-03-11 15:45:13 +02:00
Alejandro Fernández Haro
c240b035d4
[CI tools] Use ES 8.x (#213056)
## Summary

After upgrading the ES client to 9.0
(https://github.com/elastic/kibana/pull/208776), we noticed that the CI
fails to upload the results of the tests to the CI cluster:

```
ERROR ResponseError: media_type_header_exception
      	Caused by:
      		status_exception: Accept version must be either version 8 or 7, but found 9. Accept=application/vnd.elasticsearch+json; compatible-with=9
      	Root causes:
      		media_type_header_exception: Invalid media-type value on headers [Content-Type, Accept]
```

This PR makes sure that the CI client is still using v8.x until we
upgrade that cluster.
2025-03-05 20:26:57 +01:00
Anton Dosov
e676a6399c
Clean up REACT_18=true variable (#213246)
## Summary

Clean up `REACT_18=true` variable post [react@18
upgrade](https://github.com/elastic/kibana/pull/209337)


Should also address issue reported in slack 

> error https://registry.yarnpkg.com/react/-/react-18.2.0.tgz: Integrity
check failed for "react" [...]

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-05 17:40:05 +01:00
Tomasz Kajtoch
4dd8de807a
Make Amsterdam an opt-in theme (#212787)
## Summary

This PR updates `DEFAULT_THEME_TAGS` used to determine what theme tags
are bundled in Kibana by default to only include the Borealis theme,
specifically `borealislight` and `borealisdark` theme tags. This change
is expected to decrease bundle sizes significantly and get back to
bundling a single theme, not two (4 → 2 theme tags).

Now that Serverless, `9.0`, and `main` all run with Borealis, there's no
risk in removing Amsterdam from the bundle and decreasing Kibana bundle
sizes.

We need to keep the feature flag in code for the time being to easily
test future Borealis iterations.

Amsterdam will still be available as an opt-in theme and is meant to be
used locally when testing changes to be backported to 8.x versions that
use Amsterdam. To do so, Kibana needs to be started/built with
`KBN_OPTIMIZER_THEMES` environment variable set and the feature flag
overridden in `kibana.dev.yml`.

```yml
# config/kibana.dev.yml
feature_flags.overrides.coreRendering.defaultThemeName: amsterdam
```

```shell
# Run dev server with both borealis and Amsterdam theme tags
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn start
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-04 13:40:06 +01:00
Cristina Amico
151fa26a5f
[Fleet] Add SSL options to fleet server hosts settings (#208091)
Fixes https://github.com/elastic/kibana/issues/207322

## Summary
Show SSL options for fleet server host in Fleet server settings section
and in add fleet server host flyout
- Registered fleet server host as a encrypted save object and the new
mappings added under `ssl` property, mirroring what's already existing
for `logstash` and `kafka` outputs
- The new options are displayed in the UI, both when adding a new fleet
server host from the flyout and when editing an existing one.
- The values are then added to the full agent policy
- The values for `ssh.key` and `ssh.es_key` can additionally be saved as
secrets but for now this option is not enabled until [fleet server
supports it](https://github.com/elastic/fleet-server/issues/4470) - I
used the feature flag `enableSSLSecrets`

<details>
  <summary>Screenshots</summary>
<img width="803" alt="Screenshot 2025-02-14 at 10 23 41"
src="https://github.com/user-attachments/assets/e1bf8c93-e8c0-4351-b86b-a7f8a8b0ec72"
/>
<img width="801" alt="Screenshot 2025-02-14 at 10 23 36"
src="https://github.com/user-attachments/assets/f96d2a5c-0285-41d1-953b-e662ccdcd514"
/>
<img width="780" alt="Screenshot 2025-02-04 at 14 34 52"
src="https://github.com/user-attachments/assets/e854fc28-d4aa-4b01-8634-e1f37f70419b"
/>
<img width="804" alt="Screenshot 2025-02-04 at 14 35 00"
src="https://github.com/user-attachments/assets/f507c34a-774e-4aa1-94b2-b912539d6143"
/>
<img width="791" alt="Screenshot 2025-02-04 at 09 25 28"
src="https://github.com/user-attachments/assets/82c1f761-7ee5-42d0-8b8f-23848cfc0391"
/>

Generated policy:
<img width="795" alt="Screenshot 2025-02-24 at 16 43 58"
src="https://github.com/user-attachments/assets/5ef4e34f-5850-4449-8a70-7de10750bb84"
/>
<img width="796" alt="Screenshot 2025-02-24 at 16 44 15"
src="https://github.com/user-attachments/assets/bdcf70fe-72f0-4df0-9a9e-40346407a1df"
/>




</details>

### 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/src/platform/packages/shared/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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-03 13:23:00 +01:00
Gerard Soldevila
3fcd11ce4d
Decouple some modules from 'webpack' (#212746)
## Summary

Remove extraneous dependencies:
* `canvas` was depending on 'webpack' purely for a type (dev-time).
* `@kbn/optimizer-webpack-helpers` (canvas depends on it 🤨) was
depending on 'webpack' solely for a function that could be defined in
`@kbn/optimizer` (devOnly).
2025-03-03 13:21:50 +01:00
Jill Guyonnet
0d0995cb26
[Fleet] Add task for automatic agent upgrades (#211019)
## Summary

Closes https://github.com/elastic/ingest-dev/issues/4722

### Implementation checklist

- [x] Handle fetching agent policies and agents at scale
- [x] Only consider active agents for upgrade
- [x] Agents already on or upgrading to target version are included in
the count but not considered for upgrade
- [x] Agents stuck in updating are considered for upgrade
- [x] Bulk upgrade actions triggered by the task have an added
`isAutomatic:true` flag
- [x] Use rollout duration to spread bulk upgrade in time (1h or longer
depending on agent count)

### Testing

- This should be tested with real Elastic Agents (that will upgrade and
have `upgrade_details`).
- Edit the task interval in order to test how the task logic handles
agents already upgrading.
- Edit the agents batch size in order to test how the task logic handles
agents at scale.
- We should also check that space awareness is respected if enabled.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Risk of incorrectly triggering agent upgrades. Probability should be
very low if the agent policy does not have `required_versions` set.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-25 16:38:18 +01:00
Alejandro Fernández Haro
52ab19db2d
Upgrade ES client to 9.0.0-alpha.3 (#208776)
## Summary

Updating the ES client to 9.0. 

Resolves #116102

## What changes?

**Breaking change**: `body` has been removed.

Most of the changes are about bringing all the content inside the body
as a root attribute to the API params:

```diff
const response = await client.search({
  index: 'test',
-  body: {
    query: {
      match_all: {}
    }
-  }
})
```

For this reason, enabling the "Hide whitespace changes" option when
reviewing is recommended.

Some exceptions to this rule:

* Bulk APIs replace the `body` array with `operations` array (direct
replacement)
* Index Put Settings API replace `body` array with `settings` (direct
replacement)
* Msearch replaces the `body` array with `searches` array (direct
replacement)
* Document Index API replaces `body` with `document` (direct
replacement)
* Create Repository replaces `body` with `repository` (direct
replacement)

Because of a known issue in the client
(https://github.com/elastic/elasticsearch-js/issues/2584), there's still
an escape hatch to send data in the body in case the specific use case
requires it via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`, but it
shouldn't be abused because we lose types. In this PR we've used it in
those scenarios where we reuse the response of a GET as the body of a
PUT/POST.

### Other changes

* `estypes` can be imported from the root of the library as `import type
{ estypes } from '@elastic/elasticsearch';`
* `estypesWithBody` have been removed
* `requestTimeout`'s 30s default has been removed in the client. This PR
explicitly adds the setting in all client usages.


### Identify risks

- [x] The client places unknown properties as querystring, risking body
params leaking there, and causing 400 errors from ES => Solved by
forcing `body` usage there via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`. The next
version of the client will address this.
- [x] We need to run the MKI tests to make sure that we're not breaking
anything there =>
https://elastic.slack.com/archives/C04HT4P1YS3/p1739528112482629?thread_ts=1739480136.231439&cid=C04HT4P1YS3

---------

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2025-02-25 14:37:23 +00:00
Gerard Soldevila
a41badf964
SKA: Misc cleanup and enhancements (#212207)
## Summary

* Remove some old paths pointing to `packages/kbn-pm` (no longer
exists).
* ~Fix group and visibility for `@kbn/streams-app-wrapper-plugin`~.
(done in https://github.com/elastic/kibana/pull/212210)
* Update `scripts/relocate` logic with latest enhancements.
* Convert `@kbn/observability-synthetics-test-data` folder name to
camel-case (messes up with pre-commit hook).
2025-02-24 13:31:00 +00:00
Gerard Soldevila
6a7c904f92
SKA: Relocate "platform" packages that remain on /packages (#208704)
## Summary

The `/packages` folder at the root of the Kibana repository used to
contain a lot of packages.
In the context of SKA, they have been gradually moved to various
locations:
* `src/platform/packages`
* `x-pack/platform/packages`
* `src/core/packages`

Currently, only `devOnly: true` packages are left in this folder. This
comprises libraries for CLI scripts as well as testing utilities.

With this PR, we are moving ~half of these packages under
`src/platform/packages/(private|shared)/`.
In particular, we are moving those packages that are being used from
platform and/or solutions.

Since they are `"devOnly": true`, this means they are ONLY used from
tests, cypress tests, storybook configs, ./scripts/ folders inside some
modules, or other non-prod-time logic. Nonetheless, they are effectively
referenced from platform and/or solutions code, hence I decided they
should be placed under `platform` folders.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-24 11:03:30 +00:00
Shahzad
aaf73ff5f6
[Synthetics] Fix overview error popover !! (#211431)
## Summary

Fix overview error popover !!

Pings aren't being returned as part of overview data anymore, so had to
add redux actions to fetch it separately via an existing API

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


<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/2244948f-e42d-443d-b6e7-42e0a72b1bfa"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Justin Kambic <jk@elastic.co>
2025-02-21 16:38:54 +00:00
Abdul Wahab Zahid
cb71dff86e
[Synthtrace] Improve URL discovery when running locally in Serverless mode (#211670)
## Summary

This PR improves how **Synthtrace** resolves the Kibana URL when only
`--target` (Elasticsearch) is provided or when neither `--target` nor
`--kibana` is specified. The CLI now attempts to **automatically
discover** the appropriate URLs based on the provided arguments.

Some adjustments were made to improve this discovery process, especially
when running **locally in Serverless mode**, where Kibana may be using
`http`, while Elasticsearch (ES) is on `https`. Additionally,
self-signed certificates do not work with the IP address `127.0.0.1`, so
this PR defaults to `localhost` and warns the user if `127.0.0.1` is
detected in Serverless mode.

### **Improvements**
- If either of `--target` or `--kibana` or neither provided, the CLI
attempts to **discovers the URLs** dynamically now in both Stateful and
Serverless.
- Defaults to `localhost` instead of `127.0.0.1` to avoid SSL
certificate issues.
- Provides a **clear error message and hint** when Kibana and ES use
different protocols (http vs https) and either or both are unreachable.

### **Expected Behavior After This PR**
These commands should now work **seamlessly** in both **local Stateful**
and **Serverless** modes:

```sh
✗ node scripts/synthtrace simple_logs
```

For **Serverless mode**, these also work:

```sh
✗ node scripts/synthtrace simple_logs --kibana=http://elastic_serverless:changeme@localhost:5601
```

```sh
✗ node scripts/synthtrace simple_logs --target=https://elastic_serverless:changeme@localhost:9200 --kibana=http://elastic_serverless:changeme@localhost:5601
```

### **(Side Note) Serverless Kibana with SSL Disabled**
However, the following command will **fail** with an error message if
Kibana is running without SSL, while Elasticsearch is using `https`:

```sh
✗ node scripts/synthtrace simple_logs --target=https://elastic_serverless:changeme@localhost:9200
```

#### **Error Output:**
```sh
Loading scenario from kibana/packages/kbn-apm-synthtrace/src/scenarios/simple_logs.ts
Error: Could not connect to Kibana. request to https://elastic_serverless:changeme@localhost:5601/ failed, reason: write EPROTO 400882F501000000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:355:

If your Kibana URL differs, consider using the '--kibana' parameter to customize it.
```

**Solution:** 
If you must have to provide `--target` (non defaults), also provide
`--kibana` or start Kibana with SSL enabled.
```sh
✗ yarn start --serverless=oblt --ssl
```
2025-02-21 16:58:07 +01:00
Dzmitry Lemechko
f5a1ead8cf
[scout] disable reporter for config validation command (#212072)
## Summary

In #211918 I added config validation check to skip run if there are no
tests in playwright config.

It turned out that Playwright init reporters even when `--list` command
is passed and no tests are executed, that lead to Scout reports being
loaded and then causing reporter error when the other command runs the
tests:

```
 proc [playwright]  info Calling save with destination: /Users/dmle/github/kibana/.scout/reports/scout-playwright-9518363d47816953
 proc [playwright] ERROR Error: Save destination path '/Users/dmle/github/kibana/.scout/reports/scout-playwright-9518363d47816953' already exists
 proc [playwright]           at ScoutEventsReport.save (/Users/dmle/github/kibana/packages/kbn-scout-reporting/src/reporting/report/events/report.ts:56:13)
 proc [playwright]           at ScoutPlaywrightReporter.onEnd (/Users/dmle/github/kibana/packages/kbn-scout-reporting/src/reporting/playwright/events/playwright_reporter.ts:277:19)
 proc [playwright]           at ReporterV2Wrapper.onEnd (/Users/dmle/github/kibana/node_modules/playwright/lib/reporters/reporterV2.js:91:165)
 proc [playwright]           at /Users/dmle/github/kibana/node_modules/playwright/lib/reporters/multiplexer.js:71:117
 proc [playwright]           at wrapAsync (/Users/dmle/github/kibana/node_modules/playwright/lib/reporters/multiplexer.js:112:18)
 proc [playwright]           at Multiplexer.onEnd (/Users/dmle/github/kibana/node_modules/playwright/lib/reporters/multiplexer.js:69:31)
 proc [playwright]           at InternalReporter.onEnd (/Users/dmle/github/kibana/node_modules/playwright/lib/reporters/internalReporter.js:77:12)
 proc [playwright]           at finishTaskRun (/Users/dmle/github/kibana/node_modules/playwright/lib/runner/tasks.js:90:26)
 proc [playwright]           at runTasks (/Users/dmle/github/kibana/node_modules/playwright/lib/runner/tasks.js:73:10)
 proc [playwright]           at Runner.runAllTests (/Users/dmle/github/kibana/node_modules/playwright/lib/runner/runner.js:72:20)
 proc [playwright]           at runTests (/Users/dmle/github/kibana/node_modules/playwright/lib/program.js:211:18)
 proc [playwright]           at t.<anonymous> (/Users/dmle/github/kibana/node_modules/playwright/lib/program.js:54:7)
```

The simplest solution is to explicitly disable Scout reporter for config
validation command.
2025-02-21 16:42:32 +01:00
Joe Reuter
8a9bb363aa
🌊 Move streams to platform (#211893)
This PR moves the `streams` and `streams_app` plugins into platform so
they can be used in other solutions in the future. This PR is not
actually making it available in other solutions yet since we are still
discussing the release plans.

## Inlined helpers

As discussed before, this PR inlines a couple simple helper methods for
query building, time zone normalization, a header portal helper and a
data plugin timefilter state react integration hook as there is no good
place for these outside of the observability solution.

## streams_app plugin

The streams_app plugin is not actually registering anything, instead it
simply exports a component that renders the app which needs to be
consumed by another plugin to turn it into a registered app - for now,
`observability_streams_wrapper` takes over this job.

## observability_streams_wrapper plugin

While 99% of the streams logic is moved into the
`platform/shared/streams_app`, two bits are left behind in
`observability_streams_wrapper`:
* The actual app registration
* Integration with the observability_shared `PageTemplate` component

Once we decide streams should be displayed outside of the observability
solution, it's probably not necessary anymore to decouple app definition
and registration like this because it will always be visible no matter
the solution. Once this is the case, the navigation registration can be
moved into the central `observability` plugin, like it's handled with
other apps like infra.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-21 16:34:50 +01:00
Dzmitry Lemechko
30c4275462
[scout] validate config has tests before starting servers (#211918)
## Summary

There is no need to start servers (~1.5 min run time) if there are no
tests matching filters or maybe config itself has all tests skipped.

This PR uses Playwright cli with `--list` flag to quickly validate
playwright config and exit with status code `2` (`1` is reserved for
errors during servers start or test failures). it also useful to know in
advance how many tests were about to run:

case 1: tests found

```
$ node scripts/scout.js run-tests --config x-pack/platform/plugins/private/discover_enhanced/ui_tests/parallel.playwright.config.ts --serverless=security
 info scout: Test server configuration saved at /Users/dmle/github/kibana/.scout/servers/local.json
 info scout: Validate Playwright config has tests
 info scout: Total: 5 tests in 2 files
 info Verifying Docker is installed.
   │ info Docker version 20.10.14, build a224086349
...
```

case 2: no tests found
```
$ node scripts/scout.js run-tests --config x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/playwright.config.ts --stateful
 info scout: Test server configuration saved at /Users/dmle/github/kibana/.scout/servers/local.json
 info scout: Validate Playwright config has tests
ERROR scout: No tests found in [x-pack/solutions/observability/plugins/observability_onboarding/ui_tests/playwright.config.ts]
```
2025-02-20 18:20:21 +01:00
Marco Liberati
1e92ae8afb
[Lens][Embeddable] Make UI react faster to click actions like create or edit (#210810)
## Summary

This PR is based on the idea in #209361 and tries to improve perceived
performances for all the scenarios where the `editorFrame` is loaded.

On fast connections this is now perceived very fast:

![esql_fast](https://github.com/user-attachments/assets/efb26416-bf15-449e-912f-a689c689c593)

On Fast 4g is still fast

![esql_fast_4g](https://github.com/user-attachments/assets/acc199be-683d-4a4b-a53c-f37a9117c258)

On Slow 4g is acceptable


![esql_slow_4g](https://github.com/user-attachments/assets/6fed9ec4-dc3f-4557-976c-91d82bddc10f)

Even on 3G connection the feedback is much better now


![esql_3g](https://github.com/user-attachments/assets/27e96c01-9149-4dd1-8a6d-e005202149ff)

As a bonus extra tests have been added for the ES|QL creation flow.

cc @thomasneirynck @nreese 

### 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

---------

Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
2025-02-20 18:19:46 +01:00
David Olaru
1147bb65dd
[scout] Don't mix await with promise callbacks (#211905)
## Summary

There's a high likelihood that this causes some unwanted behavior where
the promise is not resolved and the `node` process just exists without
any error.
2025-02-20 16:05:17 +01:00
Gerard Soldevila
69a87194d1
SKA: Fix kebab-case issues in security-threat-hunting packages (#211349)
## 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).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/securitysolution-data-table` |
`x-pack/solutions/security/packages/data-table` |
| `@kbn/ecs-data-quality-dashboard` |
`x-pack/solutions/security/packages/ecs-data-quality-dashboard` |
| `@kbn/security-solution-side-nav` |
`x-pack/solutions/security/packages/side-nav` |


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

```
./.i18nrc.json
./package.json
./packages/kbn-ts-projects/config-paths.json
./src/platform/packages/private/kbn-repo-packages/package-map.json
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./x-pack/solutions/security/packages/data-table/jest.config.js
./x-pack/solutions/security/packages/ecs-data-quality-dashboard/jest.config.js
./x-pack/solutions/security/packages/side-nav/jest.config.js
./yarn.lock
.github/CODEOWNERS
```

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

```
x-pack/solutions/security/packages/data-table/jest.config.js:11
x-pack/solutions/security/packages/data-table/tsconfig.json:2
x-pack/solutions/security/packages/ecs-data-quality-dashboard/jest.config.js:24
x-pack/solutions/security/packages/ecs-data-quality-dashboard/tsconfig.json:10
x-pack/solutions/security/packages/ecs-data-quality-dashboard/tsconfig.json:2
x-pack/solutions/security/packages/side-nav/jest.config.js:10
x-pack/solutions/security/packages/side-nav/tsconfig.json:2
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-19 11:21:45 +01:00