## Summary
* Adds the ability to exclude a response schema when declaring route
schemas
* Adds the ability to provide a description of a the response
See code comments for more info.
## Example
You can declare a response with no validation to imply an empty object
in OAS
```
router.versioned.post({ version: '2023-10-31', access: 'public', path: '...' })
.addVersion({
validation: {
responses: {
201: { description: 'Resource created!' }
}
}
}, () => {})
```
Will result in
```jsonc
{
//...
201: { description: 'Resource created!' }
//...
}
```
## Risks
No notable risks
## Summary
### What
Simply change function signatures and types (for one variable), such
that the `attempt` variable is accurate at invocation time.
### Why
After merging https://github.com/elastic/kibana/pull/188292
I noticed the output did not properly have the integers shown on the
cli:
## Before
```
└- ✖ fail: index_patterns index_patterns/service/lib index_patterns/* error handler "before all" hook in "index_patterns/* error handler"
│ KbnClientRequesterError: [GET - http://localhost:5620/api/status] request failed (attempt=0/5): ECONNREFUSED -- and ran out of retries
│ at KbnClientRequester.request (kbn_client_requester.ts:142:15)
│ at processTicksAndRejections (node:internal/process/task_queues:95:5)
│ at KbnClientStatus.get (kbn_client_status.ts:43:22)
│ at KbnClientPlugins.getEnabledIds (kbn_client_plugins.ts:17:21)
│ at loadAction (load.ts:80:27)
│ at Proxy.load (es_archiver.ts:99:12)
│ at Context.<anonymous> (errors.js:29:7)
│ at Object.apply (wrap_function.js:73:16)
│
```
## After
```
└- ✖ fail: index_patterns index_patterns/service/lib index_patterns/* error handler "before all" hook in "index_patterns/* error handler"
│ KbnClientRequesterError: [GET - http://localhost:5620/api/status] request failed (attempt=5/5): ECONNREFUSED -- and ran out of retries
│ at KbnClientRequester.request (kbn_client_requester.ts:140:15)
│ at processTicksAndRejections (node:internal/process/task_queues:95:5)
│ at KbnClientStatus.get (kbn_client_status.ts:43:22)
│ at KbnClientPlugins.getEnabledIds (kbn_client_plugins.ts:17:21)
│ at loadAction (load.ts:80:27)
│ at Proxy.load (es_archiver.ts:99:12)
│ at Context.<anonymous> (errors.js:29:7)
│ at Object.apply (wrap_function.js:73:16)
```
Please draw your attention to:
**BEFORE**: `KbnClientRequesterError: [GET -
http://localhost:5620/api/status] request failed (attempt=0/5):
ECONNREFUSED -- and ran out of retries`
vs
**AFTER**: `KbnClientRequesterError: [GET -
http://localhost:5620/api/status] request failed (attempt=5/5):
ECONNREFUSED -- and ran out of retries`
So it's now `(attempt=5/5)` and no longer `(attempt=0/5)`
## To Verify
**no need to start server**
Place a `.only` on [this
line](7089f35803/x-pack/test_serverless/functional/test_suites/common/management/transforms/transform_list.ts (L40))
Then run the test with the `.only`
```
TEST_BROWSER_HEADLESS=1 node scripts/functional_test_runner
--config=x-pack/test_serverless/functional/test_suites/security/config.context_awareness.ts
```
## Summary
Updating the quick start guides.
Changes:
- introduce a new semantic search guide which talks through
semantic_text
- vector search updates to make the examples simpler + callouts to use
semantic search with semantic_text
- Updates to AI search to make it more up to date
### Checklist
Delete any items that are not applicable to this PR.
- [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
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: Rodney Norris <rodney@tattdcodemonkey.com>
## Summary
Fix https://github.com/elastic/kibana/issues/54376
Fix https://github.com/elastic/kibana/issues/127733
- get rid of the `InjectedMetadata.vars` and `getInjectedVar` deprecated
"API"
- Add `apmConfig` as an explicit `InjectedMetadata` property instead of
passing it via `vars`
- Inject the apm config from the `rendering` service instead of
`httpResource`, as it's just how it should be and how all other things
get injected.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
The PR attempts to fix the flakiness in the e2e tests by avoiding clicks
on an already opened popover. The click statement within
`retry.tryForTime` can be called in succession, which could
inadvertently close the popover, which we want to avoid in this case.
The screenshot from failed tests suggests that the assertion is made on
a closed down popover:

## Summary
Redact url auth data from `description` symbol.
Drop much from the `AxiosError` object, a field of the
`KbnClientRequesterError` class.
## Before
```
ERROR [POST http://elastic_serverless:changeme@localhost:5620/internal/kibana/settings] request failed (attempt=1/3):
ERROR [POST http://elastic_serverless:changeme@localhost:5620/internal/kibana/settings] request failed (attempt=2/3):
ERROR [POST http://elastic_serverless:changeme@localhost:5620/internal/kibana/settings] request failed (attempt=3/3):
ERROR KbnClientRequesterError: [POST http://elastic_serverless:changeme@localhost:5620/internal/kibana/settings] request failed (attempt=3/3): -- and ran out of retries
at KbnClientRequester.request (kbn_client_requester.ts:172:15)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at KbnClientUiSettings.update (kbn_client_ui_settings.ts:91:5)
at kibana_server.ts:30:7
at lifecycle_phase.ts:76:11
at async Promise.all (index 1)
at LifecyclePhase.trigger (lifecycle_phase.ts:73:5)
at functional_test_runner.ts:114:7
at FunctionalTestRunner.runHarness (functional_test_runner.ts:252:14)
at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
at log.defaultLevel (cli.ts:112:32)
at run.ts:73:10
at withProcRunner (with_proc_runner.ts:29:5)
at run (run.ts:71:5)
```
## After
```
ERROR Requesting url (redacted): [http://localhost:5620/internal/kibana/settings]
ERROR Requesting url (redacted): [http://localhost:5620/internal/kibana/settings]
ERROR Requesting url (redacted): [http://localhost:5620/internal/kibana/settings]
ERROR KbnClientRequesterError: [POST - http://localhost:5620/internal/kibana/settings] request failed (attempt=3/3): -- and ran out of retries
at KbnClientRequester.request (kbn_client_requester.ts:131:15)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at KbnClientUiSettings.update (kbn_client_ui_settings.ts:91:5)
at kibana_server.ts:30:7
at lifecycle_phase.ts:76:11
at async Promise.all (index 1)
at LifecyclePhase.trigger (lifecycle_phase.ts:73:5)
at functional_test_runner.ts:114:7
at FunctionalTestRunner.runHarness (functional_test_runner.ts:252:14)
at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
at log.defaultLevel (cli.ts:112:32)
at run.ts:73:10
at withProcRunner (with_proc_runner.ts:29:5)
at run (run.ts:71:5)
```
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
Added CHIPS support. `statehood` doesn't support partitioned cookie out
of the box. We can leverage
[contextualize](https://github.com/hapijs/statehood/blob/master/lib/index.js#L35)
function in statehood with a trick, modifying `isSameSite` property.
`Partitioned` attribute is appended only if embedding is not disabled.
## How to test
1. Add to kibana config:
```yml
server.securityResponseHeaders.disableEmbedding: false
xpack.security.sameSiteCookies: 'None'
xpack.security.secureCookies: true
```
2. ES and Kibana need to run over https to test that, because of
`SameSite=None` settings.
Check the `sid` cookie was set with `Partitioned` attribute.
`Set-Cookie` header has `Partitioned` attribute.

Stored cookie has a `Partition Key`
<img width="1233" alt="Screenshot 2024-07-10 at 18 04 13"
src="https://github.com/user-attachments/assets/cc0c453e-e33f-4999-bcff-d2acd3a0fcd2">
### 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
__Fixes: https://github.com/elastic/kibana/issues/180974__
### Release Notes
Added CHIPS cookie support.
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
The current snippet for Linux and Mac fails if it has been run in the
same working dir already, as the directory the collector is unpacked
into exists already and `mkdir` will fail. This PR adds the `-p` flag to
avoid this.
It also updates the snapshot.
This PR updates the function definitions and inline docs based on the
latest metadata from Elasticsearch.
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
## Summary
Resolves https://github.com/elastic/kibana/issues/188663
Rename variables and files and delete unused files to remove references
to Uptime within Synthetics
Also adds the `x-elastic-internal-origin` header to synthetics e2e tests
This PR fixes two bugs that were causing failures leading to recursion
timeouts when generating integrations:
1) Small prompt tweak to the related prompt instruction the LLM to
include the if condition inside the processor
2) Followup fix to https://github.com/elastic/kibana/pull/187643 to also
include a field null check on the processor
## Summary
Fix adding ECS group fields to the recovered alert document for the
custom threshold rule; previously
([PR](https://github.com/elastic/kibana/pull/188241)), it was added to
the context instead of the root level.
|Before|After|
|---|---|
||
The ECS group by fields should be in AAD for all alerts:
|Active|Recovered|No data|
|---|---|---|
||
## Summary
This pr updates the cases public component props to accept an onLoad
prop that is already exposed by the alerts table in trigger actions ui,
to be used in the cases alerts table by security solution to fetch notes
data whenever the set of documents in the table changes. Also creates a
new hook for using this logic in the data fetching hooks powering the
various data tables in the security solution.
### 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
## Summary
This PR fixes an UI bug. When preview status is tracked in url, opening
multiple previews, and clicking `Back` flashes. This is a follow up of
the preview logic changes in
https://github.com/elastic/kibana/pull/186130
To avoid url keeping track of all the previews (which will cause url
length explosion), we only keep the last preview in url, and to keep url
and redux state in sync, redux also always has 1 preview. Before the
fix, we would call `previousPreviewPanelAction`, which empty the preview
array and caused the preview panel to disappear.
**Before**
In a split second, you can see the preview disappears (showing Endpoint
security) and then the user preview appears. Redux shows a call of
`previousPreviewPanelAction` and it empties the preview array
https://github.com/user-attachments/assets/babb12f2-1c1d-422a-87ef-153ed207817b
After
https://github.com/user-attachments/assets/b2ef891c-181d-4da3-9efb-e4afc7123a99
Runtime mappings need to be passed to the categorization request factory
function and the field validation function.
Initially they were excluded because we only allow pattern analysis on
text fields and it is not possible to create a text runtime field.
However it is possible to apply a filter which uses a runtime field and
doing so causes pattern analysis to fail.
@walterra I have not investigated log rate analysis' behaviour, in this
PR I have just updated the call to `createCategoryRequest` to pass
`undefined`
To test, create a runtime mapping in the data view. Use this in the
query bar or in a filter in Discover and ML's Log Pattern Analysis page.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Part of #186515
Split FTR configs manifest into multiple files based on distro
(serverless/stateful) and area of testing (platform/solutions)
Update the CI scripts to support the change, but without logic
modification
More context:
With this change we will have a clear split of FTR test configs owned by
Platform and Solutions. It is a starting point to make configs
discoverable, our test pipelines be flexible and run tests based on
distro/solution.
Part of https://github.com/elastic/kibana/issues/75867
Depends on merging first https://github.com/elastic/telemetry/pull/3759
## Summary
Define new telemetry hourly job for reusable policies; Example of data:
```
{
total_integration_policies: 3,
shared_integration_policies: 2,
shared_integrations: {
agents: 10,
name: 'aws-1',
pkg_name: 'aws',
pkg_version: '1.0.0',
shared_by_agent_policies: 3,
}
```
### 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
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## FTR tests for manual rule run:
For all rule types we cover
- that manual rule run can generate alerts
- that it not create duplicates (except case for threshold and esql)
- that suppression work per execution (except trhreshold)
- that suppression work per time period
For IM rule also covered that `threat_query `not affected by manual rule
run range
Also covered several common cases, but tests are created only for custom
query rule:
- disabling rule, after manual rule run execution started, not affecting
manual run executions
- changing name of the rule after manual rule run started, not affecting
alert generated by manual rule run executions
related:
https://github.com/elastic/security-team/issues/9826#issue-2379978026
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
This PR changes the working directory to build the integration Zip
package from `/tmp` to the Kibana data directory using the `@kbn/utils`
library.
It also removes the working directory when the integration zip build
finishes, to keep the house clean.
This change is necessary to prevent the ENOENT error from happening in
serverless environments when creating the working directory.
Before:

After:

---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>