Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from elastic:main #833

Merged
merged 13 commits into from
Dec 30, 2024
Merged

[pull] main from elastic:main #833

merged 13 commits into from
Dec 30, 2024

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 30, 2024

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

gsoldevila and others added 13 commits December 30, 2024 14:25
## Summary

* Support packages that are currently placed under a `*/plugins/*`
folder (and viceversa).
* Transform (simplify) the following path:

```
src/platform/packages/shared/chart_expressions/common
# becomes
src/platform/packages/shared/chart-expressions-common
```

cc @markov00
## Summary

Added `CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES` env var for `8.x`
branch to check if that speeds up the CodeQL run, refer to
[documentation](https://codeql.github.com/docs/codeql-overview/codeql-changelog/codeql-cli-2.15.5/)
for details.
… security-solution (#201176)

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

Small fix to the Schema Editor page after the changes in
#204671.

(Without this mapped fields won't be displayed as we use a read stream
definition).
## Summary

When a user profile is not available, the favorites (starred) service
can't be used. On UI user profile can be not available if security is
disabled or for an anonymous user.

This PR improves the handling of starred features for rare cases when a
profile is missing:

- No unnecessary `GET favorites` requests that would fail with error and
add noise to console/networks
- No unhandled errors are thrown
- Starred tab in esql is hidden
- The Dashboard Starred tab isn't flickering on each attempt to fetch
favorites

For this needed to expose `userProfile.enabled$` from core, also created
#204570



### Testing 

```
node scripts/functional_tests_server.js --config test/functional/apps/dashboard/group4/config.ts

localhost:5620
```

another way is by configuring an anonymous user
https://www.elastic.co/guide/en/elasticsearch/reference/current/anonymous-access.html
… security-entity-analytics (#201178)

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>
fixes: [#204957](#204957)

## Summary

This PR fixes the stack trace syntax highlight

<img width="1452" alt="image"
src="https://github.com/user-attachments/assets/ee076fc6-c901-4e8f-a760-8c85a5470a26"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…ions (#205262)

## Summary

#202505
#204921

### Running Kibana with the Borealis theme
In order to run Kibana with Borealis, you'll need to do the following:

Set the following in kibana.dev.yml:
uiSettings.experimental.themeSwitcherEnabled: true

Run Kibana with the following environment variable set:
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start

This will expose a toggle under Stack Management > Advanced Settings >
Theme version, which you can use to toggle between Amsterdam and
Borealis.



![Image](https://github.com/user-attachments/assets/78d64946-43fc-4400-bbb1-229d900b7f05)
This adds a daily build that runs tests again
`docker.elastic.co/package-registry/distribution:lite` and if
successful, promotes the image to
`docker.elastic.co/kibana-ci/package-registry-distribution:lite`.

A follow up pull request will swap integration tests over to use the
promoted image, and add environment overrides to run tests against the
source image in this pipeline.

https://buildkite.com/elastic/kibana-package-registry-promote/builds/2
Part of #203716
## Summary

* Functional test for verifying that users can create indices using the
“logsdb” index mode via the Kibana interface (Stateful and serverless).
* Functional test for verifying that users can upgrade a logs data
stream that is using a “standard” index mode to a data stream using
“logsdb” index mode. (Stateful and serverless).
* Functional test for verifying that users can downgrade a data stream
that is using a “logsdb” index mode to a data stream using “standard”
index mode. (Stateful and serverless).
* Functional test for verifying that users can upgrade a data stream
that is using a “time series” index mode to a data stream using “logsdb”
index mode. (Stateful and serverless).
* Functional test for verifying that users can downgrade a data stream
that is using a “logsdb” index mode to a data stream using “time series”
index mode. (Stateful and serverless).

The rollover operation has not been tested since is not expected to
happen automatically. See [this
comment](#203716 (comment)).
…Data Drift (#205170)

## Summary

This PR fixes #204392 side bar
navigation not highlighted for Data Visualizer and Data Drift

<img width="1134" alt="Screenshot 2024-12-26 at 12 32 00"
src="https://github.com/user-attachments/assets/ff721a06-74b8-4103-9a3d-64a60b0284c8"
/>
<img width="1134" alt="Screenshot 2024-12-26 at 12 31 48"
src="https://github.com/user-attachments/assets/e4250d70-d1a2-4a5b-b891-a935fa554e79"
/>
<img width="1134" alt="Screenshot 2024-12-26 at 12 31 42"
src="https://github.com/user-attachments/assets/4c599233-4dfc-48b1-9612-5798c51f60ea"
/>


### 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>
… functions (#204921)

## Summary

#202505

### Running Kibana with the Borealis theme
In order to run Kibana with Borealis, you'll need to do the following:

Set the following in kibana.dev.yml:
uiSettings.experimental.themeSwitcherEnabled: true

Run Kibana with the following environment variable set:
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start

This will expose a toggle under Stack Management > Advanced Settings >
Theme version, which you can use to toggle between Amsterdam and
Borealis.



![Image](https://github.com/user-attachments/assets/78d64946-43fc-4400-bbb1-229d900b7f05)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@pull pull bot added the ⤵️ pull label Dec 30, 2024
@pull pull bot merged commit dfeb169 into miqdigital:main Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.