Commit graph

81161 commits

Author SHA1 Message Date
tinnytintin10
3231c122c7 testing-ess-build
Merge branch 'main' into tin-graph-ess-image-test
2024-11-25 21:07:09 -05:00
tinnytintin10
00a180c922 commit using @elastic.co 2024-11-25 20:39:56 -05:00
Lisa Cawley
ef975b2b13
[DOCS] Add more examples for generating openAPI documents (#200262)
## Summary

Relates to https://github.com/elastic/kibana/issues/181995
This PR updates the examples to include availability information and
another description.

Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
2024-11-25 19:18:50 -06:00
Rickyanto Ang
6d91a7c065
[Cloud Security][D4C] Hide K8S (#201062)
## Summary

This PR is to hide K8S so User won't be able to access K8S Dashboard via
navigating to it from the page or by direct URL,
also deleting Cypress tests related to this

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-25 15:24:17 -08:00
Ignacio Rivas
f7a274a4d6
[Console] Bootstrap kibana before running generator script (#201662) 2024-11-25 16:19:05 -06:00
elastic-renovate-prod[bot]
043149b356
Update dependency chromedriver to v131 (main) (#201053)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [chromedriver](https://togithub.com/giggio/node-chromedriver) |
devDependencies | major | [`^130.0.4` ->
`^131.0.0`](https://renovatebot.com/diffs/npm/chromedriver/130.0.4/131.0.0)
| `131.0.1` |

---

### Release Notes

<details>
<summary>giggio/node-chromedriver (chromedriver)</summary>

###
[`v131.0.0`](https://togithub.com/giggio/node-chromedriver/compare/130.0.4...131.0.0)

[Compare
Source](https://togithub.com/giggio/node-chromedriver/compare/130.0.4...131.0.0)

</details>

---

### 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>
Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
Co-authored-by: Jon <jon@elastic.co>
2024-11-25 15:57:12 -06:00
Yan Savitski
d99431e51e
[Search] [Playground] [Bug] Add playground index validation (#201032)
Fix bug when localStorage has invalid index, then playground chat page
opens with empty source.
2024-11-25 15:06:54 -06:00
Joey F. Poon
2e004f867f
[Security Solution] add initial workflow insights service (#199606)
## Summary

Adds an SecurityWorkflowInsightsService that is setup during security
solution plugin initialization. The service setup installs the component
templates, index template, and datastream used by the service.

Depends on:
- https://github.com/elastic/elasticsearch/pull/116485


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


### For maintainers

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

Co-authored-by: Konrad Szwarc <konrad.szwarc@elastic.co>
2024-11-26 04:04:06 +09:00
seanrathier
655cb79333
[Cloud Security] Remove preconfigured Agentless policy solution and feature flag (#197338) 2024-11-25 14:00:42 -05:00
Kylie Meli
1411c09ed5
[Automatic Import] remove duplicate preserve flag from http_endpoint (#201622)
## Summary

Removes an erroneous duplicate `Preserve Original Event` flag as we
additionally add one from the common settings file.
2024-11-25 13:33:28 -05:00
Jonathan Budzenski
29309b5f47 Revert "[ci] Remove archive kibana distribution (#199565)"
This reverts commit ac5e9b6653.
2024-11-25 12:24:30 -06:00
Sergi Massaneda
d3ee297d9f
[SecuritySolution][Navigation] Prevent initial re-render using project nav (#201431)
## Summary

Prevents an initial re-render when the `project` navigation style is set
(serverless and new solution nav for stateful).

This re-render was affecting all the top-level pages in Security
Solution.

---------

Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
2024-11-25 17:56:28 +00:00
Nathan Reese
cdeb1e9844
[dashboard] fix time_to_data does not capture entire client-side rendering (#200640)
Closes https://github.com/elastic/kibana/issues/194489

PR adds new `PublishesRendered` interface. Embeddables can implement
this interface to provide feedback when rendering is complete.

PR updates ReactEmbeddableRender phase tracking logic to include check
for `PublishesRendered` value when interface is implemented.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 10:51:05 -07:00
Sergi Massaneda
b6586a95f2
[Siem migrations] Implement UI service and migrations polling (#201503)
## Summary

Sends "Rule migration complete" notifications from anywhere in the
Security Solution app, whenever a rule migration finishes, with a link
to the migrated rules.

The polling logic has been encapsulated in the new
`siemMigrations.rules` service so the request loop is centralized in one
place. The value updates are broadcasted using the `latestStats$`
observable.
It will only keep requesting while there are _running_ migrations and
will stop automatically when no more migrations are _running_.

The reusable `useLatestStats` hook has been created for the UI
components to consume. This approach allows multiple components to
listen and update their content automatically with every rule migration
stats update, having only one request loop running.

The polling will only start if it's not already running and only if the
SIEM migration functionality is available, which includes:
- Experimental flag enabled
- _Enterprise_ license 
- TODO: feature capability check (RBAC
[issue](https://github.com/elastic/security-team/issues/11262))

The polling will try to start when:
- Automatically with the Security Solution application starts
- The first render of every page that uses `useLatestStats` hook.
- TODO: A new migration is created from the onboarding page
([issue](https://github.com/elastic/security-team/issues/10667))

Tests will be implemented in [this
task](https://github.com/elastic/security-team/issues/11256)

## Example

A Rule migration finishes while using Timeline in the Alerts page:


https://github.com/user-attachments/assets/aac2b2c8-27fe-40d5-9f32-0bee74c9dc6a
2024-11-25 18:48:02 +01:00
Ignacio Rivas
eb41db27b1
[Console] Always render editor hover states below the cursor (#201415) 2024-11-25 11:46:08 -06:00
Anton Dosov
ce27885874
Make dashboard listing load faster (#201401)
## Summary

close https://github.com/elastic/kibana-team/issues/1239
close https://github.com/elastic/kibana/issues/193109


This PR is an easy improvement to make dashboard listing load faster for
deployments with a lot of dashboards. See the investigation:
https://github.com/elastic/kibana-team/issues/1239#issuecomment-2491145140

For our overview cluster by excluding not needed references we reduce
the **gzipped** response size from **~550kb -> ~75kb**

Longer term we should implement proper server-side pagination
2024-11-25 18:27:43 +01:00
Maxim Palenov
dea9312246
[Security Solution] Unlock Prebuil Rules Customization workflow for rules with missing base version (#201301)
**Resolves: https://github.com/elastic/kibana/issues/200904**

## Summary

This PR unlocks Prebuilt Rules Customization workflow for rules with missing base version.

## Details

Each Prebuilt Rule update contains `version` diff. `version` is a special non-customizable field we use to track prebuilt rule version. It always gets target rule version's value after rule upgrade.

A generic `numberDiffAlgorithm` algorithm was used for `version` field. It produces a `SOLVABLE` conflict when rule's base version is missing. It blocked the workflow in UI. We check the number of field with conflicts versus resolved conflicts to decide when a rule is ready for upgrade. In case `version` field got a conflict user had no possibility to resolve it.

The fix adds a new `forceTargetVersionDiffAlgorithm` diff algorithm applied only for `version` field. It produces a non-conflict diff all the time even when base version is missing. The reason behind is that `version` always gets target rule's version.
2024-11-25 11:12:35 -06:00
Eyo O. Eyo
280961c962
[React18] Migrate test suites to account for testing library upgrades obs-knowledge-team,obs-ux-infra_services-team (#201169)
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-11-25 17:33:22 +01:00
Kibana Machine
33f06c5a85 skip failing test suite (#201071) 2024-11-26 03:31:07 +11:00
Kibana Machine
a81a47404a skip failing test suite (#200748) 2024-11-26 03:30:55 +11:00
Jon
ac5e9b6653
[ci] Remove archive kibana distribution (#199565)
This isn't used, carryover from jenkins.


cfbb8db093/test/scripts/jenkins_xpack_build_kibana.sh (L20-L26)
2024-11-25 10:23:31 -06:00
Sander Philipse
77f08541e1
[Search] Fix button without a11y aria-label (#201236)
Also adds a tooltip to the document count to explain why the count might differ.
2024-11-25 10:22:16 -06:00
Joe Reuter
493bd47db5
🌊 Data generation and fixes (#200783)
This PR adds a synthtrace scenario for the main logs streams endpoint
called `slash_logs`. It can be invoked like this:
```
node scripts/synthtrace.js slash_logs --live --kibana=http://elastic:changeme@localhost:5601 --target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000
```

## Changes on synthtrace

I had to adapt a couple things:
* Add the `--liveBucketSize` flag because it's really annoying to wait
for a minute to see whether data gets processed correctly
* Extend the existing log mock module that's also used for the
unstructured logs scenario in a couple ways
* Add the ability to route directly to an index by adding `_index` to a
document (otherwise it will use the DSNS)

## Changes on streams

I fixed a couple things I realized were broken:
* Check whether a field exists before accessing it in the routing
condition (otherwise it rejects the document)
* Update ES objects in the right order - if the routing is put in place
before the receiving child data stream is ready, it will auto-create an
index with the wrong mapping
* Allow to not specify a condition for a child - in this case it's not
routing to this child
* Set `subobjects: true` for now - otherwise fields are not indexed
properly, I think this is an Elasticsearch bug, I will follow up on this
with the Elasticsearch team
* Set `dynamic: false` - that somehow got lost in refactorings
2024-11-25 17:20:04 +01:00
Ignacio Rivas
c6a278b3f4
[Console] Update location yml config (#201634)
## Summary

Update location.yml with the missing entry from the newly added console
definitions pipeline https://github.com/elastic/kibana/pull/200935
2024-11-25 17:10:19 +01:00
seanrathier
f4be0979f2
[Cloud Security] [Agentless] Create GHA Cloud Security workflow sanity tests for Agentless ESS deployments. (#192182) 2024-11-25 10:08:32 -06:00
Cauê Marcondes
ff97e5234b
[Profiling x APM Integration] Use both host.hostname or host.name and container.id to correlate profiling data on APM (#201403)
closes https://github.com/elastic/kibana/issues/180036

The logic now, first checks if there are `container.ids` on the selected
service, if not, it falls back to the `host.name` or `host.hostname`.

## container.id
<img width="1320" alt="Screenshot 2024-11-25 at 10 53 44"
src="https://github.com/user-attachments/assets/b0515e7a-0319-4d88-bf39-3fbbba3ad957">
<img width="1300" alt="Screenshot 2024-11-25 at 10 53 55"
src="https://github.com/user-attachments/assets/66ceacfd-dc36-4f18-bdfa-67f656d41d36">
<img width="1303" alt="Screenshot 2024-11-25 at 11 06 55"
src="https://github.com/user-attachments/assets/57516d46-b2ee-41d4-9710-74a8b36124a9">


## host.name
<img width="1314" alt="Screenshot 2024-11-25 at 11 02 49"
src="https://github.com/user-attachments/assets/5b7c0cdf-267a-4874-bb29-b9ddba8fb53f">
<img width="1326" alt="Screenshot 2024-11-25 at 11 03 00"
src="https://github.com/user-attachments/assets/ab8eb946-4513-4b4b-8775-6b8be7fe6957">
<img width="1342" alt="Screenshot 2024-11-25 at 11 03 08"
src="https://github.com/user-attachments/assets/80017155-5bcb-4154-91ca-52b154b945b2">

## host.hostname
<img width="1323" alt="Screenshot 2024-11-25 at 11 04 24"
src="https://github.com/user-attachments/assets/a2a8df63-4049-463e-8bc2-88b7c05c727b">
<img width="1321" alt="Screenshot 2024-11-25 at 11 04 34"
src="https://github.com/user-attachments/assets/29d6532c-8027-4eb4-88bd-46d32ea56353">
<img width="1311" alt="Screenshot 2024-11-25 at 11 04 51"
src="https://github.com/user-attachments/assets/897bd883-014e-4d95-8ed6-d2263eceb490">
2024-11-25 15:51:23 +00:00
Tre
0ab703e3ef
[Ownership] Assign test files to data discovery team (#200932)
## Summary

Assign test files to data discovery team

Contributes to: #192979
2024-11-25 15:28:58 +00:00
Maria Iriarte
f3bc093074
[Lens] Update DatatableComponent header and footer styles and make background transparent (#199813)
## Summary

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

#### Description

- Update Lens' current table visualization `EuiDataGrid` prop for
`gridStyle` to use the shade value for `header` and `footer`
- Make table's background transparent

#### Screenshots

![Screenshot 2024-11-12 at 16 24
27](https://github.com/user-attachments/assets/b42d4daa-37ae-456d-9bd8-c6b6930b187b)

![Screenshot 2024-11-12 at 16 25
44](https://github.com/user-attachments/assets/6c69ea05-d915-4200-9c5c-6e19c9c32019)

![Screenshot 2024-11-13 at 11 02
47](https://github.com/user-attachments/assets/f530b74e-a238-456b-bbbc-e3d8607ec102)

### Checklist

- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-25 09:23:48 -06:00
Tre
d0f0809b06
[Ownership] Assign test files to mgmt team (#200989)
## Summary

Assign test files to mgmt team

Contributes to: #192979
2024-11-25 09:08:55 -06:00
Elena Stoeva
cb63818b6f
[Index Management] Small copy change for index settings callout (#201264)
## Summary

A small update on the copy of the index settings callout, based on
feedback we received from @tylerperk.

<img width="1516" alt="Screenshot 2024-11-21 at 18 07 40"
src="https://github.com/user-attachments/assets/7e50b60c-abb8-472d-b0c2-6b98fc0d1026">
2024-11-25 14:40:16 +00:00
Eyo O. Eyo
691f493cd4
[React18] Migrate test suites to account for testing library upgrades obs-ux-infra_services-team (#201168)
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-11-25 08:18:14 -06:00
Larry Gregory
d28d2c3415
Dependency ownership for Kibana Core team, part 1 (#201380)
## Summary

This updates our `renovate.json` configuration to mark the Core team as
owners of their set of dependencies.
2024-11-25 08:12:32 -06:00
Kibana Machine
c69e8b279f skip failing test suite (#201334) 2024-11-26 01:11:38 +11:00
florent-leborgne
fcf319e7c4
[Docs] Document ability to drag and drop columns in Discover (#201571)
This PR adds docs related to
https://github.com/elastic/kibana/pull/197832 for Discover

Rel: https://github.com/elastic/platform-docs-team/issues/562
2024-11-25 15:09:07 +01:00
Jonathan Budzenski
d44f70fd5f skip suites failing es promotion (#158318,#163254,#163255,#167676) 2024-11-25 08:05:07 -06:00
Tre
da1a7c49f3
[Ownership] Assign more to presentation team (#201551)
## Summary

Assign more to presentation team

Contributes to: #192979
2024-11-25 14:03:43 +00:00
Tre
9d44c14f66
[Ownership] Assign test files to obs ai assist team (#200936)
## Summary

Assign test files to obs ai assist team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:01:56 +00:00
Tre
94c9012f1b
[Ownership] Assign test files to search team (#200988)
## Summary

Assign test files to search team

Contributes to: #192979

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:01:07 +00:00
Dario Gieselaar
63da7701e7
[Streams] App plugin (#200060)
Creates the Streams app plugin, which renders UI for managing streams
(see https://github.com/elastic/kibana/pull/198713).

Additional changes in this PR:

- The menus were updated to conditionally add a link to the Streams app.
The Streams plugin itself returns a status$ observable which signals if
Streams have been enabled. This value is used to conditionally render
the link in the various flavors of menus.
- There's a small change in the ES types to allow for ordered params in
ES|QL (vs named params)
- `@kbn/server-route-repository` was updated to be able to override
`access` (instead of only inferring it from the endpoint name).
Additionally, we now allow all route options by default.
- `@kbn/typed-react-router-config` now also exports a `useBreadcrumbs`.
This was copied over from the APM implementation.
- the signature of the `esql` method in
`ObservabilityElasticsearchClient` was updated to separate processing
options from options that are sent over to the _query endpoint.

---------

Co-authored-by: Chris Cowan <chris@elastic.co>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-25 14:51:24 +01:00
Eyo O. Eyo
197e606bdf
fix issue with generating short url when copying share link (#201475)
## Summary

Extracted from https://github.com/elastic/kibana/pull/197484, to make it
much easier to backport this fix to other releases that require this
fix.

This PR fixes the issue with generating short URL for the share link.

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

<!--
- [ ] 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-11-25 14:35:02 +01:00
Elena Shostak
34bf83b54f
Dependency usage CLI (#198920)
## Summary


[dependency-cruiser](https://github.com/sverweij/dependency-cruiser/tree/main)
is used for building dependency graph.

### Show all dependencies for a specific package/plugin or directory

#### Run for all plugins
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins -o ./tmp/deps-result-all.json
```

#### Run for single plugin
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -o ./tmp/deps-result-single.json
```

#### Run for multiple plugins
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution x-pack/plugins/security -o ./tmp/deps-result-multiple.json
```

#### Run for `x-pack/packages`
```bash
bash scripts/dependency_usage.sh -p x-pack/packages -o ./tmp/deps-packages-1.json
```

#### Run for `packages`
```bash
bash scripts/dependency_usage.sh -p packages -o ./tmp/deps-packages-2.json
```

#### Benchmark

| Analysis              | Real Time   | User Time   | Sys Time   |
|-----------------------|-------------|-------------|------------|
| All plugins           | 7m 21.126s  | 7m 53.099s  | 20.581s    |
| Single plugin         | 31.360s     | 45.352s     | 2.208s     |
| Multiple plugins      | 36.403s     | 50.563s     | 2.814s     |
| x-pack/packages       | 6.638s      | 12.646s     | 0.654s     |
| packages              | 25.744s     | 39.073s     | 2.191s     |


#### Show all packages/plugins within a directory that use a specific
dependency

```sh
bash scripts/dependency_usage.sh -d rxjs -p x-pack/plugins/security_solution
```
---
#### Show all packages/plugins within a directory grouped by code owner
```sh
bash scripts/dependency_usage.sh -d rxjs -p x-pack/plugins -g owner
```
---

#### Group by code owner with adjustable collapse depth for fine-grained
grouping
**Fine-grained grouping**:
```sh
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 4
```
**Collapsed grouping**: groups the results under a higher-level owner
(e.g., `security_solution` as a single group).
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 1
```
---

#### Show all dependencies matching a pattern (e.g., `react-*`) within a
package
```bash
bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -d 'react-*' -o ./tmp/result.json
```

### Checklist

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

__Related: https://github.com/elastic/kibana/issues/196767__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 14:07:40 +01:00
Tre
5d6d45c341
[Ownership] Assign test files to viz team (#200934)
## Summary

Assign test files to viz team

Contributes to: #192979

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 07:03:53 -06:00
Bharat Pasupula
8964dc92c7
[Automatic Import] Remove fields with @ from the script processor (#201548)
## Summary

This PR filters the fields containing `@` in date type from `script`
processor.

## Before this PR


![image](https://github.com/user-attachments/assets/a733d81f-aaaf-4787-b974-1e5d35ff4b8f)

```json
    {
      "script": {
        "tag": "script_convert_array_to_string",
        "description": "Ensures the date processor does not receive an array value.",
        "lang": "painless",
        "source": "if (ctx.varonis?.varonis_alerts?.@timestamp != null &&\n    ctx.varonis.varonis_alerts.@timestamp instanceof ArrayList){\n    ctx.varonis.varonis_alerts.@timestamp = ctx.varonis.varonis_alerts.@timestamp[0];\n}\n"
      }
    },
    {
      "date": {
        "if": "ctx.varonis?.varonis_alerts?.@timestamp != null",
        "tag": "date_processor_varonis.varonis_alerts.@timestamp",
        "field": "varonis.varonis_alerts.@timestamp",
        "target_field": "event.start",
        "formats": [
          "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
          "ISO8601"
        ]
      }
    },
```

## After this PR

```json
      "date": {
        "if": "ctx.varonis?.varonis_alerts?.@timestamp != null",
        "tag": "date_processor_varonis.varonis_alerts.@timestamp",
        "field": "varonis.varonis_alerts.@timestamp",
        "target_field": "event.start",
        "formats": [
          "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'",
          "ISO8601"
        ]
      }
    },
```

### 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
2024-11-25 14:00:14 +01:00
Sergi Romeu
92fc653480
[APM] Create dev script to be able to run Deployment agnostic tests (#201351)
## Summary

Closes #201346

This PR adds a `dat` dev script, which lets you easily run APM
deployment-agnostic tests, as we already do with `api` tests.

## Examples

Run only server with stateful config
```sh
node x-pack/plugins/observability_solution/apm/scripts/test/dat --stateful --server
```
Run only runner with stateful config
```sh
node x-pack/plugins/observability_solution/apm/scripts/test/dat --stateful --runner
```
Run everything with serverless config
```sh
node x-pack/plugins/observability_solution/apm/scripts/test/dat --serverless
```

More information
[here](https://github.com/elastic/kibana/pull/201351/files#diff-5ca943bbe3962fc31cce510407cc1563a959b0fdb9cb52619f57e1f182a9751a)

---------

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
2024-11-25 06:56:45 -06:00
Mykola Harmash
e44de689fb
[Observability Onboarding] Add different test subjects to the footer links (#201383)
Closes #201103
2024-11-25 06:51:13 -06:00
Jill Guyonnet
db494181e3
[Fleet] Handle unavailable spaces in agent policy space selector (#201251)
## Summary

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

This PR improves the space selector in agent policy setting to handle
the case where the user does not have access to all policy spaces.

In this case:
* Space selection is disabled
* The "Create space" link is hidden
* A tooltip is shown to inform the user why the input is disabled
* The inaccessible space badges are given an `Unavailable space` badge

### Screenshots

For a user with access to all policy spaces (no change):
![Screenshot 2024-11-21 at 17 11
00](https://github.com/user-attachments/assets/79c4fcc5-17d5-4273-912c-07eecfd73715)

For a user with access to only a subset of policy spaces:
![Screenshot 2024-11-21 at 17 11
09](https://github.com/user-attachments/assets/19ca162a-7ed6-45fd-8ecc-98e6e085af27)

### 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/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
- [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: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-11-25 12:49:23 +00:00
Sergi Romeu
a76084f30f
Skip Serverless Transaction groups alerts when data is loaded with avg transaction duration alerts returns the correct number of alert counts (#201533)
## Summary
Related to https://github.com/elastic/kibana/issues/201531

This PR skips `Transaction groups alerts when data is loaded with avg
transaction duration alerts returns the correct number of alert counts`,
which is inside
`x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/transactions/transactions_groups_alerts.spec.ts`
file, as it's failing on MKI.
2024-11-25 13:48:31 +01:00
Elena Stoeva
762bb7f59d
[Mappings editor] Add code improvements for source field (#201188)
Closes https://github.com/elastic/kibana/issues/200769

## Summary

This PR is a follow-up to https://github.com/elastic/kibana/pull/199854
and it adds the following code improvements:

- Replaces Mappings-editor-context-level property `hasEnterpriceLicense`
with plugin-context-level `canUseSyntheticSource` property
- Adds jest tests to check if the synthetic option is correctly
displayed based on license
- Improves readability of serializer logic for the source field


**How to test:**
The same test instructions from
https://github.com/elastic/kibana/pull/199854 can be followed with a
focus on checking that the synthetic option is only available in
Enterprise license.
2024-11-25 12:46:05 +00:00
Antonio
e4d32fd527
[ResponseOps][Cases] SyncAlertsToggle flaky test (#201534)
## Summary

The test failed again after the last fix. I added `within` to try and
improve the time of the dom traversals in the failing test.
2024-11-25 13:38:32 +01:00
Tre
99eb6823e6
[Ownership] Assign test files to core team (#200950)
## Summary

Assign test files to core team

Contributes to: #192979
2024-11-25 05:38:53 -06:00