## Summary
Since we already have some E2E tests running for serverless, this PR
turns on the internal API restriction flag to test whether our UI
functions _as such_ under these tests.
An alternative could be to have a specific smoke test for this, but it
seems this is thoroughly covered by piggy-backing off the existing set
of tests.
Blocks: https://github.com/elastic/kibana/pull/162149
## Summary
Resolve https://github.com/elastic/kibana/issues/161768
Handle invalid old packages in the `getPackages` method, by ignoring and
logging a warning instead of crashing.
## Test
Tested by a unit test
How to manually reproduce? this can be reproduced by installing in 7.17
zscaler in version 0.1.2 then upgrade to 8.8.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
We need a way to decode Android crash's stacktraces so that they can
provide meaningful insights to our customers, this is because, due to
security reasons, android apps tend to obfuscate their code before
publishing it online, making crash reports contain obfuscated names,
which don't make any sense before mapping them to the actual source code
names.
In order to help our customers deobfuscate their stacktraces, we need to
allow them to provide us with an R8 map file, which is generated by the
code obfuscation tool (R8) at compile time. This map file is needed to
later do the deobfuscation process.
So these code changes take care of adding a new endpoint that our
customers can use to upload their map files, similarly to what's
currently available to [RUM
Sourcemaps](https://www.elastic.co/guide/en/apm/guide/current/source-map-how-to.html#source-map-rum-upload),
the Android map files will be uploaded to ES, using the same index as
the one currently used to store RUM Sourcemaps.
There's a couple of reasons why a new endpoint to upload android maps is
needed instead of re-using the existing RUM Sourcemaps one:
* The Sourcemaps upload endpoint has validations in place to check the
sourcemap format, which must be a JSON with some expected keys
available. Android map files don't have a JSON format, so they are
rejected by the sourcemaps endpoint.
* Android map files tend to be large in size, just as an example, the
map file generated for our [sample
app](https://github.com/elastic/opbeans-android) has a size of ~7 MB, so
for real apps this number can be larger, which would also cause issues
with the RUM upload endpoint since it has a max file limit size of 1 MB.
* The RUM upload endpoint contains a parameter (`bundle_filepath `) that
doesn't have an equivalent for the android map use case.
This PR depends on https://github.com/elastic/kibana/pull/161152
### Checklist
Delete any items that are not applicable to this PR.
- [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
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
Co-authored-by: Brandon Morelli <bmorelli25@gmail.com>
Co-authored-by: Katerina Patticha <kate@kpatticha.com>
## Summary
Closes#162093.
This fixes a few UX bugs around top nav actions being available when
they shouldn't be. I noticed that we check for overlays in the top nav
buttons, but the dashboard container wasn't actually updating app state
when overlays were being opened and closed by nested embeddables.
Main changes:
- disables all top nav actions while cloning/save is in progress
- tracks overlay state in dashboard container when panel actions
open/close flyouts
- disables all top nav actions while flyout is open
### Checklist
Delete any items that are not applicable to this PR.
- [ ] 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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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))
- [ ] 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 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)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Closes https://github.com/elastic/kibana/issues/160141
The avatar menu needs to be displayed for serverless. It was previously
required to be hidden in serverless, so a config 'showNavLinks' was
added. This config is no longer needed, so it has been removed.
## Testing
Start KB with the `--serverless` flag and login as `elastic`.
The Avatar should appear in the top right coner.
Closes https://github.com/elastic/kibana/issues/162756
This PR fixes a problem introduced after the merge of
https://github.com/elastic/kibana/pull/160289
Looks like the behaviour of node regarding the use of the `FORCE_COLOR`
flag is now propagated differently when cashing the output of a given
node interpreter run in a bash variable which was affecting the script
and making it to fail when casting a number string to a number.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR cleans up the custom metric form by removing the EuiPanel
component and making the labels for the indicator component generic. I
also added headings and horizontal rules to distinguish between the two
different event types. For the histogram metric, I just added the
horizontal rules to provide more separation between the sub-parts of the
indicator.
### Custom metric form
<img width="652" alt="image"
src="a2aa99e5-c79c-4bd4-8d8b-3ae66d3f27c5">
### Histogram metric form
<img width="648" alt="image"
src="e2587f09-cd30-4b56-be0f-0c33e4efee42">
## Summary
This changes the search apps UI to use the alias instead of the list of
indices that is stored in search apps.
Tested with https://github.com/elastic/elasticsearch/pull/98036
Some of the aspects of the UI can be improved, I will follow up with
@julianrosado with some ideas, but for now we are at least handling the
case where the alias is missing without having the UIs crashing, by
showing readable error messages.
When the alias is missing:
<img width="1265" alt="Screenshot 2023-07-31 at 17 02 46"
src="2aa5d3da-4dae-4eff-aff9-a38c221de673">
clicking on the list of indices when the alias is missing:
<img width="1562" alt="Screenshot 2023-07-31 at 17 07 27"
src="bb552833-f64e-4fe7-84f3-e237d40fa79b">
search preview:
<img width="1550" alt="Screenshot 2023-07-31 at 17 07 17"
src="402c8667-884d-4894-a7db-8cc1d9cf98b1">
content:
<img width="1553" alt="Screenshot 2023-07-31 at 17 03 53"
src="aa0a9261-5cab-46f3-a87d-6fa2d87d4b8f">
field capabilities (unchanged):
<img width="1557" alt="Screenshot 2023-07-31 at 17 04 00"
src="9812561f-53ec-497d-9b10-91c65271a503">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This updates the left nav of Serverless Search to match the latest
designs, and disables ML alerting rules.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fixes a race condition in the case where a response stream finishes and
sets `isRunning` to `false`, but `useThrottle` didn't trigger it's last
update yet within the refresh rate. In the case of log rate analysis,
`isRunning` could be set to `false` too early and the UI wouldn't
consider later throttled updates (for example, setting `loaded=1` which
would result in inconsistent UI state).
The fix in this case is to return the unthrottled raw data instead of
the throttled one as soon as the stream finished.
## Summary
Switching over to the multi field selector component for non-ELSER
pipelines.
We're also cleaning up obsolete code:
- Remove `sourceField`, `destinationField`, `inferenceConfig` references
- Remove generation of field mappings and full pipeline definition from
`sourceField` and `destinationField`

Use cases tested manually:
- Create ELSER pipeline
- Create non-ELSER pipeline
- Create non-ELSER pipeline with custom target field name
- Attach ELSER pipeline
- Attach non-ELSER pipeline
### 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)
- ~[ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~ - will do
in a separate PR
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/126078
Currently the 2 places where the user can create Agent Key already
handles the situation by not displaying the option to user with limited
permissions.
1. Observability - Settings
2. Stack Management -> API Keys
[Public
API](https://www.elastic.co/guide/en/kibana/current/agent-key-api.html)
is still available to create Agent Keys.
With this change the below would happen
### Request
```
curl -X POST "http://localhost:5601/{basePath}/api/apm/agent_keys" \
-u editor:changeme \
-H "Content-Type: application/json" \
-H "Elastic-Api-Version: 2023-10-31" \
-H "kbn-xsrf: true" \
-d '{
"name": "apm-key",
"privileges": ["event:write", "config_agent:read"]
}'
```
### Response
```
{
"statusCode": 403,
"error": "Forbidden",
"message": "editor is missing the following requested privilege(s): config_agent:read, event:write and following cluster privileges - manage_api_key, manage_own_api_key privilege(s). You might try with the superuser, or add the missing APM application privileges to the role of the authenticated user, eg.:\n PUT /_security/role/my_role\n {\n ...\n \"applications\": [{\n \"application\": \"apm\",\n \"privileges\": [\"config_agent:read\",\"event:write\"],\n \"resources\": [*]\n }],\n ...\n }",
"attributes": {
"data": {
"missingPrivileges": [
"config_agent:read",
"event:write"
],
"missingClusterPrivileges": [
"manage_api_key",
"manage_own_api_key"
]
},
"_inspect": [
]
}
}
```
## Summary
As titled. This PR corrects a pair of mistakes I made before committing
#161914 that @dgieselaar identified shortly thereafter.
- I had tested Storybook extensively, but after I rebased, I changed the
render context, and I forgot to update the `decorator` in Storybook.
This meant Emotion styles worked, but the EUI styles were missing.
- In addition, when I rebased, I missed the addition of the utils cache
that had been added by EUI.
- Interestingly, #162365 missed adding the cache `meta` tag to the
template. Emotion simply added the styles to the `head`, but it's best
to reproduce what we see in Kibana. So I've corrected that, as well.
- While creating the PR, I went ahead and addressed
[feedback](https://github.com/elastic/kibana/pull/161914#discussion_r1277765276)
from @cee-chen on the original PR./
Sorry if anyone was confused by the sudden drop in styles in their
Storybooks. Should be resolved now. Thanks!
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This pr is related to issue:
https://github.com/elastic/enterprise-search-team/issues/4432
This change involves removing hints related to the inference_config
attribute
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes https://github.com/elastic/kibana/issues/161445
## Summary
This PR enhances the usage of the intersection observer to control the
loading behavior of charts, improving the performance, especially
noticeable during scrolling.
Before
dfb1d7db-4ddb-41c3-b8ae-3b5bdf3fe36e
After
f348b0b9-4e6f-4163-9eb4-99daea91bbef
Besides, the intersection observer threshold has been set to 0, allowing
charts to start loading as soon as they begin to enter the viewport.
### How to test
- Start a local Kibana instance
- Navigate to `Infrastructure > Hosts`
- Scroll down and confirm that it's not laggy (same for the flyout)
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
After the obs ai assistant [moved to its own
plugin](https://github.com/elastic/kibana/pull/162243) outside the
observability plugin, logs_shared shouldn't need to depend on
observability
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Implement private location run once mode , user will be able to do run
once or test now for private locations as well.
This implemented a task manager which will clean up temporarily created
package policies created for the purpose of run once and test now mode.
<img width="1718" alt="image"
src="e5ac3a52-516f-48eb-953f-fa573d825a57">
## Summary
Closes - https://github.com/elastic/kibana/issues/153844
As part of this PR, as its just the stepping stone, we will only cover a
basic navigation flow and analyze the result obtained from Steps
Dashboard and data collected by the APM Agents for this journey
## Scope
- Generating a data set using Synthtrace instead of Archives
- Capturing the flow from Service Inventory to Trace Waterfall loading
on Transaction page
- Capturing Event loop utilisation metrics enabled for APM Journey
## How to run it
```
node scripts/run_performance.js --journey-path x-pack/performance/journeys/apm_service_inventory.ts --skip-warmup
```
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
https://github.com/elastic/kibana/issues/156061
## Summary
Fixes flaky test by adding ceil(). When it fails the time elapsed is
close to the `MOCK_RETRY_DELAY` of 20 (like 19.7), so rounding up helps
with the flakiness
## Summary
Original ticket: https://github.com/elastic/kibana/issues/157462
With these changes we fix the legacy actions data loss (on migration)
issue. One of the first steps of the migration we retrieve legacy
actions and immediately delete them. Then we do validation which might
throw an exception and all legacy actions will be lost in this case.
As a solution we will do legacy actions validation before deleting them
and throwing exception in case those are broken. This means that in case
legacy action is broken user will need to export the rule, fix it
manually and import it again. Or just re-create it from scratch.
a23f5d43-3758-4ab7-8e63-bd93016e338d
## Summary
Original ticket: https://github.com/elastic/kibana/issues/156088
It looks like flakiness happens due to another rule from previous test
case being scheduled by alerting framework and running even after we
deleted it (since we called delete rule after it was scheduled). That
rule scheduled earlier produces some unexpected artifacts in metrics,
specifically `stats.detection_rules.detection_rule_status` where
occasionally see
<img width="1255" alt="Screenshot 2023-07-25 at 15 13 29"
src="5d1cc334-25b5-4bf2-8822-c9858a0b72bf">
Since, in this test case the rule is disabled, we should not see this
data.
As a fix, we decided to test against specific metrics attributes
`stats.detection_rules.detection_rule_usage` which we expect being
updated.