## Summary
I had to change `waitForRender` since `page.waitForFunction` tries to
run a script on page and it is not working due to CSP settings on Cloud.
Instead of injecting a script, we use a classical API to find
elements/attributes in the DOM.
Since `PUT /internal/core/_settings` is merged in 8.11.0, journeys run
on Cloud with on-fly labels update is supported starting deployments
8.11.0+. I added error message for 404 code just in case someone runs it
on earlier version.
`many_fields_discover` journey was update since on Cloud the data view
used by scenario is not selected by default.
How it works:
Create a deployment with QAF and re-configure it for journey run:
```
export EC_DEPLOYMENT_NAME=my-run-8.11
qaf elastic-cloud deployments create --stack-version 8.11.0-SNAPSHOT --environment staging --region gcp-us-central1
qaf elastic-cloud deployments configure-for-performance-journeys
```
Run any journey, e.g. many_fields_discover
```
TEST_CLOUD=1 TEST_ES_URL=https://username:pswd@es_url:443 TEST_KIBANA_URL=https://username:pswd@kibana-ur_url node scripts/functional_test_runner --config x-pack/performance/journeys/many_fields_discover.ts
```
You should see a log about labels being updated:
```
Updating telemetry & APM labels: {"testJobId":"local-a3272047-6724-44d1-9a61-5c79781b06a1","testBuildId":"local-d8edbace-f441-4ba9-ac83-5909be3acf2a","journeyName":"many_fields_discover","ftrConfig":"x-pack/performance/journeys/many_fields_discover.ts"}
```
And then able to find APM logs for the journey in
[Ops](https://kibana-ops-e2e-perf.kb.us-central1.gcp.cloud.es.io:9243/app/apm/services?comparisonEnabled=true&environment=ENVIRONMENT_ALL&kuery=labels.testJobId%20%3A%20%22local-d79a878c-cc7a-423b-b884-c9b6b1a8d781%22&latencyAggregationType=avg&offset=1d&rangeFrom=now-24h%2Fh&rangeTo=now&serviceGroup=&transactionType=request)
cluster
Implements #153108.
This enables the
`@kbn/telemetry/event_generating_elements_should_be_instrumented` eslint
rule for the `aiops` plugin to enforce `data-test-subj` attributes on
actionable EUI components so they are auto-instrumented by telemetry.
The ids were first auto-created using `node scripts/eslint --fix
x-pack/plugins/aiops` and then adapted.
## Summary
Hopefully
closes#167104closes#167130closes#167100closes#167013closes#166964
Fixing a few issues with login/logout:
1. Failed to login in "before" hook
<img width="1336" alt="Screenshot 2023-09-25 at 12 37 45"
src="e3b2830e-7b0d-4467-9b90-261b385bf71e">
My theory is that we are loading `/login` route too soon while log out
was not completed yet.
When we navigate to `https://localhost:5620/logout` there are multiple
url re-directions with final page being Cloud login form. This PR makes
sure we wait for this form to be displayed + 2500 ms extra to avoid
"immediate" /login navigation
2. Failed login on MKI:
Updating login via UI for serverless to pass password valid for
deployment: currently FTR uses `changeme` for both Kibana CI & MKI.
3. ES activate user profile call returning 500
We saw some login failures that are preceded with the following logs:
```
[00:03:27] │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:03:27] │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:03:27] │ debg Find.waitForDeletedByCssSelector('.kibanaWelcomeLogo') with timeout=10000
[00:03:27] │ proc [kibana] [2023-09-19T07:08:26.126+00:00][INFO ][plugins.security.routes] Logging in with provider "basic" (basic)
[00:03:27] │ info [o.e.x.s.s.SecurityIndexManager] [ftr] security index does not exist, creating [.security-profile-8] with alias [.security-profile]
[00:03:27] │ proc [kibana] [2023-09-19T07:08:26.140+00:00][ERROR][plugins.security.user-profile] Failed to activate user profile: {"error":{"root_cause":[{"type":"validation_exception","reason":"Validation Failed: 1: this action would add [1] shards, but this cluster currently has [27]/[27] maximum normal shards open;"}],"type":"validation_exception","reason":"Validation Failed: 1: this action would add [1] shards, but this cluster currently has [27]/[27] maximum normal shards open;"},"status":400}.
[00:03:27] │ proc [kibana] [2023-09-19T07:08:26.140+00:00][ERROR][http] 500 Server Error
[00:03:27] │ warn browser[SEVERE] http://localhost:5620/internal/security/login - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
```
User activation happens during `POST internal/security/login` call to
Kibana server. ~~The only improvement that we can do from FTR
perspective is to call this end-point via API to makes sure user is
activated and only after proceed with UI login.~~
While working on issue #4 and talking to @jeramysoucy I believe retrying
login via UI will work here as well. We are checking if we are still on
login page (similar to incorrect password login), waiting 2500 ms and
pressing login button again.
4. Failed to login with Kibana reporting UNEXPECTED_SESSION_ERROR and
been re-directed to Cloud login page
```
proc [kibana] [2023-09-25T11:35:12.794+00:00][INFO ][plugins.security.authentication] Authentication attempt failed: UNEXPECTED_SESSION_ERROR
```
Temporary solution is to retry login from scratch (navigation to Kibana
login page & re-login )
Flaky-test-runner for functional obtl tests 50x
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3215
This PR is not fixing random 401 response when user navigates to some
apps with direct url
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Follow up to #167237.
Part of #167467.
We plan to reuse some of the queries log pattern analysis does to use
via log rate analysis too. Log pattern analysis mostly does queries from
the client side, late rate analysis has its own API endpoint and does ES
queries via Kibana server. In preparation for the use via log rate
analysis, this moves the code we need to have available server side for
log rate analysis to the `common` area of the plugin so it can be used
both on server/client.
In https://github.com/elastic/kibana/pull/167148 the filename was
updated. This updates the file read path in the fleet plugin.
Fixes `proc [kibana] [2023-09-27T18:12:07.561+00:00][WARN
][plugins.fleet] Unable to retrieve GPG key from
'/var/lib/buildkite-agent/builds/kb-n2-4-spot-e622c074d3147d71/elastic/kibana-on-merge/kibana-build-xpack/node_modules/@kbn/fleet-plugin/target/keys/GPG-KEY-elasticsearch':
ENOENT`
## Summary
Closes https://github.com/elastic/kibana/issues/166636
- use metrics_data_access plugin to dynamically retrieve indices where
needed
- add basic `/assets/hosts` api test
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jason Rhodes <jason.rhodes@elastic.co>
Resolves https://github.com/elastic/kibana/issues/163953
## Summary
Changes `refresh='wait_for'` to `refresh=true` when bulk indexing alerts
from the alerting framework and the rule registry. For persistence
alerts, `refresh=false` is used when the rule execution is a preview.
## Notes
I deployed this image to the serverless QA environment and compared
execution times between this branch and the default QA version with an
index threshold rule that creates and active alert each run.
Default QA version:
* avg 8.16 seconds
* P99 15.5 seconds
QA using this image:
* avg: 0.6 seconds
* P99 1.7 seconds
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ryland Herrick <ryalnd@gmail.com>
## Summary
This PR cleaned up the loading and empty state of most components in the
new expandable alerts flyout:
1) Refactor `FlyoutLoading` component to be used across components
2) Updated unit tests to explicitly check no data messages
3) Changed loading spinner in smaller components to be skeleton text
4) Moved error/no data message to table
5) Added loading and/or error messages for:
1) Right panel -> about -> Rule description, note that rule preview is
disabled if no rule is found

2) Right panel -> about -> Alert reason, note that the alert reason
preview is disabled if no reason available

3) Right panel -> Investigation -> Highlighted fields

4) Right panel -> Insights -> host and user preview

5) Right panel -> Visualization -> analyzer preview (to match error in
analyzer graph)

6) Right panel -> About -> show rule summary & show alert reason when
there is an error
- Very uncommon because the button should be disabled if data is not
available, adding as fall back

### 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
closes https://github.com/elastic/kibana/issues/166440
This PR applies compressed style to the control group container.
<img width="699" alt="Screenshot 2023-09-27 at 14 44 51"
src="7318c0aa-c00e-44e9-9d29-f2f0deb5b791">
## Summary
We're breaking #166813 up into smaller PRs in the interest of getting
PRs through sooner for type fixes. These are the changes for
`x-pack/test`.
---------
Co-authored-by: Thomas Watson <watson@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
## Summary
This PR removes the feature flag and enables the new index details page
by default. The index details page was implemented in following PRs:
- https://github.com/elastic/kibana/pull/163521
- https://github.com/elastic/kibana/pull/163955
- https://github.com/elastic/kibana/pull/164741
- https://github.com/elastic/kibana/pull/165027
- https://github.com/elastic/kibana/pull/165038
- https://github.com/elastic/kibana/pull/165456
In this PR we completely remove now obsolete code for the old index
details flyout: react components and corresponding redux code. All
related tests are updated and cleaned up. The config value for Index
Management plugin `xpack.index_management.dev.enableIndexDetailsPage` is
deprecated as unused and can be removed in v9.0.
### How to test
1. Start ES and Kibana with `yarn es snapshot` and `yarn start`
3. Navigate to Index Management and create an index
4. Click the index name in the table and check the tabs of the details
page
### Screenshots
#### Stateful
Overview
<img width="1387" alt="Screenshot 2023-09-27 at 14 41 57"
src="e58b15e7-d10c-4473-873c-d0f128392404">
Mappings
<img width="1392" alt="Screenshot 2023-09-27 at 14 42 05"
src="441157cb-5a26-47c3-8da0-b4df51ebec5d">
Settings
<img width="1385" alt="Screenshot 2023-09-27 at 14 42 13"
src="da66a2eb-1f21-44c1-9356-484c66caab88">
Statistics
<img width="1380" alt="Screenshot 2023-09-27 at 14 42 22"
src="ec93d85c-e754-4c21-88ab-0124dc114fc9">
Error loading data
<img width="1333" alt="Screenshot 2023-09-26 at 19 05 37"
src="fc1804b3-6aa0-4019-bae6-e7bb40113b28">
<img width="1327" alt="Screenshot 2023-09-26 at 19 06 07"
src="ca711697-cc74-4ba8-b17c-ec9b01f3026e">
<img width="1329" alt="Screenshot 2023-09-26 at 19 06 28"
src="0cb46b09-8542-452a-8845-40d060057e95">
<img width="1331" alt="Screenshot 2023-09-26 at 19 06 48"
src="87de8d3d-b6e5-4e8f-b27c-18a1c6e950d8">
Error saving index settings
<img width="1332" alt="Screenshot 2023-09-26 at 19 07 31"
src="e6e4b3d0-c237-4d0a-995a-4562bc78f88e">
### Serverless
Overview
<img width="1336" alt="Screenshot 2023-09-26 at 19 51 47"
src="6c76c23b-4be6-4ab3-ae1d-c7ae751e100d">
Mappings
<img width="1336" alt="Screenshot 2023-09-26 at 19 23 51"
src="625fa703-506f-4389-9df0-86441a655074">
Settings
<img width="1332" alt="Screenshot 2023-09-26 at 19 24 02"
src="c496ab09-f2db-4c1b-9fb6-1e9b64b1c142">
# Release note
Index details can now be viewed on a new index details page in Index
Management.
<img width="1387" alt="Screenshot 2023-09-27 at 14 41 57"
src="b90c706d-8b15-49e4-8f6a-cb66f3ed1822">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
https://github.com/elastic/security-team/issues/7588
To meet the above requirements, I believe it is sufficient to replace
only the URL with one that directly points to the security integration
instead of the integrations list. This change does not appear to affect
the flow of guided onboarding in any way.
4d1aa943-2dce-4d43-bab1-d7cc024695f8
## Summary
### `@kbn/es` package
- Introduces `--resources` option to the `es serverless` command
- Allows for
[`serverless_resources`](https://github.com/elastic/kibana/tree/main/packages/kbn-es/src/serverless_resources)
to be overwritten
### Security Solution Plugin
- Added customized `users`, `users_roles` and `roles.yml` files that
includes:
- Updated `roles.yml` file (sync'ed with project controller version)
- Updated `users` / `users_roles` file that includes one one per
security project role (name the same as the role)
- New CLI script - `node
x-pack/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js`
- that will start ES in serverless mode and inject the customized
`--resources` into the command
- Any existing option that can be passed to `es` or `es serverless` can
still continue to be passed to this new script. I will pass them along.
closes#167092
__
Updates the text for the info callouts which are displayed when anomaly
detection jobs are waiting for a node.
@szabosteve would you mind having a review of the text?
**Jobs list**

**Creating a new job**

Fixes https://github.com/elastic/kibana/issues/165472
---------
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
The `chi2test` utils so fare were only used within data comparison view.
We plan to use it with other plugins, so moving it so a separate package
in this PR. `SIGNIFICANCE_LEVELS` was updated to include some more
digits.
## Summary
Save to library action should not be present in ES|QL panels. For now we
only allow by value embeddables and we don't want them to be
edited/created in Lens editor
<img width="915" alt="image"
src="d6e5e8a7-459f-4b1d-8461-2863b45db882">
### 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
## Summary
Supposedly, this is the error that's causing these type of errors:/
```
Cannot write file '/Users/alex/Git/kibana/x-pack/test/functional/services/random.js' because it would overwrite input file.
```
Separated off from: https://github.com/elastic/kibana/pull/167355
Co-authored-by: Thomas Watson <watson@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
We're breaking #166813 up into smaller PRs in the interest of getting
PRs through sooner for type fixes. These are the changes for
`x-pack/test_serverless`.
## Reviewers
There are no code owners for these files, so I'm using the recently
edited suggestions
---------
Co-authored-by: Alex Szabo <delanni.alex@gmail.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
Co-authored-by: Thomas Watson <watson@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
In cypress tests, when the logs are output in the beginning, some binary
buffers are also stringified, so when looking at logs, we have to scroll
through thousands of lines of logs, that's annoying and doesn't help
debugging.
I'd like that to be somewhat more readable, there are a few options:
- the replacer should interpret buffers as strings, try to output it
like that
- not every binary buffer is printable
- the replacer should redact the exact fields (certificateAuthority?)
- too specific, might need fixing later
- trim long arrays after 32 items
- I chose this as a solution
Other suggestions are welcome.
<img width="666" alt="Screenshot 2023-09-27 at 12 49 54"
src="7d35e59d-fb14-4d2a-9225-277cc2e1519b">
## Summary
Closes#162263
Introduces a new `Feature Privileges` section to the developer
documentation. The documentation includes a tutorial on how to control
access to features of plugin being developed. Introduces a few sections:
- Controlling access to UI features
- Controlling access to server side APIs
- Documentation for configuration options
## Testing
To build this locally, run ./scripts/dev_docs from a local checkout of
this PR. A server will eventually start on http://localhost:3000 where
you can preview the changes.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
We're breaking https://github.com/elastic/kibana/pull/166813 up into
smaller PRs in the interest of getting PRs through sooner for type
fixes. These are the changes for Platform Deployment Management.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>