## Summary
Closes#148572
Fixes an issue where rules APIs required `frequency.notifyWhen` to be
sent/received instead of `frequency.notify_when`
### 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
Co-authored-by: Julia <iuliia.guskova@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
- Adjust the file download APIs (info and download) to use a file ID as
a route param instead of having the API calculate the File ID
- Adjusts the UI code to ensure the new APIs are called correctly
* Updates to the latest released version of `@elastic/ems-client`
(8.4.0)
* Updates link to EMS landing page to 8.6
* Passes Kibana version to EMS Client instance to request explicitly to
point to the correct API endpoints. This change is introduced to avoid
needing to keep releasing EMS Client with the rest of the stack.
Reopens#149143 with updates to the target file and service
After a commit is merged, tested, and images are built and pushed to the
container registry we need to send a notification that a new tag is
available.
This triggers a promotion pipeline with the latest container tag when:
1) the branch is tracked (i.e. main, and not a personal branch) 1)
~triggered from our on-merge test pipeline.~
https://github.com/elastic/kibana/pull/149350 had to remove support for
this - we're triggering via REST now which removes the from trigger
environment variable.
## Summary
Upgrading the `jsonwebtoken` library used in
`cloud_integration/cloud_chat` plugin from v8.5 to v9.0
## Migration
After reviewing the affected code it looks like this upgrade shouldn't
cause any breaking changes. Please see the v8 --> v9 migration guide
[here](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v8-to-v9)
## Questions for reviewers
- What is the size and type of `secret` that we are passing into
`generateSignedJwt`?
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co>
## Background
Security solution recently started using controls plugin to provide
users some extra filtering capability with help of options list control.
During this implementation, there was some feedback was given from
design team + we were facing some minor issues because of the caches.
Below section gives the list of changes and the reasoning behind each
change. All of these changes were discussed with @ThomThomson
## Summary
This PR introduces 3 new functionalities for optionsList embeddables.
1. Cache invalidation option when reloading an optionsList
- In security solution we have transactional alerting system, where user
frequently update alerts data
- We need the latest data and 1 minute cache of optionsList was
preventing us from doing so.
- This change adds the capability to clear the cache from an embeddable.
3. option to hideSearch Panel
- As a client of control plugin, we look some control over what panels
are visible and what are not.
5. Option to add custom placeholder for optionsList
- Out product team felt that default placeholder for optionsList `Any`
may be confusing for the user and hence I have added the option for
clients to provide a placeholder.
### Checklist
Delete any items that are not applicable to this PR.
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
### 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)
## Summary
Fixes package archive parsing logic for the
`index_template_data_stream.hidden` property, implemented in line with
other `index_template.*` "dotted property name" values from package
manifests.
## To test
Create a test package that includes
`elasticsearch.index_template.data_stream.hidden: true` in a
`data_stream/**/manifest.yml` file, install the package, then verify
(via dev tools - NOT stack management!!!) that the generated index
template contains `data_stream.hidden: true`

It'd be great to have automated tests around this, but testing our
archive parsing logic is very challenging due to the nature of reading
directories/files and how much mocking is required. See
https://github.com/elastic/kibana/issues/147050. I'll see about adding
an integration test for this.
## Summary
Bump elasticsearch-js to 8.6.0-canary.3 to unblock
https://github.com/elastic/kibana/issues/145653
The updated version of elasticsearch-js comes with some type changes
that causes typescript type checking to fail. I've fixed the type errors
that were obvious/easy but left todo's for some types which were harder
for me to figure out. If any of these todo's are in your team's code,
please contribute directly to the branch to fix them.
### 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>
Co-authored-by: Thom Heymann <thom.heymann@elastic.co>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
## Summary
Part of #145529
When creating an input package policy, we now create index templates and
ingest pipelines. As part of this operation we have to update
installed_es on the installation saved object, there is a risk of lost
updates if multiple package policies are created at the same time, to
combat this i have used the in built saved object optimistic
concurrency.
I have tested this locally, we do start see conflicts occur if I create
500 package policies in concurrent batches of 25, but I think we should
have a dedicated bulk endpoint if we want to handle more than that.
I haven't pushed the automated tests as they take a few minutes to run
and I don't think there is a big enough benefit to running them as part
of CI every time.
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
All the job definitions in ML modules contain the field `job_type`. For
anomaly detection jobs this is always `anomaly_detector`. Officially it
is not a valid input to the create job API. Elasticsearch accepts it
(which is technically a bug as it's out-of-spec) which is why it has
never been noticed before. However, the language clients do not accept
it, which causes problems if somebody wants to create module jobs using
a language client. It's best that the jobs in our modules conform
accurately to the specification of a valid job creation request.
## Summary
Fixes#104259
This PR expands the support of the `previous` time shift for
visualisations with a date histogram defined.
On the implementation side, an absolute time shift in the shape of
`endAt( startRange )` is leveraged to make it work the `previous` shift:
anchoring the shift to the beginning of the current range will make sure
to compute the right shift in terms of buckets in order to avoid
misaligned shifts and the main reason why this feature has been disabled
initially.
I've tried to condense an explanation here with this diagram of the
misalignment problem:

With the current approach, there's a small time range overlap between
the two requested interval, but that's the result of the rounding logic
to get both shifts aligned.

The only alternative to avoid the overlap is to get a gap between the
two, but the former seems a better result to me.
### 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary
Closes https://github.com/elastic/kibana/issues/148233
Fixing issue of bulk update tags not working with the new agent status
runtime field.
Refactored update tags to use batching again, resolving 10k agent ids at
a time and `updateByQuery` on batches.
Works locally with dummy agents, has to be tested on cloud with horde to
simulate conflicts.
### 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
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Refactor mobile endpoints and fix indices
- rename `getSessionsChart` to `getMobileSessions`
- rename `getHttpRequestsChart` to `getMobileHttpRequests`
- split queries for `mobile_stats` instead of queries all indices.
Extend `getMobileSessions` and `getMobileHttpRequests` so they can be
used in `mobile_stats`
- remove the metrics 'crashCount` and `maxLoadTime` since they are not
captured yet
related: https://github.com/elastic/kibana/issues/146615
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Adds the page path as the ID to our existing execution context and adds
an additional context entry to every ml kibana endpoint.
In the search slow log, the id for each slow search from ML will look
like this:
`"a90d5297-fd77-4ea0-ac0d-c302963d7e75;kibana:application:ml:%2Fjobs%2Fnew_job%2Fsingle_metric;application:ml:%2Fapi%2Fml%2Fjobs%2Fnew_job_line_chart`
Separating by semicolon:
`a90d5297-fd77-4ea0-ac0d-c302963d7e75` -> kibana ID
`kibana:application:ml:%2Fjobs%2Fnew_job%2Fsingle_metric` -> default
context items added on the client side to show the source page.
`application:ml:%2Fapi%2Fml%2Fjobs%2Fnew_job_line_chart` -> new items
added by the server to show the source endpoint path.
Note, the paths have been encoded to replace the forward slashes.
Part of https://github.com/elastic/kibana/issues/147378