Commit graph

87630 commits

Author SHA1 Message Date
Kate Sosedova
0d2125427f
Remapping iInCircle and questionInCircle and deprecating help icon (#223142)
## Summary

This PR closes the issue https://github.com/elastic/kibana/issues/221380
and does 3 things:
1. Replaces all current usages of `iInCircle` with `info` (no visual
changes)
2. Replaces all current usages of `questionInCircle` with `question`(no
visual changes)
3. Replaces all current `help` icon usages with `question`(lifesaver
icon replaced with question)

## Screenshots:
![CleanShot 2025-06-18 at 10 34
01@2x](https://github.com/user-attachments/assets/4379e51e-7422-4570-b452-c17ee26f2d64)
![CleanShot 2025-06-18 at 10 34
13@2x](https://github.com/user-attachments/assets/270056c7-4502-47ef-874f-862149fa27ec)
![CleanShot 2025-06-18 at 10 34
04@2x](https://github.com/user-attachments/assets/1dff8faf-65b7-4208-b568-7718b1a6b729)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
2025-06-25 14:52:04 -05:00
Kibana Machine
2ce244f006 skip failing test suite (#224699) 2025-06-25 21:51:25 +02:00
Nick Partridge
17c2556fc6
[Lens] Add internal CRUD api routes (#223296)
## Summary

This adds basic Lens CRUD api routes using the Content Management
system.

| Operation | URI |
|--------|--------|
| Create | `POST api/lens/visualizations` |
| Get | `GET api/lens/visualizations/{id}` |
| Search | `GET api/lens/visualizations?query=test` |
| Update | `PUT api/lens/visualizations/{id}` |
| Delete | `DELETE api/lens/visualizations/{id}` |

### Changes to Lens Content Management

The custom `update` method uses `soClient.create` under the hood for
reasons (i.e. #160116). However, doing this acts as an update or create
method with the provided `id`. I changed this behavior so now any update
where the id is not found will return a `404` error.

Closes #221941
Closes #221942 - OpenAPI docs auto generate from route schema

### Testing

You can testing this locally in kibana dev console like so...

```
GET kbn:/api/lens/visualizations/<id>?apiVersion=1
```

> The `apiVersion` query param is needed to test `internal` api routes.

## 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)
- [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] 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.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2025-06-25 20:01:35 +01:00
Ania Kowalska
2c55a7d9d0
[Discover] Fix styles typo (#225339)
## Summary

Quick fix with styles typo, according to [this
comment](https://github.com/elastic/kibana/pull/224586#discussion_r2166795813).
I had auto merge on in [[Discover] Align SCSS - Emotion migration part 2
with new guidelines](https://github.com/elastic/kibana/pull/224586#top)
and accidentally got merged with typo.


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

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)
- [ ] ...
2025-06-25 20:58:06 +02:00
Gergő Ábrahám
0c2cd2267b
[Security] Fix siemV3 migration for Endpoint Exceptions on Serverless (#225331)
## Summary

Endpoint Exception ALL privilege got lost, because the original
migration (PR: https://github.com/elastic/kibana/pull/219566) did this:
- for `siem:ALL` or `siemV2:ALL`:
- it adds the new `global_artifact_management_all`, because `siemVX` all
meant that user can write Endpoint Exceptions
- and: it changed `siemVX:ALL` to `siemVX:MINIMAL_ALL`, in order to
enabled the sub-features toggle, so it is visible to the user that they
are granted a new sub-privilege

and the issue: Endpoint Exceptions are not included in
`siemVX:MINIMAL_ALL`, and thanks to this the user lost their access to
Endpoint Exceptions.

this PR solves this issue.

### visualization

with this change, the `siem/siemV2:ALL` -> `siemV3` migration graph now
looks like this:

```mermaid
flowchart LR
    classDef serverless stroke:blue,stroke-dasharray: 5 5

    subgraph siemV2[siem/siemV2]
        all1[all]
    end

    subgraph siemV3
        subgraph minall2[minimal_all]
            g1[global_artifact_management_all]

            eea["`endpoint_exceptions_all
                (only serverless)`"]:::serverless
        end
    end

    all1 -->|keep access to the included Endpoint Exceptions ALL| g1
    all1 -->|enable sub-feature toggle| minall2

    all1 -->|keep access to EE ALL, as it WAS included in ALL. only serverless| eea
    linkStyle 2 stroke:#00f,color:blue
```

see the previous ones here:
https://github.com/elastic/kibana/pull/219566

### 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
2025-06-25 19:30:11 +01:00
Efe Gürkan YALAMAN
cae3861f5d
[Query Rules] Query rules telemetry (#225146)
## Summary

Adds telemetry to query rules UIs


### 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)
- [ ] [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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 19:14:04 +02:00
Ido Cohen
1ebff0e634
Add namespace to default grouping csp fields (#225279) 2025-06-25 13:10:54 -04:00
Dzmitry Lemechko
bb7cce6d7b
[ska] relocate x-pack/test/cases_api_integration (#225056)
## Summary

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

This PR is mostly about moving tests from
x-pack/test/cases_api_integration and updating related imports

Before:

```
x-pack/test/
     | - cases_api_integration/
```

After: 
```
x-pack/platform/test/
     | - cases_api_integration/
 
x-pack/solutions/security/test/
     | - cases_api_integration/
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 18:04:29 +01:00
Brad White
385a9df4da
Renovate helper pipeline (#224152)
## Summary
- Part of #213293
- Adds infrastructure for a new pipeline: `kibana / renovate helper` 
- The pipeline and scripts are currently a no-op and will be finalized
and tested in a follow up PR against the provisioned pipeline.

## Plan
The goal is to automatically run a script when Renovate opens a PR to
dedupe and perform any other actions, then trigger the Kibana PR
pipeline. This can also be performed by commenting `buildkite run
renovate helper` in the instances where the PR has been rebased by
Renovate.

Additionally, this pipeline will trigger the Kibana PR pipeline
automatically for Renovate PRs when the commit author is not Renovate
bot. Currently a developer has to comment every time they want CI to run
on Renovate PRs. This will improve DX when merging upstream, debugging
the dep upgrade and auto-commits by `kibanamachine`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 10:35:37 -06:00
Sergi Massaneda
51b1cd7344
[Security Solution][Auto migrations] Adapt cypress tests to 9.1 features (#224857)
## Summary

Adapted cypress tests to:

- Run cypress tests within the Threat Hunting Investigations team bundle
in the CI.
- Fixed failing onboarding test.
- Added test cases for migration rename functionality to the onboarding
test.

## Screenshots

![CI
exec](https://github.com/user-attachments/assets/81801b00-7ff5-4020-8de3-186fd9f23714)
2025-06-25 18:25:22 +02:00
Larry Gregory
ea18158480
Allow dependency usage to be grouped by package (#224751)
## Summary
This pull request introduces a new feature to group dependency usage by
package directories, alongside existing options for grouping by owner or
source. It includes updates to the CLI, dependency graph logic, and new
utility functions and tests to support the feature.

### CLI updates:
* Enhanced the `group-by` option in `configureYargs` to allow grouping
by `package` in addition to `owner` and `source`.
(`packages/kbn-dependency-usage/src/cli.ts`,
[packages/kbn-dependency-usage/src/cli.tsL50-R51](diffhunk://#diff-ef89f6725b6dde85fbfea1050625607f583373da328165c575070f0579e5f23aL50-R51))

### Dependency graph logic:
* Added the `groupByPackage` function to group dependencies by package
directories, and integrated it into the
`identifyDependencyUsageWithCruiser` method.
(`packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.ts`,
[[1]](diffhunk://#diff-19e7d98370cc898df6e0a28a61575490b35a0ff6013a8c5080aa8c9fa0065e71R17)
[[2]](diffhunk://#diff-19e7d98370cc898df6e0a28a61575490b35a0ff6013a8c5080aa8c9fa0065e71R120-R123)

### Utility functions:
* Implemented `groupByPackage` utility to identify package directories
based on the presence of `kibana.jsonc` files and group dependencies
accordingly.
(`packages/kbn-dependency-usage/src/lib/group_by_package.ts`,
[packages/kbn-dependency-usage/src/lib/group_by_package.tsR1-R80](diffhunk://#diff-4e2be55a320215ee636cd352393c09c0e90524a5b6121b034d1360a6afed4d67R1-R80))

### Unit tests:
* Added comprehensive tests for `groupByPackage`, covering scenarios
such as nested directories, missing package files, and handling of empty
dependencies.
(`packages/kbn-dependency-usage/src/lib/group_by_package.test.ts`,
[packages/kbn-dependency-usage/src/lib/group_by_package.test.tsR1-R231](diffhunk://#diff-69398d48b1e5a2ea0ed52ca35fc2d877e143a6dcefd71d2399931ba242b962b5R1-R231))

### Example usage
```sh
(base) ➜  kibana git:(dep-usage/group-by-package) ✗ ./scripts/dependency_usage.sh -c 20 -g package -p x-pack/solutions/security          
Searching for dependencies in paths: x-pack/solutions/security
Dependencies will be collapsed to depth: 20
cruiser is used for building dependency graph
Successfully built dependency graph using cruiser. Analyzing...
No output file specified, displaying results below:

{
  "x-pack/solutions/security/packages/connectors": [
    "minimatch",
    "@elastic/eui",
    "@emotion/react",
    "@testing-library/react",
    "react",
    "lodash"
  ],
  "x-pack/solutions/security/packages/data-stream-adapter": [
    "lodash"
  ],
  "x-pack/solutions/security/packages/data-table": [
    "io-ts",
    "enzyme",
    "lodash",
    "react",
    "@elastic/eui",
    "@hello-pangea/dnd",
    "@tanstack/react-query",
    "react-redux",
    "redux",
    "styled-components",
    "@testing-library/react",
    "memoize-one",
    "typescript-fsa",
    "typescript-fsa-reducers",
    "reselect"
  ],
  "x-pack/solutions/security/packages/distribution-bar": [
    "@elastic/eui",
    "react",
    "@testing-library/react",
    "@elastic/numeral",
    "@emotion/react"
  ],
  "x-pack/solutions/security/packages/ecs-data-quality-dashboard": [
    "minimatch",
    "react",
    "@testing-library/react",
    "@testing-library/user-event",
    "@elastic/eui",
    "@emotion/react",
    "@elastic/ecs",
    "@elastic/numeral",
    "lodash",
    "@emotion/styled",
    "moment-timezone",
    "moment",
    "@elastic/charts",
    "uuid",
    "@tanstack/react-query",
    "rxjs",
    "@testing-library/jest-dom"
  ],
  "x-pack/solutions/security/packages/expandable-flyout": [
    "@testing-library/react",
    "react",
    "@elastic/eui",
    "@emotion/react",
    "lodash",
    "@testing-library/user-event",
    "@emotion/css",
    "react-router-dom",
    "rxjs",
    "react-redux",
    "@reduxjs/toolkit",
    "react-fast-compare",
    "reselect"
  ],
  "x-pack/solutions/security/packages/features": [
    "minimatch"
  ],
  "x-pack/solutions/security/packages/index-adapter": [
    "@elastic/elasticsearch",
    "lodash",
    "@elastic/ecs",
    "rxjs"
  ],
  "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph": [
    "babel-jest",
    "@emotion/react",
    "react",
    "@storybook/addon-actions",
    "rxjs",
    "@tanstack/react-query",
    "webpack-merge",
    "@storybook/manager-api",
    "@storybook/theming",
    "@testing-library/jest-dom",
    "@elastic/eui",
    "@testing-library/react",
    "react-use",
    "@xyflow/react",
    "lodash",
    "@emotion/styled",
    "polished",
    "@storybook/react",
    "@testing-library/user-event",
    "expect",
    "@dagrejs/dagre"
  ],
  "x-pack/solutions/security/packages/kbn-cloud-security-posture/public": [
    "@elastic/eui",
    "@emotion/react",
    "react",
    "react-dom",
    "@testing-library/react",
    "@tanstack/react-query",
    "rxjs",
    "react-router-dom"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-autocomplete": [
    "@testing-library/jest-dom",
    "@testing-library/react",
    "react",
    "@elastic/eui",
    "enzyme",
    "lodash",
    "moment"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components": [
    "@testing-library/jest-dom",
    "@testing-library/react",
    "react",
    "@elastic/eui",
    "@emotion/react",
    "@emotion/css",
    "@emotion/styled"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-hook-utils": [
    "@testing-library/react",
    "react",
    "rxjs"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types": [
    "io-ts",
    "fp-ts",
    "uuid"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types": [
    "fp-ts",
    "io-ts"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-list-api": [
    "fp-ts"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-list-hooks": [
    "fp-ts",
    "react",
    "@tanstack/react-query",
    "@testing-library/react"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-list-utils": [
    "lodash",
    "uuid"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-t-grid": [
    "lodash"
  ],
  "x-pack/solutions/security/packages/kbn-securitysolution-utils": [
    "uuid",
    "axios",
    "p-limit"
  ],
  "x-pack/solutions/security/packages/navigation": [
    "minimatch",
    "react",
    "@elastic/eui",
    "@emotion/react",
    "@testing-library/react"
  ],
  "x-pack/solutions/security/packages/side-nav": [
    "minimatch",
    "@elastic/eui",
    "@emotion/react",
    "react",
    "@emotion/css",
    "@testing-library/react",
    "classnames",
    "@testing-library/user-event",
    "lodash"
  ],
  "x-pack/solutions/security/packages/storybook/config": [
    "@storybook/addon-actions",
    "@storybook/manager-api",
    "@storybook/theming",
    "jest-mock"
  ],
  "x-pack/solutions/security/packages/upselling": [
    "minimatch",
    "@elastic/eui",
    "react",
    "@testing-library/react",
    "@emotion/react",
    "@emotion/styled",
    "rxjs"
  ],
  "x-pack/solutions/security/plugins/cloud_security_posture": [
    "react",
    "@testing-library/react",
    "history",
    "@tanstack/react-query",
    "react-router-dom",
    "@elastic/eui",
    "@emotion/react",
    "lodash",
    "react-use",
    "chance",
    "@emotion/css",
    "uuid",
    "@testing-library/user-event",
    "semver",
    "@testing-library/jest-dom",
    "moment",
    "@elastic/charts",
    "msw",
    "rxjs",
    "io-ts",
    "@testing-library/dom",
    "@elastic/elasticsearch"
  ],
  "x-pack/solutions/security/plugins/ecs_data_quality_dashboard": [
    "minimatch",
    "rxjs",
    "moment-timezone",
    "fp-ts",
    "io-ts"
  ],
  "x-pack/solutions/security/plugins/elastic_assistant": [
    "@elastic/elasticsearch",
    "axios",
    "p-limit",
    "yargs",
    "@langchain/core",
    "langchain",
    "globby",
    "uuid",
    "lodash",
    "p-retry",
    "rxjs",
    "js-yaml",
    "langsmith",
    "@langchain/langgraph",
    "moment",
    "@elastic/ecs",
    "p-map",
    "@testing-library/react",
    "elastic-apm-node",
    "moment-timezone",
    "expect"
  ],
  "x-pack/solutions/security/plugins/lists": [
    "moment",
    "react",
    "@elastic/eui",
    "enzyme",
    "styled-components",
    "@storybook/addon-actions",
    "@testing-library/react",
    "fast-deep-equal",
    "@tanstack/react-query",
    "uuid",
    "lodash",
    "io-ts",
    "fp-ts",
    "elastic-apm-node",
    "sinon",
    "@hapi/boom",
    "mustache",
    "p-retry"
  ],
  "x-pack/solutions/security/plugins/security_solution_ess": [
    "react",
    "rxjs",
    "@testing-library/react",
    "@elastic/eui"
  ],
  "x-pack/solutions/security/plugins/security_solution_serverless": [
    "react",
    "@elastic/eui",
    "@emotion/react",
    "@testing-library/react",
    "rxjs",
    "@emotion/styled",
    "chance",
    "lodash",
    "node-fetch"
  ],
  "x-pack/solutions/security/plugins/security_solution": [
    "lodash",
    "io-ts",
    "fp-ts",
    "seedrandom",
    "uuid",
    "semver",
    "moment",
    "axios",
    "ipaddr.js",
    "rxjs",
    "@emotion/react",
    "@elastic/eui",
    "react",
    "copy-to-clipboard",
    "@testing-library/react",
    "react-router-dom",
    "react-redux",
    "react-use",
    "react-reverse-portal",
    "styled-components",
    "react-dom",
    "@elastic/charts",
    "@testing-library/user-event",
    "@tanstack/react-query",
    "@testing-library/dom",
    "@emotion/css",
    "@testing-library/jest-dom",
    "remark-parse-no-trim",
    "unified",
    "@emotion/styled",
    "react-router-dom-v5-compat",
    "d3",
    "minimatch",
    "enzyme",
    "deepmerge",
    "fast-deep-equal",
    "@emotion/jest",
    "@elastic/numeral",
    "polished",
    "@hello-pangea/dnd",
    "use-resize-observer",
    "jest-styled-components",
    "moment-timezone",
    "classnames",
    "react-hook-form",
    "query-string",
    "fetch-mock",
    "@storybook/addon-actions",
    "react-markdown",
    "reselect",
    "redux",
    "mustache",
    "memoize-one",
    "history",
    "react-router",
    "typescript-fsa",
    "typescript-fsa-reducers",
    "@reduxjs/toolkit",
    "immer",
    "reduce-reducers",
    "redux-devtools-extension",
    "redux-thunk",
    "@formatjs/intl-utils",
    "react-diff-view",
    "unidiff",
    "diff",
    "json-stable-stringify",
    "sinon",
    "dedent",
    "object-hash",
    "papaparse",
    "d3-scale",
    "i18n-iso-countries",
    "@elastic/ecs",
    "@cypress/grep",
    "cypress-data-session",
    "cypress-recurse",
    "execa",
    "p-retry",
    "@cypress/debugging-proxy",
    "p-map",
    "pretty-ms",
    "@elastic/apm-rum",
    "ts-easing",
    "rbush",
    "suricata-sid-db",
    "react-window",
    "formik",
    "extract-zip",
    "js-yaml",
    "tar",
    "chalk",
    "@hapi/hapi",
    "node-fetch",
    "strip-ansi",
    "inquirer",
    "@elastic/elasticsearch",
    "yargs",
    "minimist",
    "del",
    "globby",
    "xml2js",
    "@langchain/core",
    "cypress",
    "find-cypress-specs",
    "cli-table3",
    "@babel/generator",
    "@babel/parser",
    "@langchain/langgraph",
    "langchain",
    "node-diff3",
    "snakecase-keys",
    "@hapi/boom",
    "elastic-apm-node",
    "set-value",
    "murmurhash",
    "js-sha256",
    "fastest-levenshtein",
    "langsmith",
    "adm-zip",
    "camelcase-keys"
  ],
  "x-pack/solutions/security/plugins/session_view": [
    "react",
    "@elastic/eui",
    "@emotion/react",
    "@testing-library/user-event",
    "@testing-library/react",
    "lodash",
    "uuid",
    "memoize-one",
    "@tanstack/react-query",
    "byte-size",
    "react-use",
    "xterm",
    "use-resize-observer",
    "strip-ansi",
    "history"
  ],
  "x-pack/solutions/security/test": [
    "moment",
    "chance",
    "lodash",
    "expect",
    "fast-deep-equal",
    "@mswjs/http-middleware",
    "msw",
    "uuid"
  ]
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 11:09:28 -04:00
Damian Polewski
4b925523bf
[Console] Fix test for opening docs with shortcut (#225276)
Fixes #218255 and #213784

## Summary

This PR fixes flaky test in Console responsible for opening
documentation with keyboard shortcut by checking if the opened tab
contains `www.elastic.co/docs`.
2025-06-25 17:07:46 +02:00
Dzmitry Lemechko
58b8c7aec0
[ska] [xpack] relocate platform tests (#225223)
## Summary

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

This PR is mostly about moving platform tests from x-pack/test/

Before:

```
x-pack/test/
     | - ftr_apis/
     | - load/
     | - plugin_api_perf/
     | - fleet_packages/
     | - fleet_tasks/
     | - scalability/
     | - task_manager_claimer_update_by_query/
```

After: 
```
x-pack/platform/test/
     | - ftr_apis/
     | - load/
     | - plugin_api_perf/
     | - fleet_packages/
     | - fleet_tasks/
     | - scalability/
     | - task_manager_claimer_update_by_query/

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 17:01:04 +02:00
Lene Gadewoll
efedad1b3e
Upgrade EUI to v104.0.2 (#224855)
`103.1.0`  `104.0.2`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

- updates flat tooltip prop usages on **EuiCopy** to use new
`tooltipProp`

## Package updates

### `@elastic/eui`

## [`v104.0.2`](https://github.com/elastic/eui/releases/v104.0.2)

**Bug fixes**

- Fixed missing JSON token exports for
`euiColorBackgroundBaseInteractiveSelectHover` and
`euiColorBorderStrongText`
([#8819](https://github.com/elastic/eui/pull/8819))

## [`v104.0.1`](https://github.com/elastic/eui/releases/v104.0.1)

**Bug fixes**

- Fixed a wrong path in the module declaration for the JSON token
exports that would trigger typescript errors
([#8818](https://github.com/elastic/eui/pull/8818))

## [`v104.0.0`](https://github.com/elastic/eui/releases/v104.0.0)

- Added data vis text color tokens:
([#8793](https://github.com/elastic/eui/pull/8793))
  - `colors.vis.euiColorVisText0`
  - `colors.vis.euiColorVisText1`
  - `colors.vis.euiColorVisText2`
  - `colors.vis.euiColorVisText3`
  - `colors.vis.euiColorVisText4`
  - `colors.vis.euiColorVisText5`
  - `colors.vis.euiColorVisText6`
  - `colors.vis.euiColorVisText7`
  - `colors.vis.euiColorVisText8`
  - `colors.vis.euiColorVisText9`
- Updated and aligned background hover styles for `EuiTable` and
`EuiDataGrid` ([#8769](https://github.com/elastic/eui/pull/8769))

**Deprecations**

- Deprecated `euiPaletteForLightBackground` and
`euiPaletteForDarkBackground` palettes. Use the newly added data vis
color tokens instead.
([#8793](https://github.com/elastic/eui/pull/8793))

**Breaking changes**

- Removed tokens: ([#8793](https://github.com/elastic/eui/pull/8793))
  - `colors.vis.euiColorVisAsTextLight1`
  - `colors.vis.euiColorVisAsTextLight0`
  - `colors.vis.euiColorVisAsTextLight2`
  - `colors.vis.euiColorVisAsTextLight3`
  - `colors.vis.euiColorVisAsTextLight4`
  - `colors.vis.euiColorVisAsTextLight5`
  - `colors.vis.euiColorVisAsTextLight6`
  - `colors.vis.euiColorVisAsTextDark1`
  - `colors.vis.euiColorVisAsTextDark0`
  - `colors.vis.euiColorVisAsTextDark2`
  - `colors.vis.euiColorVisAsTextDark3`
  - `colors.vis.euiColorVisAsTextDark4`
  - `colors.vis.euiColorVisAsTextDark5`
  - `colors.vis.euiColorVisAsTextDark6`
- Removed `xl` size from `EuiTabs`
([#8762](https://github.com/elastic/eui/pull/8762))
- Added `tooltipProps` to `EuiCopy` which replaces spreading all props
to `EuiToolTip` ([#8758](https://github.com/elastic/eui/pull/8758))

<!--ONMERGE {"backportTargets":["8.19"]} ONMERGE-->

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-06-25 16:55:46 +02:00
Ievgen Sorokopud
1ce76ecf01
[Attack Discovery][Scheduling] Cases: Increase max opened cases limit for attack discovery schedules (#225246)
## Summary

In [this PR](https://github.com/elastic/kibana/pull/222827) we added
support of Cases action for Attack Discovery Schedules.

Now we would like to increase a "max opened cases" limit which defaults
to `5` right now and can be set maximum to `10`. In case with attack
discoveries it is highly expected to have more generated alerts and thus
we would like to bump the max number of opened cases to `20`.

## NOTES

The attack discovery scheduling and alerts history features are hidden
behind these feature flags (in `kibana.dev.yml`):

```
feature_flags.overrides:
  securitySolution.attackDiscoveryAlertsEnabled: true
  securitySolution.assistantAttackDiscoverySchedulingEnabled: true
```
2025-06-25 16:47:47 +02:00
Julia Bardi
4aec662015
[Fleet] disable Save button if target versions not changed (#225228)
## Summary

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

Make Save button disabled if target versions haven't changed in Manage
auto-upgrade agents modal


https://github.com/user-attachments/assets/260dd0ab-bd0a-4977-bfb5-575071bb5a37
2025-06-25 16:44:49 +02:00
Raya Fratkina
fc332241fe
Update advanced-settings.md to clarify space-specific vs global (#224951)
## Summary

The description of space-specific vs global settings was unclear. This
PR cleans up the language around space-specific vs global settings

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

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: Kaarina Tungseth <kaarina.tungseth@elastic.co>
2025-06-25 10:28:20 -04:00
Jon
57804aec8a
[ci] Only validate next docs on pull requests targeting main (#225185)
Dev docs are only released off the main branch. We don't need to
validate these changes on backports.
2025-06-25 09:21:12 -05:00
Ania Kowalska
96e6dd5fa2
[Discover] Align SCSS - Emotion migration part 2 with new guidelines (#224586)
## Summary

This pull requests aligns previous SCSS refactor part 2 ([[Discover]
SCSS to Emotions migration part
2/4](https://github.com/elastic/kibana/pull/214729/files#top)) with new
[Emotion
standards](https://docs.google.com/document/d/1CPflY8yCc3lZDg2BQkaMTgIkZlqiAEyMcAAvZbsjcTc/edit?pli=1&tab=t.0#heading=h.4zj1jq66y5an),
so the code is easier to read, maintain and unified across Discover.
2025-06-25 16:00:47 +02:00
Mason Herron
1184cc2832
[Fleet] Update /uninstall_tokens API to use exact matching for policy_id query (#225113)
## Summary

Closes #215725 

- Updated the regex to not wrap the policy_id in wildcards so that only
exact matches based on the query would be returned.

Before: 


https://github.com/user-attachments/assets/ad2bd58a-4dad-48a6-85e1-980630753a93




After: 


https://github.com/user-attachments/assets/2e7ebc97-e5ac-401e-8b23-ea54f758e35f


### 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>
2025-06-25 07:52:11 -06:00
elastic-renovate-prod[bot]
5f2a519926
Update docker.elastic.co/wolfi/chainguard-base-fips:latest Docker digest to 7f2cebd (main) (#224774)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base-fips | digest | `d55453a` ->
`7f2cebd` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDpza2lwIiwiY2k6YnVpbGQtZG9ja2VyLWZpcHMiLCJyZWxlYXNlX25vdGU6c2tpcCJdfQ==-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2025-06-25 08:48:27 -05:00
elastic-renovate-prod[bot]
d87db2a919
Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to a02075b (main) (#223588)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base | digest | `fdfd7f3` ->
`a02075b` |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJUZWFtOk9wZXJhdGlvbnMiLCJiYWNrcG9ydDpza2lwIiwicmVsZWFzZV9ub3RlOnNraXAiXX0=-->

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2025-06-25 08:47:59 -05:00
Katerina
0e932d031e
[Discover][Oblt] Enable Attributes tab by default (#224894)
## Summary

closes https://github.com/elastic/kibana/issues/224883
2025-06-25 14:41:45 +01:00
Srdjan Lulic
05b4fdd854
[Obs AI Assistant] Add custom plugin for highlighting user and assistant responses when they have redacted entities (#224605)
Closes: https://github.com/elastic/obs-ai-assistant-team/issues/264

## Summary

Add custom plugin for highlighting user and assistant responses when
they have redacted entities:

- Custom plugin for `EuiMarkdownFormat` that highlights all content
wrapped inside anonymized node. The parsing plugin follows the approach
from [EUI
docs](https://eui.elastic.co/docs/components/editors-and-syntax/markdown/plugins/#putting-it-all-together-a-simple-chart-plugin)
and is used as follows:
   ```
!{anonymized{"entityClass":"<entity class>", "content": "<content"}}
    ```  
- Highlighted content is currently rendered as `EuiCode`, but it can be
more sophisticated (i.e highlight differently depending on the entity
class).
- Allows using the same highlighting logic for messages from both `user`
and `assistant` roles.
- Currently **skipping highlighting inside the code blocks** - may
require customising the default plugins further.

Manually tested: 
- Function calling seems to work as expected.
- Search results with PII are highlighted in the table.
- Custom regex matches are highlighted correctly.

### Testing instructions:
1. Used setup from https://github.com/elastic/kibana/pull/216352 to set
up NER model locally.
2. Added to `kibana.dev.yml`:
```
uiSettings:
  overrides:
    'observability:aiAssistantAnonymizationRules': |
      [
        {
          "type": "regex",
          "pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[A-Za-z]{2,}",
          "enabled": true,
          "entityClass": "EMAIL"
        },
        {
          "type": "regex",
          "pattern": "https?://[^\\s]+",
          "enabled": true,
          "entityClass": "URL"
        },
        {
          "type": "regex",
          "pattern": "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b",
          "enabled": true,
          "entityClass": "IP"
        },
        {
          "type": "ner",
          "enabled": true
        }
      ]
```
3. Used the assistant (see screenshots below)

### Screenshots
<img width="689" alt="image"
src="https://github.com/user-attachments/assets/d1f9bd57-7e76-43dc-88a6-d0be5fb15092"
/>

<img width="689" alt="image"
src="https://github.com/user-attachments/assets/ed63626b-b32d-45f8-9cf4-c575320d0dfc"
/>


<img width="689" alt="image"
src="https://github.com/user-attachments/assets/0b591158-9186-406a-aab3-e3be538216dc"
/>



### 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]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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)
2025-06-25 14:41:19 +01:00
Dario Gieselaar
f655d88a41
@kbn/std: helper for external variants (#225270)
Adds a `fromExternalVariant` helper function that unpacks external
variants (which are commonly used in Elasticsearch APIs) into a fully `{
type, value }` object.

## Notes

I used o3 to write the tests, including unit tests and type tests.
2025-06-25 15:41:03 +02:00
Katerina
bc5a533202
[APM] Fix Agent Explorer page (#225071)
## Summary

closes https://github.com/elastic/observability-error-backlog/issues/154

### Before


https://github.com/user-attachments/assets/288fb639-351a-4738-811e-44ed03649f5b






### After 




https://github.com/user-attachments/assets/5df0a45a-7d35-467d-963c-2a80b28ff120
2025-06-25 14:29:48 +01:00
Paul Tavares
c28fd76508
[Security Solution][Endpoint] Fix create of endpoint artifacts to ensure global items require the global artifact management privilege (#225157)
## Summary

- Fix the create of Event Filters, Blocklists, Endpoint Exceptions and
Host Isolation Exceptions so that an error is returned when space
awareness feature is enabled and the user does not have the Global
Artifact Management privilege.

> [!NOTE]
> Trusted Applications were already correctly validating this during
create of an artifact

### 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
2025-06-25 08:49:03 -04:00
Edgar Santos
3b0c225c38
[follow up] small ui refactoring (#225234)
## Summary
This PR is a follow up of https://github.com/elastic/kibana/pull/225070,
addressing the remaining comments regarding the UI.
- moved some common text to their own translation variables
- added missing period to the end of a sentence for consistency

![image](https://github.com/user-attachments/assets/292fd417-2d50-4d32-98d2-df029db06b15)
2025-06-25 14:41:26 +02:00
Mykola Harmash
4250dfb258
Remove playwright-chromium package from dependencies (#225221)
This change remove `playwright-chromium` package from Kibana
dependencies.
* The package isn't used anywhere in the codebase
* The package conflicts with `@playwright/test` by installing the same
`playwright` executable which then misses a bunch of features, including
the `test` command
2025-06-25 14:36:51 +02:00
Sean Handley
b3d08001e1
Adds missing model Claude 3.7 to accepted models (#224943)
## Summary

With the new Claude 3.7 Elastic Managed LLM we're seeing an unhandled
error in Kibana playground. We can reproduce it by:

1. Indexing few but very large documents in Elasticsearch (10 docs, each
7mb)
2. Setting the docs to send setting as 10
3. Setting context to always query the index (I think there is some
function calling, not sure what happens under the hood but this worked
as I wanted to consistently).


![image](https://github.com/user-attachments/assets/5e926f0a-f8bd-4685-bbaa-4187700e01b2)

Thread:
https://elastic.slack.com/archives/C08DT72KR6J/p1750686748616369?thread_ts=1750685837.561949&cid=C08DT72KR6J

We're not 100% sure this fixes the issue but we do know the model should be added.

### Checklist

Check the PR satisfies following conditions. 

- [ ] Cannot reproduce the issue after the model entry is used on QA
environment

Reviewers should verify this PR satisfies this list as well.

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

No known risks
2025-06-25 13:26:27 +01:00
Cristina Amico
550b9d58ea
[Fleet] Replace call to registry when deleting kibana assets for custom packages (#224886)
Fixes https://github.com/elastic/kibana/issues/224191

## Summary

Bugfix - Replace call to registry when deleting kibana assets for
packages of type "custom" and "bundled". Also replaced the call to
`fetchInfo.registry` on another code path to avoid errors in the same
situation -
- These calls are replaced with `getPackageInfo`, that has some internal
functionalities to decide when the packageInfo should be fetched from
the cache, ES or the registry.
- Added additional logging to the delete assets functions

### Testing
- Install a custom integration that has some assets (a dashboard for
instance)
- Uninstall it and check that the asset is correctly removed and there
are no errors:

<img width="1453" alt="Screenshot 2025-06-25 at 11 02 39"
src="https://github.com/user-attachments/assets/32fb07f3-2628-4e30-be92-16610043b3ae"
/>


### Checklist

- [ ] [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-06-25 14:21:41 +02:00
Kurt
e31f1a584f
Upgrading pbkdf2 (#225160)
## Summary

Upgrade `pbkdf2` from `v3.1.2` to `v3.1.3`

## Changelog
https://github.com/browserify/pbkdf2/blob/master/CHANGELOG.md

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 08:14:50 -04:00
Jan Monschke
1683180a2b
[Cases] Add incremental id service and expose the ID in the UI (#222874)
## Summary

This adds and enables the case id incrementer service ([design
doc](https://docs.google.com/document/d/1DZKTPl7UryYjpjVMNhIYbE82OADVOg93-d02f0ZQtUI/edit?tab=t.0#heading=h.6qjc4qynaeuo)).
In order not to stress bulk creation of cases, we're processing
incremental ids asynchronously, meaning they will not immediately appear
in the UI.

The feature is currently disabled by default to allow for testing in
additional environments after merging but can be enabled by setting
`xpack.cases.incrementalIdService.enabled=true` in `kibana(.dev).yml`.
Once the flag is enabled, actually rendering the IDs in the UI is
disabled by default (for now) and has to be enabled in the advanced
settings (`cases:incrementalIdDisplay:enabled`).

Cases can be found by their incremental ID by searching for
`#{incremental_case_id}` in the cases table.

### Screenshots

**Incremental ID in the case detail page**

<img width="1506" alt="Screenshot 2025-06-05 at 15 46 42"
src="https://github.com/user-attachments/assets/f51ae0cd-a2e8-48f7-a6db-05f9f1285e95"
/>

**Incremental ID in the cases table**

<img width="1240" alt="Screenshot 2025-06-05 at 20 32 32"
src="https://github.com/user-attachments/assets/619b3f12-1986-4bc7-b9e8-f7556d0c546c"
/>

**Searching for case by its incremental ID**
<img width="1239" alt="Screenshot 2025-06-05 at 20 33 36"
src="https://github.com/user-attachments/assets/771df512-7436-4aa0-88f9-ac3e1e161455"
/>

### Testing notes

<details>
<summary>Validation script</summary>

Use this script to investigate if there are duplicates or gaps:

```js
import * as fs from 'fs';

// Query to get all cases from all namespaces sorted by incremental_id
// GET .kibana_alerting_cases/_search?_source_excludes=*
// {
//     "query": {
//         "exists": {
//             "field": "cases.incremental_id"
//         }
//     },
//     "fields": [
//       "cases.incremental_id",
//       "cases.title",
//       "namespaces"
//     ],
//     "from": 0,
//     "size": 10000,
//     "sort": [
//       {
//         "cases.incremental_id": {
//           "order": "asc"
//         }
//       }
//     ]
// }
// Put those results into `test.json` in the same directory

// You might need to add `"search_after": [40007]` in case you want to look at more than 10k cases.
// In that case, replace `[40007]` with whatever value the last item has in `"sort": [2102]`

// Concatenate hits if needed (10k per file)
const cases = [
  JSON.parse(fs.readFileSync('./test.json')),
  // JSON.parse(fs.readFileSync('./test1.json')),
  // JSON.parse(fs.readFileSync('./test2.json')),
  // JSON.parse(fs.readFileSync('./test3.json')),
  // JSON.parse(fs.readFileSync('./test4.json')),
].reduce((allHits, currResult) => {
  return allHits.concat(currResult.hits.hits);
}, []);

console.log(`Total amount of cases: ${cases.length}`);

// Groups cases but
const casesByNamespace = cases.reduce((acc, theCase) => {
  const id = theCase._id;
  const space = theCase.fields.namespaces[0];
  const incrementalId = theCase.fields['cases.incremental_id'][0];
  const title = theCase.fields['cases.title'][0];
  const toStore = { id, incrementalId, title };
  if (!acc[space]) {
    acc[space] = new Map();
  }

  // check for duplicates
  const spaceMap = acc[space];
  if (!spaceMap.has(incrementalId)) {
    acc[space].set(incrementalId, toStore);
  } else {
    const storedCase = spaceMap.get(incrementalId);
    console.error(`
      ${storedCase.title} and ${toStore.title} have the same incremental id (${incrementalId})
    `);
  }
  return acc;
}, {});

// find gaps in spaces
Object.keys(casesByNamespace).forEach((space) => {
  const spaceHits = casesByNamespace[space];
  const gaps = [];
  spaceHits.forEach(({ incrementalId }, _, map) => {
    const idBefore = incrementalId - 1;
    if (incrementalId > 1 && !map.has(idBefore)) {
      gaps.push(idBefore);
    }
  });

  console.log(`space:${space} has ${spaceHits.size} cases and ${gaps.length} skipped ids`);
  gaps.forEach((gap) => console.log(`id #${gap} is not assigned`));
});

```


</details>

- Enable the logger in your `kibana.dev.yml` (optional but helpful)
```
logging.loggers:
  - name: plugins.cases.incremental_id_task
    level: debug
```
- Change some of the timings in
`x-pack/platform/plugins/shared/cases/server/tasks/incremental_id/incremental_id_task_manager.ts`
  - Set `timeout: '1m'`
  - Set `CASES_INCREMENTAL_ID_SYNC_INTERVAL_DEFAULT_MINUTES = 1`
  - Remove ```runAt: new Date(
new Date().getTime() +
CASES_INCREMENTAL_ID_SYNC_INTERVAL_DEFAULT_MINUTES * 60 * 1000
          ),```
- you can also set the timings to something lower in the seconds e.g.
`10s`
- Generate a bunch of cases with the generator script
`x-pack/platform/plugins/shared/cases/scripts/generate_cases.js`:
  - `node scripts/generate_cases.js -c 1000 -o securitySolution
- Enable `cases:incrementalIdDisplay:enabled` in advanced settings
- Wait a couple minutes until the incrementer task ran
- Test that the ids show up and that the search works

### Research notes

- We ran a large-scale test with ~350k cases in a cloud env and can
report the following findings:
- The 10min timeout for the incremental id task makes sense. The task
was usually finished after around 8-9min (processing 1000 cases at a
time) which gives it some buffer even.
- While processing the first 50k cases, the service skipped 8 ids and no
duplicates have been assigned. This means it skipped `0.016%` ids which
is great.
- It's unclear when these skips happened though and we investigated the
first 50k cases for duplicate ids, just in case, and found no
duplicates.
- At no point did any of the error logs trigger, meaning the task is
running smoothly.

### 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: Michael Olorunnisola <michael.olorunnisola@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 08:04:58 -04:00
Sonia Sanz Vivas
493ca9f106
[Data Streams] Fix forward-compatibility api test failures (#224795)
Fixes https://github.com/elastic/kibana/issues/223990

## Summary

This PR fixes the forward-compatibility test for index mode, which
failed because the index mode was added to Get Data Streams API in 8.19
and 9.1 (see https://github.com/elastic/elasticsearch/pull/122486), so
if Kibana 8.19 is run with Es 9.0, the index mode is always displayed as
"Standard" because Es doesn't return an index mode field.

In this PR, we separate all index mode-related tests into a separate
file, and only run it for Es versions 8.19 or 9.1+.

This was also fixed for functional tests in
https://github.com/elastic/kibana/pull/223129

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 12:55:46 +01:00
Steph Milovic
b82ab8acb8
[Security Assistant] Starter prompts (#224981) 2025-06-25 13:52:31 +02:00
Faisal Kanout
e140d226bd
FIX - Failing test: Stateful Observability - Deployment-agnostic Feature Flag API Integration Tests.x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/synthetics/custom_status_rule·ts - Stateful Observability feature flag testing - Deployment-agnostic API integration tests SyntheticsCustomStatusRule "after all" hook in "SyntheticsCustomStatusRule" (#225090)
## Summary

It fixes #224778
 Falky test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8441
### 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

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)
- [ ] ...
2025-06-25 13:15:24 +02:00
elastic-vault-github-plugin-prod[bot]
b89e1e0774
[main] Sync bundled packages with Package Storage (#225145)
Automated by
https://buildkite.com/elastic/package-storage-infra-kibana-discover-release-branches/builds/2975

Co-authored-by: elasticmachine <elasticmachine@elastic.co>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2025-06-25 12:46:58 +02:00
James Gowdy
0d2930b3d0
ES|QL pattern formatting (#222871)
Adds a recommended query for the `CATEGORIZE` function in ES|QL.
Adds keyword highlighting for the patterns and the ability to open a new
Discover tab to filter for docs which match the selected pattern.


https://github.com/user-attachments/assets/9ed8c5b0-7e92-4cc8-88dd-cb7749b5ffd3

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2025-06-25 11:33:30 +01:00
Tomasz Ciecierski
831004deac
[EDR Workflows] Enable runscript feature flag (#224819) 2025-06-25 11:36:03 +02:00
Stratoula Kalafateli
a07c4608e4
[ES|QL][Controls] Listen to ?_tstart and ?_tend named params (#225054)
## Summary

Passes the timeRange into the `getESQLResults` in order the queries witj
`_tstart` and `_tend` to work properly

<img width="1280" alt="image"
src="https://github.com/user-attachments/assets/4f03b0c7-6d3c-40e2-8775-b2d9b2f22c02"
/>


### Checklist
- [ ] [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
2025-06-25 11:31:30 +02:00
Kibana Machine
f9d2c33852 skip failing test suite (#225172) 2025-06-25 11:22:44 +02:00
Shahzad
f317cec25b
[Synthetics] Multi space monitors !! (#221568)
## Summary

Multi space monitors !!

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

User will be able to choose in which space monitors will be available !!

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/f01ac226-ed54-4e96-b6f4-27f0134a9be5"
/>


### Technical 
This is being done by registering another saved object type and for
existing monitors it will continue to work as right now but for newly
created monitors user will have ability to specify spaces or choose
multiple spaces or all.

### Testing

1. Create few monitors before this PR in multiple spaces
2. Create multiple monitors in multiple spaces after this PR
3. Make sure filtering, editing and deleting, creating works as expected
on both set of monitors

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 10:47:47 +02:00
Kenneth Kreindler
b2d91b43f3
[Core] Improve log message for topological order (circular dependency) errors (#222039)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Make it easier to debug topological plugin order errors by including the
exact cycle/s causing the issue in the error message:


![image](https://github.com/user-attachments/assets/e6c61967-cfba-4729-b506-175b468015d0)

Previous error message:
```
Error: Topological ordering of plugins did not complete, these plugins have cyclic or missing dependencies: 

["discover","esql","canvas","crossClusterReplication","discoverEnhanced","indexLifecycleManagement","logstash","monitoring","observabilityAiAssistantManagement","remoteClusters","reporting","rollup","contentConnectors","dataQuality","datasetQuality","fleet","indexManagement","ml","osquery","streamsApp","apm","exploratoryView","infra","inventory","observability","observabilityAIAssistantApp","observabilityLogsExplorer","observabilityOnboarding","streamsAppWrapper","slo","synthetics","uptime","ux","enterpriseSearch","searchAssistant","searchIndices","searchInferenceEndpoints","searchPlayground","cloudSecurityPosture","elasticAssistant","securitySolution","securitySolutionEss"]
```

New error message tells you exactly where the cycle is:
```
Error: Topological ordering of plugins did not complete due to circular dependencies:

Detected circular dependencies:
  discover -> elasticAssistant -> ml -> discover

Plugins with cyclic or missing dependencies: ["discover","esql","canvas","crossClusterReplication","discoverEnhanced","indexLifecycleManagement","logstash","monitoring","observabilityAiAssistantManagement","remoteClusters","reporting","rollup","contentConnectors","dataQuality","datasetQuality","fleet","indexManagement","ml","osquery","streamsApp","apm","exploratoryView","infra","inventory","observability","observabilityAIAssistantApp","observabilityLogsExplorer","observabilityOnboarding","streamsAppWrapper","slo","synthetics","uptime","ux","enterpriseSearch","searchAssistant","searchIndices","searchInferenceEndpoints","searchPlayground","cloudSecurityPosture","elasticAssistant","securitySolution","securitySolutionEss"]
```

### 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]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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] 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)
- [X] 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.
- [X] [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

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: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
2025-06-25 09:31:42 +01:00
Dzmitry Lemechko
fbddd79f24
[ska] relocate x-pack/test/osquery_cypress (#225104)
## Summary

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

This PR is mostly about moving osquery cypress dir with
security-solution imports

```
x-pack/test/osquery_cypress
```

After: 
```
x-pack/solutions/security/test/osquery_cypress
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-25 10:12:35 +02:00
elastic-renovate-prod[bot]
afb9a927bc
Update dependency @launchdarkly/node-server-sdk to ^9.10.0 (main) (#225186)
Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2025-06-25 08:29:52 +01:00
Alex Szabo
f2a3ac796a
[ci] Silence SASS warnings (#225061)
## Summary
Silences SASS module usage warnings around the deprecated `@import`
statements.

While the sass/scss owner teams are migrating these usages, the dev
server is clogged up with deprecation warnings. It's probably best to
disable it, because it's annoying to everyone and not necessarily to the
owners.
2025-06-25 09:28:35 +02:00
Julia Bardi
3bdd4a8ba1
[Fleet] Fix export CSV in Agent list (#225050)
## Summary

Export CSV currently failing with the error `Unknown key for a
VALUE_STRING in [type]`

<img width="1163" alt="image"
src="https://github.com/user-attachments/assets/3935247e-adf3-49d2-aa9f-2ac561a7956e"
/>

To verify, try exporting in Agent list, and check that the CSV contains
the expected rows.

<img width="1166" alt="image"
src="https://github.com/user-attachments/assets/184976b7-2af5-4929-83e8-9b0cba9f6ae6"
/>
<img width="1177" alt="image"
src="https://github.com/user-attachments/assets/711737c8-d054-4fa3-93c5-8c9749b805fb"
/>
2025-06-25 09:19:52 +02:00
Julia Rechkunova
73be8df9db
[OneDiscover][Tabs] Show the correct query in the unvisited tab preview (#225032)
- Closes https://github.com/elastic/kibana/issues/221507

## Summary

This PR fixes the query which is shown in the tab preview popover.
Before it was working correctly only for already visited tab.
Now it should work for all tabs (once they are restored from local
storage after a page refresh).

![Jun-24-2025
13-49-30](https://github.com/user-attachments/assets/e7150aee-a7ad-47ec-941a-587a05ed7989)
2025-06-25 09:18:04 +02:00
Jatin Kathuria
2ed4e8a341
[One Discover][Security Solution] Replace the use of Ecsflat with fieldsMetadata (#225105)
## Summary

As per
[comments](https://github.com/elastic/kibana/pull/204756#discussion_r2162038673)
by @davismcphee , this PR removes the usage of `EcsFlat` and replaces it
with `fieldsMetadata`.
2025-06-25 08:28:05 +02:00
Kibana Machine
401ddc0d56
[api-docs] 2025-06-25 Daily api_docs build (#225198)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/1114
2025-06-25 07:05:17 +01:00