Commit graph

81980 commits

Author SHA1 Message Date
Eyo O. Eyo
7370cc712e
ES Lint rules for css-in-js declarations within Kibana (#200703)
## Summary

Closes https://github.com/elastic/kibana-team/issues/1272

This PR adds implementation for eslint rules to help facilitate the
migration away from SASS files to leveraging the design tokens EUI
provides for styling.

The introduced rules  in this PR are as follows;

- #### No CSS Color values
  Consider; 

  ```tsx
  <EuiCode style={{ color: '#dd4040' }}>Hello World!</EuiCode>
  ```

this expression because it specifies the css color property, with a
valid [CSS color
value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value),
when the aforementioned rule is enabled depending on the set report
level set the user would get a feedback, see screenshot below;


<img width="735" alt="Screenshot 2024-11-20 at 12 46 17"
src="https://github.com/user-attachments/assets/d2f608dc-782c-4d83-88e6-92dfdd8f6101">

This rule also works for variables defined elsewhere in the code and
referenced as a value to the style prop, see screenshot below;

<img width="1658" alt="Screenshot 2024-11-26 at 13 29 45"
src="https://github.com/user-attachments/assets/f8aadf6b-318b-4c6a-b7c9-bb44fb867b58">

feedback will also be provided when some variable that is a literal
value is specified as a value for any earmarked property that should not
specify literal values.

<img width="1730" alt="Screenshot 2024-11-28 at 19 00 08"
src="https://github.com/user-attachments/assets/bc3a8674-9469-4c7a-b0c9-7a2bfa7f08dc">

feedback will be provided for referencing a member prop of some object
defined elsewhere as a value to any earmarked property that we have
deemed to not specify literal values

<img width="1676" alt="Screenshot 2024-11-29 at 11 36 44"
src="https://github.com/user-attachments/assets/c4537fbf-b2d8-46bb-ad5f-8582e8c9a932">

	Supports;
	- object values
	- object references
	- template literals
	- tagged templates 

This approach does not penalize variable declarations, only the usages
of any said variable when it doesn't conform to expectation

- #### Prefer CSS attributes for EUI components (optional)
  Consider; 

  ```tsx
<EuiCode style={{ someCSSProperty: 'propertyValue' }}>Hello
World!</EuiCode>
  ```
A declaration like the one above, will be regarded as an error and can
be fixed, when it's fixed it will be re-written as
  
  ```tsx
<EuiCode css={{ someCSSProperty: 'propertyValue' }}>Hello
World!</EuiCode>
  ```

	
<!--

### 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_node:*` 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 15:56:52 +00:00
José Luis González
a5e25b2d5d
[Search][a11y] Announce success and error events for screen readers (#203555)
## Summary

This PR fixes this issue https://github.com/elastic/kibana/issues/197400
were the UI didn't announce that the connector was deleted. As we do
with indices, after deleting a connector or Web Crawler the UI announces
this action with a Toast component which is announced by screen readers
like VoiceOver.

Added the attributes `aria-live="assertive"` and `role="alert"` to get
screen readers priority on this UI element to be announced over the rest
of the UI.
References: 
-
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live
-
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role

This change affects and fixes all the calls to the `flashSuccessToast`
method used when we delete an Index, a connector, a Search Application
and many more.



https://github.com/user-attachments/assets/b45b3ec4-1895-4c50-b926-a523882d8b25

### 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: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 16:55:38 +01:00
Lisa Cawley
cf620f023d
[DOCS] Add case subfeature privileges (#204295) 2024-12-16 15:53:28 +00:00
Rodney Norris
18fb5a5812
test(search): fix flakey solution nav (#204275)
## Summary

Closes #201037

- unskipping search solution navigation tests
- removing canvas from checks
- canvas only renders if you have canvases, this seems to have broken
and make solution nav tests flakey. removing canvas from our checks
- removed ent-search apps these links were removed in another PR but I
missed updating this test because it was skipped
- added names for the test spaces
- added some expects when opening sections to ensure they are open
before moving on. I saw some flakes locally without these.

### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 09:50:54 -06:00
Samiul Monir
07c64de7ef
[Search][A11Y] Playground -> Open AI form (#202071)
## Summary

refers
https://github.com/elastic/kibana/issues/195048#issuecomment-2393788073

The goal is to display a high-level error message at the top of the
form. We don’t need to show specific details but can provide a general
hint, such as `There are some errors in the form`. When using a screen
reader, this message will indicate that the form submission failed due
to errors.

Each individual field will then be responsible for displaying its own
specific error messages.

This approach ensures compliance with A11Y standards.

### PR Screen Record

#### Add


https://github.com/user-attachments/assets/2e6c3304-0ad1-4d84-acc0-f9413e1fd73f

#### Edit


https://github.com/user-attachments/assets/7f54114c-4b95-40cd-bdec-f506d7151674



### 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/packages/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: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 10:49:37 -05:00
Gerard Soldevila
d18a44c042
Sustainable Kibana Architecture: Relocate script v4 (#204383)
## Summary

* Auto-detect "upstream" and "origin" remotes (instead of assuming their
names).
* Allow relocating modules that are already in a "sustainable" folder.
  * Filter out modules that are in the correct locations.
* Update the list of _modules to relocate_ to show only those modules
that are actually moved.

---------

Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2024-12-16 09:45:31 -06:00
Umberto Pepato
713d4bbcb2
[ResponseOps][Rules] Add loading state to rule params data views selector (#203654)
## Summary

Introduces a loading state in the data views select popover and renders
a loading indicator when DVs are not available yet. This makes sure that
even if the `savedObjectsClient.find` call of the data views service
takes a long time, we don't show an empty popover in the meantime.


https://github.com/user-attachments/assets/5bbe0c68-3ceb-4d7f-91fd-357db4caa5c1

## References

Fixes #198502 

## Release note

Fix race condition in alerting rules data view selector
2024-12-16 09:43:13 -06:00
Ash
8f6e3ca6f9
[SecuritySolution][Endpoint] Unskip ftr tests (#204405)
## Summary

closes https://github.com/elastic/kibana/issues/203909
closes https://github.com/elastic/kibana/issues/203910
closes https://github.com/elastic/kibana/issues/203908
closes https://github.com/elastic/kibana/issues/203903
closes https://github.com/elastic/kibana/issues/203906
closes https://github.com/elastic/kibana/issues/203897
closes https://github.com/elastic/kibana/issues/203893
closes https://github.com/elastic/kibana/issues/203898

### 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)
- [ ] ...
2024-12-16 09:42:49 -06:00
Marius Iversen
0d34191d5f
[Rule Migration] (#204243)
## Summary

This PR is one of two, this one prepares for the new lookup join feature
by removing the inline parts in the prompts, and adding some basic
translation context in translate_rule.

Things that could be done in this PR or the next is:
1. Move square bracket replacement of missing resources to
process_query.
2. Add replace lookup index name to process_query.
3. Ensure LOOKUP JOIN context is added to NLtoESQL system prompts
sometime.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 16:38:34 +01:00
Elena Shostak
a25f1954bf
Removed TLSv1.1 from default set of supported protocols (#203856)
## Summary

Removed `TLSv1.1` from default set of supported protocols.


### Checklist

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


## Release Note
Removed `TLSv1.1` from default set of supported protocols

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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 16:27:44 +01:00
Sergi Romeu
5077e6d63d
[APM] fix logger on telemetry (#204388)
## Summary

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

This PR fixes the logger calls on APM telemetry
2024-12-16 09:22:07 -06:00
Matthew Kime
67d7547150
Revert "[index management] Borealis theme improvements" (#204400)
Reverts elastic/kibana#204161
2024-12-16 09:16:40 -06:00
James Gowdy
6f38a4c46f
[MAPS] Updating file upload privileges for maps test user (#203992)
Clears deprecation warning triggered by maps file upload test.
The role used by the test user needs to now include `manage`

This should clear the `elastic/kibana-presentation` deprecation warnings
raised [here](https://github.com/elastic/kibana-team/issues/1173)
2024-12-16 14:52:02 +00:00
Jeramy Soucy
4ea032eb48
Corrects the default max spaces in non-serverless docs (#203857)
## Summary

The max spaces is described as 100, but should be 1000 by default only
in our non-serverless offerings. Only serverless is currently limited to
100.

See
https://www.elastic.co/guide/en/kibana/current/xpack-spaces.html#spaces-managing

---------

Co-authored-by: wajihaparvez <wajiha.parvez@elastic.co>
2024-12-16 14:40:13 +00:00
Janki Salvi
279f4aec6f
[ResponseOps][Rules] Delete legacy routes (#203148)
## Summary

Resolves https://github.com/elastic/kibana/issues/195179
Resolves https://github.com/elastic/kibana/issues/192558

This PR deletes deprecated legacy alerts routes `api/alerts/alert` in
v9.0.
It also updates docs to reflect the same.


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials



### Release notes
Deleted deprecated alerts routes.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-16 08:35:28 -06:00
Karen Grigoryan
3a6d27af37
[React@18] Improve console.error suppression in react-testing-library setup (#201142) (#202600)
In addition to changes introduced by #201142

Reasoning:

This pull request includes changes to the
`packages/kbn-test/src/jest/setup/react_testing_library.js` file to
improve internal error logging suppression from react-testing-library.
In particular,
[this](1e01273374/src/core/console.ts (L1-L4))
suppression logic has been migrated to avoid breaking devUX
expectations.

Tested against https://github.com/elastic/kibana/pull/201142 code
changes
2024-12-16 14:41:10 +01:00
Gerard Soldevila
863d047983
Sustainable Kibana Architecture: Fix incorrect CODEOWNERS entries (#204370)
## Summary

Follow-up to https://github.com/elastic/kibana/pull/203682
2024-12-16 07:38:14 -06:00
Kibana Machine
0e3eb00a9f skip failing test suite (#204323) 2024-12-17 00:37:34 +11:00
Matthew Kime
9ab5746593
[index management] Borealis theme improvements (#204161)
## Summary

Some simple theme updates outlined in
https://github.com/elastic/kibana/issues/199715

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-16 07:33:47 -06:00
Bharat Pasupula
eb1c70a1a2
[Automatic Import] Add RBAC to APIs (#203882)
## Release Note

Adds RBAC to the Automatic Import APIs

## Summary

This PR adds RBAC privileges to Automatic Import APIs

It adds `all` access to the users having `fleet:all` `fleetv2:all`
`actions:all` UI access

This PR also adds a validation to the `integrationName` and
`dataStreamName`.

### 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
- [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>
2024-12-16 06:42:44 -06:00
Alejandro Fernández Haro
a8eb7ca81b
Flaky FTR: Retry telemetry config get (#204354) 2024-12-16 13:41:19 +01:00
Alejandro Fernández Haro
2ed34427c0
[Deprecations] Logs Sources settings in all spaces (#203042) 2024-12-16 13:40:56 +01:00
Rudolf Meijering
af566c0398
Skip UA deprecation logs test to allow ES promotion (#203491)
## Summary

Related https://github.com/elastic/kibana/issues/203044
Skips failing test to allow for ES promotion. Once promoted we can
re-enable and merge https://github.com/elastic/kibana/pull/203418 which
fixes this test.
2024-12-16 06:37:42 -06:00
Kibana Machine
bc46f483de
Unauthorized route migration for routes owned by kibana-visualizations (#198335)
### Authz API migration for unauthorized routes

This PR migrates unauthorized routes owned by your team to a new
security configuration.
Please refer to the documentation for more information: [Authorization
API](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)

### **Before migration:**
```ts
router.get({
  path: '/api/path',
  ...
}, handler);
```

### **After migration:**
```ts
router.get({
  path: '/api/path',
  security: {
    authz: {
      enabled: false,
      reason: 'This route is opted out from authorization because ...',
    },
  },
  ...
}, handler);
```

### What to do next?
1. Review the changes in this PR.
2. Elaborate on the reasoning to opt-out of authorization.
3. Routes without a compelling reason to opt-out of authorization should
plan to introduce them as soon as possible.
2. You might need to update your tests to reflect the new security
configuration:
  - If you have snapshot tests that include the route definition.

## Any questions?
If you have any questions or need help with API authorization, please
reach out to the `@elastic/kibana-security` team.

---------

Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
2024-12-16 13:24:52 +01:00
Alejandro Fernández Haro
25b171d6d7
[Deprecations/Docs] Address uncommented apis (#204198)
## Summary

#203042 highlighted these APIs not having comments.


### Checklist


- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
2024-12-16 06:13:16 -06:00
Matthew Kime
bc5c097184
[watcher] Use ES Watcher API instead of search query (#204296)
## Summary

Simply uses the ES Watcher API to load watches instead of a search query
against the `.watches` index. This appears to be the last direct query
against that index.

Part of https://github.com/elastic/kibana/issues/152142
2024-12-16 06:04:15 -06:00
Julia
d0270e57ce
[ResponseOps] Get rid from dot in siem index name (#204196)
Fixes: https://github.com/elastic/kibana-team/issues/1334


Check the PR satisfies following conditions. 

- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 13:02:35 +01:00
Kibana Machine
7c1e74f509 skip failing test suite (#204158) 2024-12-16 22:59:48 +11:00
Kibana Machine
7b12118bda skip failing test suite (#204167) 2024-12-16 22:58:56 +11:00
Antonio
be8e29836b
[ResponseOps][Connectors]Migrate remaining routes. (#204042)
Connected with https://github.com/elastic/kibana-team/issues/1322

## Summary

This PR migrates the remaining response-ops routes that do not use
access tags.


[Documentation.](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization#opting-out-of-authorization-for-specific-routes)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-16 05:54:49 -06:00
Krzysztof Kowalczyk
3d79542b20
[Top Navigation] Close actions popover on click (#203830)
## Summary

This PR makes it so the actions popover closes after clicking on an
item.

Closes: #201358
2024-12-16 12:39:48 +01:00
Krzysztof Kowalczyk
73f6794df8
[FieldFormatters] Change bytes field title to Bytes and Bits (#204346)
## Summary

This PR updates the `title` of `Bytes` field to `Bytes and Bits` as
suggested in
https://github.com/elastic/kibana/issues/154188#issuecomment-2474336830

Closes: #154188
2024-12-16 12:36:10 +01:00
Robert Jaszczurek
ea85f0551c
[ML] Anomaly Explorer: Enhancements for Embeddables with Selected Groups & Explorer Refactor (#203224)
## Summary

Fixes issues around handling groupIds in Anomaly Explorer:
[#198824](https://github.com/elastic/kibana/issues/198824)

* `UrlStateService` is now more generic, allowing for the creation of
`useGlobalUrlState` and `usePageUrlState` hooks based on it.
* New `useGlobalUrlState` hook: Responsible for managing global state
with proper typing.
* `id_badges.js` converted to typescript -> `id_badges.tsx` 
* The use of `maps` in the `id_badges`, `job_selector` and
`job_selector_flyout` components has been removed. Now, selected group
and job ids are passed directly.
* Instead of manually setting the global state in `job_selector`, an
`onSelectionChange` callback is now expected. In the future, the
`Timeseries explorer` and `Anomaly Explorer` are expected to use a
(maybe) shared context to track selected jobs easily, eliminating the
need to manually update the global state for the `Timeseries explorer`.
* The `AnomalyExplorerCommonStateService` now listens for URL changes to
track properties derived from the URL. This replaces the `useUrlState`
hook, which lacked proper typing, and serves as the single source of
truth for selected jobs and groups.
* The `ExplorerDashboardService`, previously a hybrid of a "service" and
redux-like action handler, has been removed. The state is now managed
within `state_manager` component. In the future, data like `chartsData`
and `influencers` should be decoupled from `ExplorerState` and moved to
individual services.

1. Fix for all issues mentioned in #198824 as visible in the video:
- The initial group selection now results in the correct badge being
displayed.
- Creating an embeddable with a selected group properly propagates the
selected group instead of individual job ids.
- Navigating to the Anomaly Explorer from Dashboards now correctly uses
the selected group instead of individual job ids.


https://github.com/user-attachments/assets/82c641e0-d930-42eb-8627-fad4bdc417f6

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-12-16 11:50:38 +01:00
Eyo O. Eyo
90b77c6ab3
[React18] Migrate test suites to account for testing library upgrades search-kibana (#201157)
This PR migrates test suites that use `renderHook` from the library
`@testing-library/react-hooks` to adopt the equivalent and replacement
of `renderHook` from the export that is now available from
`@testing-library/react`. This work is required for the planned
migration to react18.

##  Context

In this PR, usages of `waitForNextUpdate` that previously could have
been destructured from `renderHook` are now been replaced with `waitFor`
exported from `@testing-library/react`, furthermore `waitFor`
that would also have been destructured from the same renderHook result
is now been replaced with `waitFor` from the export of
`@testing-library/react`.

***Why is `waitFor` a sufficient enough replacement for
`waitForNextUpdate`, and better for testing values subject to async
computations?***

WaitFor will retry the provided callback if an error is returned, till
the configured timeout elapses. By default the retry interval is `50ms`
with a timeout value of `1000ms` that
effectively translates to at least 20 retries for assertions placed
within waitFor. See
https://testing-library.com/docs/dom-testing-library/api-async/#waitfor
for more information.
This however means that for person's writing tests, said person has to
be explicit about expectations that describe the internal state of the
hook being tested.
This implies checking for instance when a react query hook is being
rendered, there's an assertion that said hook isn't loading anymore.

In this PR you'd notice that this pattern has been adopted, with most
existing assertions following an invocation of `waitForNextUpdate` being
placed within a `waitFor`
invocation. In some cases the replacement is simply a `waitFor(() => new
Promise((resolve) => resolve(null)))` (many thanks to @kapral18, for
point out exactly why this works),
where this suffices the assertions that follow aren't placed within a
waitFor so this PR doesn't get larger than it needs to be.

It's also worth pointing out this PR might also contain changes to test
and application code to improve said existing test.

### What to do next?
1. Review the changes in this PR.
2. If you think the changes are correct, approve the PR.

## Any questions?
If you have any questions or need help with this PR, please leave
comments in this PR.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-12-16 04:48:13 -06:00
Ievgen Sorokopud
c92899e142
[Rules migration] Allow partial RuleResponse object to be passed to RuleOverviewTab (#204318)
## Summary

These changes allow `Partial<RuleResponse>` to be used as a parameter
for `RuleOverviewTab` component.

We re-use this component for "SIEM Migrations" feature to display
translated state of the rule which has just a few fields that represent
the `RuleResponse` object. The set of fields used in `RuleMigration`
object is a minimum set of fields enough for the rule creation.

Right now, `RuleOverviewTab` component requires the complete
`RuleResponse` object to be passed even though internally each section
(`RuleAboutSection`, `RuleDefinitionSection`, `RuleScheduleSection` and
`RuleSetupGuideSection`) of the rule's overview expects
`Partial<RuleResponse>`. To be able to use this component we force type
casting at the moment and would like to get rid of it.

@elastic/security-detection-rule-management do you have objects
regarding this change in `RuleOverviewTab` intefrace?

### 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
- Rule management cypress tests ([100 ESS & 100
Serverless](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7601))
2024-12-16 11:15:52 +01:00
Irene Blanco
73066e8cc3
[Infra] Update deprecated access tags to the new security configuration in routes (#204214)
## Summary

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

This PR replaces the deprecated `access` tags with the new `security`
configuration.

All instances of `options: {tags: ['access:infra']}` are now updated to
`security: {authz: {requiredPrivileges: ['infra']}}`.
2024-12-16 04:02:04 -06:00
Matthias Wilhelm
50713ca6d8
[Discover] Unskip and improve serverless csv functional test (#202396) 2024-12-16 02:49:16 -06:00
Maryam Saeidi
a0fe4e698a
[ES Query] Fix saving ECS group by fields for query DSL rule (#203769)
Fixes #203472

## Summary

|Rule|Group info|
|---|---|

|![image](55328973-d585-4148-a74f-d2c275b9989d)|

@elastic/response-ops What sort of test do you suggest to add for this
case?

### 🧪 How to run test

#### Deployment agnostic
- [x] Test on MKI
```
// Server
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts

// Test
node scripts/functional_test_runner --config=x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="ElasticSearch query rule"
```
2024-12-16 09:16:43 +01:00
Kibana Machine
3e674550cd
[ES|QL] Update grammars (#204333)
This PR updates the ES|QL grammars (lexer and parser) to match the
latest version in Elasticsearch.
2024-12-16 08:53:20 +01:00
Kibana Machine
612ddaaf71
[api-docs] 2024-12-16 Daily api_docs build (#204335)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/923
2024-12-16 01:07:12 -06:00
Kibana Machine
c29bb41188
[api-docs] 2024-12-15 Daily api_docs build (#204324)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/922
2024-12-15 01:47:05 -06:00
Nikita Indik
90e35a04bc
[Security Solution] Reduce dropdown options and improve tooltip texts in Rule Upgrade flyout (#203222)
**Partially addresses: #171520**

## Summary

This PR updates the tooltips for the ‘Diff view’ and ‘Final update’
sections in the prebuilt rule upgrade flyout. It also streamlines the
version picker by removing redundant options, making the UI simpler and
clearer for users.

## Changes
- Reduced the number of version picker items based on the diff outcome.
Updated item names for better clarity.
- Revised the tooltip text for the ‘Diff view’ section to better explain
the available dropdown options. The tooltip now describes only the
options in the dropdown to avoid overwhelming the user with unrelated
information.
-  Updated the tooltip text for the ‘Final update’ section.

## Screenshots
<img width="922" alt="Scherm­afbeelding 2024-12-11 om 11 54 48"
src="https://github.com/user-attachments/assets/124e76a1-99dc-48d8-be54-f6c8f2079451">

<img width="640" alt="Scherm­afbeelding 2024-12-11 om 11 55 32"
src="https://github.com/user-attachments/assets/45655dd2-6503-46b7-b28b-0df7bf0e6fa3">

<img width="433" alt="Scherm­afbeelding 2024-12-11 om 11 55 58"
src="https://github.com/user-attachments/assets/d845ff52-4678-4245-8bdd-b9957f0c1d13">


Work started on 06-Dec-2024.

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
2024-12-14 05:40:45 -06:00
Kevin Lacabane
9a8ed0d135
[eem] _count guards against no valid sources (#204224)
The query generation expects at least 1 source to be passed
2024-12-14 11:14:29 +01:00
Ievgen Sorokopud
7e4e8592f4
[Security Solution] AI Assistant: LLM Connector model chooser bug. New chat does not use connector's model (#199303) (#204014)
## Summary

The PR fixes [this bug](https://github.com/elastic/kibana/issues/199303)

The issue happens with some of the locally setup LLMs (like
[Ollama](https://github.com/ollama/ollama)) which requires the correct
`model` to be passed as part of the [chat completions
API](https://github.com/ollama/ollama/blob/main/docs/api.md#generate-a-chat-completion).

We had a bug in our code when on new conversation creation we would not
pass all the connectors configuration and only `connectorId` and
`actionTypeId` would be passed. Here is the old code implementation:

```
const newConversation = await createConversation({
  title: NEW_CHAT,
  ...(currentConversation?.apiConfig != null &&
  currentConversation?.apiConfig?.actionTypeId != null
    ? {
          apiConfig: {
            connectorId: currentConversation.apiConfig.connectorId,
            actionTypeId: currentConversation.apiConfig.actionTypeId,
            ...(newSystemPrompt?.id != null ? { defaultSystemPromptId: newSystemPrompt.id } : {}),
          },
        }
      : {}),
});
```

and thus the new conversation would not have the complete connector
configuration which would cause to use default model (`gpt-4o`) as a
model we pass to the LLM.

Also, I updated the default body that we use on the Test connector page,
to make sure that we send a model parameter to the LLM in case of `Open
AI > Other (OpenAI Compatible Service)` kind of connectors.

### Testing notes

Steps to reproduce:
1. Install
[Ollama](https://github.com/ollama/ollama?tab=readme-ov-file#ollama)
locally
2. Setup an OpenAI connector using Other (OpenAI Compatible Service)
provider
3. Open AI Assistant and select created Ollama connector to chat
4. Create a "New Chat"
5. The Ollama connector should be selected
6. Send a message to LLM (for example "hello world")

Expected: there should be no errors saying `ActionsClientChatOpenAI: an
error occurred while running the action - Unexpected API Error: - 404
model "gpt-4o" not found, try pulling it first`
2024-12-14 09:54:54 +01:00
Kibana Machine
c87a79483b
[api-docs] 2024-12-14 Daily api_docs build (#204297)
Generated by
https://buildkite.com/elastic/kibana-api-docs-daily/builds/921
2024-12-14 01:10:59 -06:00
Gerard Soldevila
39732db6da
Sustainable Kibana Architecture: Relocate script v3 (#204239)
## Summary

* Added link to rebase guideline in PR description.
* Do not count `elasticmachine` commits as manual.
* Replace references in CODEOWNERS file manual section.
* Update README prerequisites.
2024-12-13 17:15:31 -06:00
Ievgen Sorokopud
bee7f0f90e
[Rules migration] Add comments tab in the details flyout (#11385) (#204084)
## Summary

[Internal link](https://github.com/elastic/security-team/issues/10820)
to the feature details

These changes add a "Summary" tab within the migration rule details
flyout which will show the AI assistant comments about the translation
process of the rule.

## Screenshot

<img width="1675" alt="Screenshot 2024-12-12 at 17 39 30"
src="https://github.com/user-attachments/assets/213c3e80-70df-482a-8dfd-09fc1e2e54c8"
/>
2024-12-14 00:06:35 +01:00
Jiawei Wu
5a9129e22d
[Response Ops] Remove ephemeral tasks from task manager plugin (#201313)
## Summary

Resolves: https://github.com/elastic/kibana/issues/151463

Removes all reference to ephemeral tasks from the task manager plugin.
As well as unit and E2E tests while maintaining backwards compatibility
for `xpack.task_manager.ephemeral_tasks` flag to no-op if set. This PR
has some dependencies from the PR to remove ephemeral task support from
the alerting and actions plugin
(https://github.com/elastic/kibana/pull/197421). So it should be merged
after the other PR.

Deprecates the following configuration settings:

- xpack.task_manager.ephemeral_tasks.enabled
- xpack.task_manager.ephemeral_tasks.request_capacity

The user doesn't have to change anything on their end if they don't wish
to. This deprecation is made so if the above settings are defined,
kibana will simply do nothing.

### 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
2024-12-13 14:31:31 -08:00
elastic-renovate-prod[bot]
07a69023d3
Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to 1b51ff6 (main) (#203954)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| docker.elastic.co/wolfi/chainguard-base | digest | `ad2e15a` ->
`1b51ff6` |

---

### 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://togithub.com/renovatebot/renovate).

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

Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com>
2024-12-13 13:20:03 -08:00
Clint Andrew Hall
666a0cf971
[ai][assistant] Create AI Assistant Icon, Avatar, Beacon (#203879) 2024-12-13 15:18:35 -06:00