Commit graph

451 commits

Author SHA1 Message Date
Kibana Machine
a44ba7e18a
[8.13] [Search] Fix native connector search results (#178003) (#178064)
# Backport

This will backport the following commits from `main` to `8.13`:
- [[Search] Fix native connector search results
(#178003)](https://github.com/elastic/kibana/pull/178003)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Navarone
Feekery","email":"13634519+navarone-feekery@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-03-06T08:34:12Z","message":"[Search]
Fix native connector search results (#178003)\n\n## Summary\r\n\r\nThis
fixes the search result to redirect to native connector pages if\r\nthe
user is on cloud and the connector supports native. Otherwise
the\r\nconnector page will be for a connector client.\r\n\r\nAlso
consolidate the reference for connector integrations used
for\r\nsearching the top search bar and the integrations
page.\r\nThere's a lot of repetitiveness here, and because they are very
similar\r\nin both use and design, it is ideal to have a single source
of
truth.","sha":"9262d96788dbf23c20f29b8f778accd862d07ca6","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.13.0","v8.14.0"],"title":"[Search]
Fix native connector search
results","number":178003,"url":"https://github.com/elastic/kibana/pull/178003","mergeCommit":{"message":"[Search]
Fix native connector search results (#178003)\n\n## Summary\r\n\r\nThis
fixes the search result to redirect to native connector pages if\r\nthe
user is on cloud and the connector supports native. Otherwise
the\r\nconnector page will be for a connector client.\r\n\r\nAlso
consolidate the reference for connector integrations used
for\r\nsearching the top search bar and the integrations
page.\r\nThere's a lot of repetitiveness here, and because they are very
similar\r\nin both use and design, it is ideal to have a single source
of
truth.","sha":"9262d96788dbf23c20f29b8f778accd862d07ca6"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/178003","number":178003,"mergeCommit":{"message":"[Search]
Fix native connector search results (#178003)\n\n## Summary\r\n\r\nThis
fixes the search result to redirect to native connector pages if\r\nthe
user is on cloud and the connector supports native. Otherwise
the\r\nconnector page will be for a connector client.\r\n\r\nAlso
consolidate the reference for connector integrations used
for\r\nsearching the top search bar and the integrations
page.\r\nThere's a lot of repetitiveness here, and because they are very
similar\r\nin both use and design, it is ideal to have a single source
of truth.","sha":"9262d96788dbf23c20f29b8f778accd862d07ca6"}}]}]
BACKPORT-->

Co-authored-by: Navarone Feekery <13634519+navarone-feekery@users.noreply.github.com>
2024-03-06 03:10:54 -07:00
Kibana Machine
553b27ac10
[8.13] Add tiles and integrations for Jira Data Center and Confluence Data Center (#177436) (#177558)
# Backport

This will backport the following commits from `main` to `8.13`:
- [Add tiles and integrations for Jira Data Center and Confluence Data
Center (#177436)](https://github.com/elastic/kibana/pull/177436)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Artem
Shelkovnikov","email":"artem.shelkovnikov@elastic.co"},"sourceCommit":{"committedDate":"2024-02-22T00:49:21Z","message":"Add
tiles and integrations for Jira Data Center and Confluence Data Center
(#177436)\n\n## Summary\r\n\r\nThis PR adds tiles for two
connectors:\r\n\r\n- Jira Data Center\r\n- Confluence Data
Center\r\n\r\nThese connectors internally use same service types: `jira`
and\r\n`confluence`. They re-use documentation for these connectors - it
can be\r\nfound in the same pages as for original Jira/Confluence
connectors.\r\n\r\nThe tiles are added to Enterprise Search connectors
page + into\r\nintegrations page. See screenshots.\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 10
20\"\r\nsrc=\"da944de9-828b-453b-ad38-1695ae3d557a\">\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 11
09\"\r\nsrc=\"aaac975e-e423-42a3-846b-628e9e673b5a\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\\\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c2dedc957a029c7b51a2abad4e4d79922d5d77ea","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:feature","backport:prev-minor","v8.13.0","v8.14.0"],"title":"Add
tiles and integrations for Jira Data Center and Confluence Data
Center","number":177436,"url":"https://github.com/elastic/kibana/pull/177436","mergeCommit":{"message":"Add
tiles and integrations for Jira Data Center and Confluence Data Center
(#177436)\n\n## Summary\r\n\r\nThis PR adds tiles for two
connectors:\r\n\r\n- Jira Data Center\r\n- Confluence Data
Center\r\n\r\nThese connectors internally use same service types: `jira`
and\r\n`confluence`. They re-use documentation for these connectors - it
can be\r\nfound in the same pages as for original Jira/Confluence
connectors.\r\n\r\nThe tiles are added to Enterprise Search connectors
page + into\r\nintegrations page. See screenshots.\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 10
20\"\r\nsrc=\"da944de9-828b-453b-ad38-1695ae3d557a\">\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 11
09\"\r\nsrc=\"aaac975e-e423-42a3-846b-628e9e673b5a\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\\\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c2dedc957a029c7b51a2abad4e4d79922d5d77ea"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177436","number":177436,"mergeCommit":{"message":"Add
tiles and integrations for Jira Data Center and Confluence Data Center
(#177436)\n\n## Summary\r\n\r\nThis PR adds tiles for two
connectors:\r\n\r\n- Jira Data Center\r\n- Confluence Data
Center\r\n\r\nThese connectors internally use same service types: `jira`
and\r\n`confluence`. They re-use documentation for these connectors - it
can be\r\nfound in the same pages as for original Jira/Confluence
connectors.\r\n\r\nThe tiles are added to Enterprise Search connectors
page + into\r\nintegrations page. See screenshots.\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 10
20\"\r\nsrc=\"da944de9-828b-453b-ad38-1695ae3d557a\">\r\n\r\n<img
width=\"1217\" alt=\"Screenshot 2024-02-21 at 14 11
09\"\r\nsrc=\"aaac975e-e423-42a3-846b-628e9e673b5a\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\\\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c2dedc957a029c7b51a2abad4e4d79922d5d77ea"}}]}]
BACKPORT-->

Co-authored-by: Artem Shelkovnikov <artem.shelkovnikov@elastic.co>
2024-02-22 03:51:14 -07:00
Kibana Machine
a6d11b004c
[8.13] Add tiles for Notion and Redis connector (#177306) (#177500)
# Backport

This will backport the following commits from `main` to `8.13`:
- [Add tiles for Notion and Redis connector
(#177306)](https://github.com/elastic/kibana/pull/177306)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Artem
Shelkovnikov","email":"artem.shelkovnikov@elastic.co"},"sourceCommit":{"committedDate":"2024-02-21T17:50:08Z","message":"Add
tiles for Notion and Redis connector (#177306)\n\n## Summary\r\n\r\nThis
PR adds tiles for two new connectors:\r\n\r\n- Redis\r\n-
Notion\r\n\r\nThe tiles are added to Enterprise Search connectors page +
into\r\nintegrations page. See screenshots.\r\n\r\n<img width=\"1217\"
alt=\"image\"\r\nsrc=\"17bac917-f636-477e-91ae-facc48b3c06c\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"f56f44bf-25a9-464c-b84b-f71947d7a3c3\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"329a3a7e-da1b-49b3-902f-75421fb9e289\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"81bccc5a8130f8d0c5641ecc6f5a4076281332d4","branchLabelMapping":{"^v8.14.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:feature","v8.13.0","v8.14.0"],"title":"Add
tiles for Notion and Redis
connector","number":177306,"url":"https://github.com/elastic/kibana/pull/177306","mergeCommit":{"message":"Add
tiles for Notion and Redis connector (#177306)\n\n## Summary\r\n\r\nThis
PR adds tiles for two new connectors:\r\n\r\n- Redis\r\n-
Notion\r\n\r\nThe tiles are added to Enterprise Search connectors page +
into\r\nintegrations page. See screenshots.\r\n\r\n<img width=\"1217\"
alt=\"image\"\r\nsrc=\"17bac917-f636-477e-91ae-facc48b3c06c\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"f56f44bf-25a9-464c-b84b-f71947d7a3c3\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"329a3a7e-da1b-49b3-902f-75421fb9e289\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"81bccc5a8130f8d0c5641ecc6f5a4076281332d4"}},"sourceBranch":"main","suggestedTargetBranches":["8.13"],"targetPullRequestStates":[{"branch":"8.13","label":"v8.13.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.14.0","branchLabelMappingKey":"^v8.14.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/177306","number":177306,"mergeCommit":{"message":"Add
tiles for Notion and Redis connector (#177306)\n\n## Summary\r\n\r\nThis
PR adds tiles for two new connectors:\r\n\r\n- Redis\r\n-
Notion\r\n\r\nThe tiles are added to Enterprise Search connectors page +
into\r\nintegrations page. See screenshots.\r\n\r\n<img width=\"1217\"
alt=\"image\"\r\nsrc=\"17bac917-f636-477e-91ae-facc48b3c06c\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"f56f44bf-25a9-464c-b84b-f71947d7a3c3\">\r\n\r\n<img
width=\"1217\"
alt=\"image\"\r\nsrc=\"329a3a7e-da1b-49b3-902f-75421fb9e289\">\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"81bccc5a8130f8d0c5641ecc6f5a4076281332d4"}}]}]
BACKPORT-->

Co-authored-by: Artem Shelkovnikov <artem.shelkovnikov@elastic.co>
2024-02-21 12:18:00 -07:00
Davis McPhee
509248b0c6
[Saved Queries] Improve saved query management (#170599)
## Summary

This PR introduces a number of changes and improvements to saved query
management:
- Add server side pagination (5 queries per page) and search
functionality to the "Load query" list, which improves UX and
performance by no longer requesting all queries at once.
- Redesign the "Load query" list to improve the UX and a11y, making it
possible for keyboard users to effectively navigate the list and
load/delete queries.
- Add an "Active" badge to the "Load query" list to indicate which list
entry represents the currently loaded query, and hoist the entry to the
top of the first page for better visibility when no search term exists.
- Deprecate the saved query `/_all` endpoint and update it to return
only the first 100 queries instead of loading them all into memory at
once.
- Add a new `titleKeyword` field to the saved query SO, which allows
sorting queries alphabetically by title when displaying them in the
"Load query" list.
- Improve the performance of the "has saved queries" check when Unified
Search is mounted to no longer request actual queries, and instead just
request the count.
- Update the saved query duplicate title check to no longer rely on
fetching all queries at once, and instead asynchronously check for
duplicates by title on save.
- Add server side duplicate title validation to the create and update
saved query endpoints.
- Various small fixes and cleanups throughout saved query management.


43328aea-0f7b-4b7a-a5fb-e33ed822f317

Resolves #172044.
Resolves #176427.

## Testing

To generate saved queries for testing, run the script below and replace
`{KIBANA_REQUEST_COOKIE}` with the cookie header value from an API
request of a Kibana user with an active session:
```shell
for i in {1..100}; do curl 'http://localhost:5601/internal/saved_query/_create' \
  -H 'Accept: */*' \
  -H 'Accept-Language: en-US,en;q=0.9,az;q=0.8,es;q=0.7' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: {KIBANA_REQUEST_COOKIE}' \
  -H 'elastic-api-version: 1' \
  -H 'kbn-build-number: 9007199254740991' \
  -H 'kbn-version: 8.13.0' \
  -H 'x-elastic-internal-origin: Kibana' \
  --data-raw '{"title":"query '"$(echo $(($i - 1)) | tr '[0-9]' '[a-j]')"'","description":"","query":{"query":"bytes > 500","language":"kuery"},"filters":[]}' \
  --compressed; done
```

### 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
- [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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] 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)
- [x] 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))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### 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: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-02-12 13:18:17 -04:00
Stratoula Kalafateli
43d93baf29
Make the drop_null_columns configurable in ES|QL search strategies (#176236)
## Summary

Fixes https://github.com/elastic/kibana/issues/176227

As not everyone is using expressions and the `?drop_null_columns`
significantly changing the output, I am making this configurable. So for
the expressions users it will always be true but for anyone else it
would be false unless they specifically configure it.

This PR is fixing it but Nathan is going to follow up:

- maps are setting the drop_null_columns to true (as it makes the
response smaller, which is always a benefit)
- add some FTs to test the output

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2024-02-06 16:28:08 +02:00
Stratoula Kalafateli
5104183911
[ES|QL] Distinguish among empty and available fields (#174585) 2024-02-02 18:30:24 +02:00
Matthew Kime
acdaf0127e
[data views] cache field caps requests (#168910)
## Summary

Closes: https://github.com/elastic/kibana/issues/169622

Field caps request caching - implement `stale-while-revalidate` cache
headers and etags with 304 responses as appropriate.

This PR accomplishes
- Adds 304 Not Modified to http server
- Adds refresh button to data view management that force refreshes field
list
- Adds `/internal/data_views/fields` endpoint which supports caching. 
- This is necessary since `fields_for_wildcard` doesn't support caching
due to POST requests
- Adds `stale-while-revalidate` header directive UNLESS field list is
empty.
- Uses Vary header with hash of user id to force requests when user has
changed.
- Unchanged field list responses won't recreate data view field list

### How to test
1. Pop open the dev tools to the network tab and make sure 'Disable
cache' is unchecked. filter for 'fields' requests
2. Load more than one data set (sample data is fine)
3. Go to discover
4. Switch selected data views. Notice status code on first load vs
subsequent loads
5. Open a new window, notice loading from cache
6. Push document that changes field list. You'll need to wait for cache
to expire for it to load. The default is 5s.
7. Notice that field list loads after cache is old properly result in
304 response.
8. Set `data_views:cache_max_age`, shift reload. No field requests will
be cached.

#### Note on Safari

Safari doesn't support the `stale-while-revalidate` directive.
Additionally, the Safari dev console shows 304 responses as 200's. I
figured this out by adding console statements to the fields endpoint. As
best I can tell, Safari won't be performant on slow clusters but its
also no slower than it was before this PR. Safari does respect the
disabling of cache headers.

## Release note

Data View field list requests are now cached with a
`stale-while-revalidate` strategy. This means that after the initial
field list request, all subsequent requests return the cached response
which is very fast. If the cache is determined to be stale then the
cache will update in the background and new data will be available on
the next request.

This behavior can be modified via the `data_views:cache_max_age` Kibana
advanced setting. Setting it to zero will disable the cache. All other
values (in seconds) will be used to determine whether the cache is
stale. The default value is 5 seconds.

The field list can be manually updated via the refresh button in data
view management or a hard refresh with your browser.

Note for Safari: The `stale-while-revalidate` cache directive is
unsupported, therefore it makes additional requests. If this is
impacting Kibana performance then try Chrome or Firefox.

Data View Management

<img width="1064" alt="Screenshot 2024-01-09 at 1 36 20 PM"
src="f272c19f-81b4-4697-9303-b1f8f150e2b9">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2024-01-16 06:54:38 -06:00
Elena Stoeva
946b38ed57
[Advanced Settings] Fix defaultIndex setting's default value (#170865)
Fixes https://github.com/elastic/kibana/issues/168732

## Summary

This PR changes the default value of the `defaultIndex` setting to an
empty string. Previously, the default value was set to `null` and this
was causing a wrong behaviour in the Advanced Settings UI as it expects
a string value for the settings of type `string`.

**Before - the "Reset to default" link did not clear the user value:**


2c47306b-feac-4e08-bbae-3db7b0a3e5fd


**With these changes:**


dc46caa8-9860-4b66-87ca-9c184c5a8391
2023-12-11 10:01:01 +00:00
Eyo O. Eyo
cfe0d1cbc8
Investigate failing sample data API integration test (#169638)
## Summary

Investigate failing sample data integration test. Changes expectation to
consider the entire interval in milliseconds of the sample data, in
place of the value in weeks.

<!-- 
### 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&mdash;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&mdash;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)

-->
2023-12-08 16:38:07 +01:00
Yulia Čech
a29b0f4573
[Console] Add api integration tests for serverless (#172306)
## Summary

This PR adds api integration test for Console routes: some were missing
on stateful and all are now enabled on serverless.
2023-12-05 10:26:51 +01:00
Ahmad Bamieh
32d9e22a18
[Tests] apis UI Counters UI remove dependency on date (#170734)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alejandro Fernández Haro <afharo@gmail.com>
2023-11-14 06:37:52 -07:00
Nathan Reese
f28445449e
[inspector] show request method, path, and querystring (#169970)
Closes https://github.com/elastic/kibana/issues/45931

PR updates data plugin `search` and `bsearch` endpoints to return
method, path, and querystring request params from elasticsearch-js
client requests. This provides inspector with the exact details used to
fetch data from elasticsearch, ensuring inspector displays request
exactly as used by elasticsearch-js client.

**ESQL** This PR makes it possible to open ESQL searches in console.
<img width="500" alt="Screen Shot 2023-09-16 at 4 19 58 PM"
src="56019fb5-ca88-46cf-a42f-86f5f51edfcc">

### background
If you are thinking to yourself, "haven't I reviewed this before?", you
are right. This functionality has been through several iterations.
1) Original PR https://github.com/elastic/kibana/pull/166565 was
reverted for exposing `headers`.
2) [Fix to only expose method, path, and querystring keys from request
parameters](https://github.com/elastic/kibana/pull/167544) was rejected
because it applied changes to
`kibana_utils/server/report_server_error.ts`, which is used extensively
throughout Kibana.
3) This iteration moves logic into the data plugin to be as narrow as
possible.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-03 15:46:55 -06:00
Nathan Reese
adf3b8b436
[search source] return rawResponse on search failure (#168389)
Closes https://github.com/elastic/kibana/issues/167099

#### Problem
`/bsearch` and `/search` APIs only return `error` key from elasticsearch
error response. This is problematic because Inspector needs
`rawResponse` to populate "Clusters and shards"

While working on this issue, I discovered another problem with how error
responses are added to inspector requestResponder. The `Error` instance
is added as `json` key. This is a little awkward since the response tab
just stringifies the contents of `json`, thus stringifing the Error
object instead of just the error body returned from API. This PR address
this problem by setting `json` to either `attributes` or `{ message }`.

#### Solution
PR updates `/bsearch` and `/search` APIs to return `{ attributes: {
error: ErrorCause, rawResponse }}` for failed responses. Solution
avoided changing KbnServerError and reportServerError since these
methods are used extensivly throughout Kibana (see
https://github.com/elastic/kibana/pull/167544#discussion_r1342460941 for
more details). Instead, KbnSearchError and reportSearchError are created
to report search error messages.

#### Test
1) install web logs sample data set
2) open discover
3) add filter
    ```
    {
      "error_query": {
        "indices": [
          {
            "error_type": "exception",
            "message": "local shard failure message 123",
            "name": "kibana_sample_data_logs",
            "shard_ids": [
              0
            ]
          }
        ]
      }
    }
    ```
4) Open inspector. Verify "Clusters and shards" tab is visible and
populated. Verify "Response" tab shows "error" and "rawResponse" keys.
<img width="500" alt="Screenshot 2023-10-09 at 9 29 16 AM"
src="461b0eb0-0502-4d48-a487-68025ef24d35">
<img width="500" alt="Screenshot 2023-10-09 at 9 29 06 AM"
src="9aff41eb-f771-48e3-a66d-1447689c2c6a">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2023-10-23 10:59:17 -06:00
Steph Milovic
91435a573f
Data views, getExistingIndices method to server side (#168522) 2023-10-16 14:19:50 -06:00
Tiago Costa
fed5c52859
skip flaky suite (#166572) 2023-10-15 19:39:02 +01:00
Efe Gürkan YALAMAN
8d9e12a19b
[Enterprise Search] Update connector tiles (#167656)
## Summary

- Update Integration Tiles
- Update Select Connector Tiles
- GitHub, OneDrive, Google Drive to native connectors

<img width="1427" alt="Screenshot 2023-09-29 at 16 38 08"
src="49607717-9c1d-4b73-8ae9-612c13641671">
<img width="1243" alt="Screenshot 2023-09-29 at 16 38 13"
src="f2ca0c1f-95ab-4f59-9baa-5fc59a42d5dc">
<img width="1317" alt="Screenshot 2023-09-29 at 16 38 25"
src="b8c758d5-f615-4ba7-805f-e944712b8777">
<img width="1366" alt="Screenshot 2023-09-29 at 16 38 44"
src="ca102329-e40c-4ebd-b7d4-6184b18bf0c2">
<img width="1452" alt="Screenshot 2023-09-29 at 16 38 51"
src="f6116d57-9a68-4538-8b92-7c296886c0bd">



### 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)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] 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))
- [x] 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))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-10-03 14:33:13 +02:00
Tiago Costa
7fdd25184d
skip flaky suite (#98240) 2023-10-03 12:08:42 +01:00
Rudolf Meijering
239e50389f
Revert "[inspector] show request method, path, and querystring" (#167485)
This reverts commit d61a5a0516 from
#166565

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### 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&mdash;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&mdash;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)
2023-09-28 14:27:14 +02:00
Nathan Reese
d61a5a0516
[inspector] show request method, path, and querystring (#166565)
Closes https://github.com/elastic/kibana/issues/45931

PR updates bsearch service to return request params from
elasticsearch-js client requests. This provides inspector with the exact
details used to fetch data from elasticsearch, ensuring inspector
displays request exactly as used by elasticsearch-js client.

**ESQL** This PR makes it possible to open ESQL searches in console.
<img width="500" alt="Screen Shot 2023-09-16 at 4 19 58 PM"
src="56019fb5-ca88-46cf-a42f-86f5f51edfcc">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-21 06:52:03 -06:00
Robert Oskamp
d2feac06d4
FTR - adjust auth for esSupertest in serverless (#166745)
## Summary

This PR removes the `systemIndicesSuperuser` auth in the `esSupertest`
service for serverless test runs, adds `certificateAuthorities` to the
Elasticsearch server config in serverless and adds a tiny test to verify
functionality of this fix.

### Details

Issues before this PR when using the `esSupertest` service in serverless
tests (can be reproduced by running the added `elasticsearch_api` test
without the supertest and config changes):

1. Running against a local `functional_tests_server`, `esSupertest`
produces an error: `Error: self-signed certificate in certificate chain`
2. Running against an MKI project produces an error: `unable to
authenticate user [system_indices_superuser] for REST request [/]`,
because the `system_indices_superuser` doesn't exist in MKI.

How this PR addresses the issues:

1. Add `certificateAuthorities` to `servers.elasticsearch` in
`x-pack/test_serverless/shared/config.base.ts` in the same way we
already have it for `servers.kibana`
2. Modify the `esSUpertest` service to not override the default ES auth
when running in serverless, instead go with the default auth (regular
superuser), which is the best we can get.

### Additional information

It has been considered to add a serverless specific version of
`esSupertest` in order to avoid the `config.get('serverless') ?` code.
The fact that a number of stateful services are planned to be re-used in
serverless and rely on `esSupertest` in combination with the very small
change in a central service made it seem worth to make an exception
here.

Note that service methods or tests that use `esSupertest` can still run
into issues on serverless if they actually try to modify system indices.
This should be avoided anyways and particularly for serverless tests.
2023-09-21 10:57:37 +02:00
Drew Tate
6d47334528
[Event annotations] add more API integration tests (#166463)
## Summary

Covers the event annotations API in tests.

Part of https://github.com/elastic/kibana/issues/159053
Part of https://github.com/elastic/kibana/issues/161038

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-18 12:45:06 -05:00
Eyo O. Eyo
92fcfa9747
Fix issue with flaky sample data API integration test (#165328)
## Summary

Closes;  
- https://github.com/elastic/kibana/issues/164568
- https://github.com/elastic/kibana/issues/121883
  
## Context;  

This issue is caused by inconsistencies in timestamp format existing in
the [sample data for
flights](https://github.com/elastic/kibana/blob/8.10/src/plugins/home/server/services/sample_data/data_sets/flights/flights.json.gz).

See screenshot; 

<img width="1020" alt="Screenshot 2023-09-06 at 09 45 18"
src="e358eb2d-dc92-4e0d-b697-e362e2dbd33b">

When the flight sample data is being installed, on encountering any one
of these data points with a timestamp that's not a valid representation
for a date ISOString, it results in the [computation of a
value](https://github.com/elastic/kibana/blame/v8.9.1/src/plugins/home/server/services/sample_data/lib/translate_timestamp.ts#L46)
that can not be parsed as a valid date, this is verifiable taking a look
at the result of a failed flaky test run
[here](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3037#018a5164-27e7-45d9-897c-56f34fe2bfc3/288-1243)
logging the documents returned that the test would run against, one
would note that the timestamp value for the first document is
`2000-01-15T` which computes to `NaN` when parsed which further cascades
into other parts of the test, causing it to fail eventually.

This PR removes the data points with the invalid timestamps and modifies
the tests to match the new expectation for the number of documents that
should have been indexed. This change set was also ran through the
[flaky test
runner](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3077)
with success.


### 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
2023-09-13 13:05:55 +02:00
Alejandro Fernández Haro
0ea37c1b42
[On-Week] Hot update of APM/EBT labels (#157093) 2023-08-31 14:36:20 +02:00
Alejandro Fernández Haro
0236516351
[Flaky #98240] Unskip test (#165197) 2023-08-30 17:04:22 +02:00
Matthias Wilhelm
76ac34a9b7
[DataViews] Improve error handling of resolving indices (#164400)
When in data view management an exact match index pattern is entered (without wildcard), there's now a status code of 404 instead of 500 returned, and no more error message logged.
2023-08-25 18:27:30 +02:00
Matthew Kime
0d72b8f75b
[data views] fix fields for wildcard integration test (#164772)
## Summary

I'm waiting for this to fail CI - this means that a new ES snapshot is
being used. Then we update the test snapshot and should be good to
merge.

The lastest ES snapshot is returning field types in a different order
which really doesn't matter to this endpoint so I'll just update the
snapshot.

Closes https://github.com/elastic/kibana/issues/164753
2023-08-24 21:03:33 -05:00
Kibana Machine
13701d3842 skip failing test suite (#164568) 2023-08-24 13:11:20 -04:00
Tiago Costa
30872c4bab
skip failing es promotion suites (#164753) 2023-08-24 17:36:20 +01:00
Rudolf Meijering
9a77123e4b
Fix 7.17 forward compatibility with 8.2+ (#164274)
## Summary

Forward-ports #164043 to `main`


### 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&mdash;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&mdash;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)
2023-08-23 04:09:26 -07:00
Lukas Olson
57b7efc3eb
Update error handling for saved query service (#163904)
## Summary

Resolves https://github.com/elastic/kibana/issues/153497.

Updates the saved query service to properly handle & return errors from
the saved object client. Instead of displaying "internal server error"
and returning 500, specific error messages occur for corresponding saved
object client errors.

After:


![image](f8ba7b90-77fe-4db9-8377-0a1f878fe3a0)

### To do

- [x] API integration tests

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-22 13:09:00 -07:00
Tim Sullivan
f1402d682c
unskip sample_data_apis test: dates (#164112)
## Summary

Closes https://github.com/elastic/kibana/issues/121051

I'm not seeing flakiness in the test suite after enabling all the tests.

Test suite: `test/api_integration/config.js`
Test runs:
*
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2904
*
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2917
2023-08-18 16:44:21 -07:00
Drew Tate
276cf86858
[Event annotations] add types to integration tests (#164103) 2023-08-17 09:17:25 -05:00
Drew Tate
08a48f3cf1
[Lens] allow removing ad-hoc data view from event annotation group (#163976) 2023-08-16 10:24:15 -05:00
Alejandro Fernández Haro
0284cc158d
[Telemetry] Use header-based versioned APIs instead of path-based (#159839) 2023-08-12 14:20:06 -07:00
Matthew Kime
cafaa9295e
[data views] swap_references api improvements (#163225)
## Summary

Some simple dev UX improvements to the swap_references data views api - 

```
POST /api/data_views/swap_references/_preview
{
     "fromId" : "abcd-efg",
     "toId" : "xyz-123"
}

returns 
{
  result: [{ id: "123", type: "visualization" }],
}
```


```
POST /api/data_views/swap_references
{
     "fromId" : "abcd-efg",
     "toId" : "xyz-123",
     "delete" : true // optional, removes data view which is no longer referenced
}

returns 
{
  result: [{ id: "123", type: "visualization" }],
  deleteStatus: {
    remainingRefs: 0,
    deletePerformed: true
}
```

Additional params - 

```
fromType: string - specify the saved object type. Default is `index-pattern` for data view
forId: string | string[] - limit the affected saved objects to one or more by id
forType: string - limit the affected saved objects by type
```

Improves upon https://github.com/elastic/kibana/pull/157665

Docs will be created in follow up PR
2023-08-11 20:56:46 -05:00
Sander Philipse
a4d3c0203f
[Enterprise Search] Update connectors for 8.10 (#162909)
## Summary

This adds native connectors, updates existing connectors, and rebrands
the Enterprise Search tag to Search in the Integrations page.
2023-08-03 07:14:07 -07:00
Dzmitry Lemechko
f6a90974e9
[es_archives] add 'auto_expand_replicas: 0-1' in index mappings (#162499)
Currently, if you try loading archive with index mappings not having
replica set into stateless ES, it won't work properly: you will get 503
error on calling `GET <index_name>/_stats`:
```
{
  "error": {
    "root_cause": [
      {
        "type": "no_shard_available_action_exception",
        "reason": null
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "indices-stats",
        "node": null,
        "reason": {
          "type": "no_shard_available_action_exception",
          "reason": null
        }
      }
    ]
  },
  "status": 503
}
```
In stateless replica is
[required](https://elastic.slack.com/archives/C037J0RKRAN/p1690218904855299)
in order to perform search requests (the "search shard").

This PR updates index mappings in es_archives with
`"auto_expand_replicas": "0-1"`, in order to be compatible with
stateless ES and so that we can re-use existing data sets rather than
creating new ones.

I checked with Core Team that we should fine to just adapt all mapping
files, but let me know if that doesn't work for you.
The same value is used to create the "real" SO
[indices](c79c09c3d0/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions/constants.ts (L21))
in Kibana.
2023-07-26 14:30:54 +01:00
Gerard Soldevila
c3a5da8825
[FTR - esArchiver] Update encrypted_saved_objects_api_integration test archives to reduce flakiness (#162321)
## Summary

Part of https://github.com/elastic/kibana/issues/161882

Updates all archives of the `encrypted_saved_objects_api_integration`
test suite:
* Removing SO index definitions.
* Updating documents defined in `data.json`.
2023-07-24 12:33:42 -04:00
Lukas Olson
13372c91ce
[data] Use versioned router for remaining routes (#161919)
## Summary

Uses the versioned router for the remaining routes in the data plugin:
KQL telemetry (opt-in stats), and scripting languages list.

### 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
2023-07-18 14:40:11 -07:00
Gerard Soldevila
7cee23456e
[FTR - esArchiver] Update delete_unknown_types archive to NOT delete SO indices (#161936)
## Summary

Part of https://github.com/elastic/kibana/issues/161882

Updates the
`test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types`
archive:
* deleting `mappings.json`
* updating documents in `data.json`

This way, _esArchiver_ will not delete SO indices and recreate them,
eliminating the odds of the related tests being flaky.
2023-07-17 11:28:10 +02:00
Lukas Olson
4b7d18b5c3
[bfetch] Use versioned router (#161317)
## Summary

Part of https://github.com/elastic/kibana/issues/157095.

Uses the new versioned router capabilities for the bfetch plugin.

### Checklist

- [ ]
[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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-07 16:48:02 -07:00
Matthew Kime
c843c97193
[data views] REST endpoint for swapping saved object references (#157665)
## Summary

Managing large number of saved objects can be cumbersome. This api
endpoint allows the management of references without clicking through a
lot of different UIs.

For example - 

This swaps all data view id `abcd-efg` references to `xyz-123`

```
POST /api/data_views/swap_references
{
     "from_id" : "abcd-efg",
     "to_id" : "xyz-123",
     "preview" : false, // optional, necessary to save changes
     "delete" : true // optional, removes data view which is no longer referenced
}

returns 
{
  preview: false,
  result: [{ id: "123", type: "visualization" }],
  deleteSuccess: true
}
```

Additional params - 
```
from_type: string - specify the saved object type. Default is `index-pattern` for data view
for_id: string | string[] - limit the affected saved objects to one or more by id
for_type: string - limit the affected saved objects by type
```



Closes https://github.com/elastic/kibana/issues/153806
2023-07-06 08:29:01 -05:00
Matthew Kime
803d139adc
[data views] Fix overwrite param for create (#160953)
## Summary

Under some circumstances passing `override` to `POST
/api/data_views/data_view` would fail. Its now fixed.

To test - Try using the override param from the Kibana dev console. I
found it reproduced the problem before the fix and shows its resolved
after the fix. The problem did not appear in the integration tests.

I suspect the problem had to do with how quickly the delete was
performed - if it completed before the create command then everything
was fine. If it didn't then the error would appear. Passing the
overwrite param to the saved object client eliminates the possibility of
the delete failing to complete.

Closes https://github.com/elastic/kibana/issues/161016
2023-07-04 15:35:40 -05:00
Matthew Kime
a91535202a
[data views] Field editor endpoint versioning and schema validation (#159626)
## Summary

- Move field preview to internal route
- Add versioning to route
- Endpoint is called with version
- Response schema validation

Closes https://github.com/elastic/kibana/issues/159158

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-29 19:42:47 -05:00
Davis McPhee
6310e8c6fd
[Data Views] Fix flaky test #156129 (#160472)
Resolves: #156129.

Flaky test runs:
- x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2472
🟥
- x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2487
2023-06-29 11:52:51 -03:00
Gerard Soldevila
4e3f6990c2
Saved Object APIs - FTR - Fix flaky test in _find API (#160794)
## Summary

Attempt to fix https://github.com/elastic/kibana/issues/156581

The best explanation I have is that the two retrieved visualisations are
not necessarily retrieved in the expected order.
Sorting the results should ensure the expected order.

Will use the flaky test runner to check the fix.
2023-06-29 10:39:32 +02:00
Sander Philipse
4d812c1d24
[Enterprise Search] Update connector integrations for 8.9 (#160532)
## Summary

This updates connector tiles for Enterprise Search to bring them in line
with 8.9.

<img width="1032" alt="Screenshot 2023-06-26 at 16 26 40"
src="a222a2a3-17ad-4e72-8ce8-57e09d89d05e">
<img width="1035" alt="Screenshot 2023-06-26 at 16 25 04"
src="3ce1e78c-b4fe-404b-b314-e02f3d6f439e">
<img width="1086" alt="Screenshot 2023-06-26 at 16 24 40"
src="14dd6ca5-875f-4c2d-9408-a2fa15abbbec">

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-06-27 17:23:09 +02:00
Dzmitry Lemechko
88871faf60
FTR: delete .kibana mappings from archives to avoid recreating SO indexes (#159957)
## Summary

Related to #159582

To better understand the PR, we need to have a look at `esArchiver.load`
function and how it handles `mappings.json`:
- It processes the file and if it finds saved object index (e.g.
`.kibana`), it will delete all SO indexes (.kibana,
.kibana_task_manager, .kibana_alerting_cases, etc.) created on Kibana
start. Then esArchiver will re-create all indexes according to defined
mappings.

In order to keep our tests relevant to the latest code changes, it is
good to avoid re-creating SO indexes and use "official" ones whenever it
is possible. This PR removes/cleans `mappings.json` files where it seems
reasonable. I also deleted few not used archives:
- es_archiver/saved_objects/ui_counters
- es_archiver/saved_objects/usage_counters
- security_solution_cypress/es_archives/empty_kibana
2023-06-23 09:04:11 -07:00
Kylie Meli
5c7a5b0956
Add Confluent Cloud to integrations UI (#159735)
## Summary

Add a new tile into the Integrations UI for Confluent Cloud's Elastic
Sink Connector.

Closes https://github.com/elastic/kibana/issues/154173

<img width="1675" alt="Screenshot 2023-06-14 at 1 38 33 PM"
src="964d30be-4d96-47fc-a36e-148aa71e864e">

### 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~
- [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
- [ ] ~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)~
- [X] 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)~

### 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>
2023-06-15 13:56:15 -04:00
Marco Liberati
536a8d4194
[Lens] Add new Metric formatter migrations (#159539)
## Summary

Part of [54306](https://github.com/elastic/kibana/issues/154306) 
Required #158468 to be merged first.

This PR integrates only the migration part of the new Metric new
formatter task.

This migration implementation defines takes the simplest route for the
migration route of metric visualization formatter:
* if any custom formatter is set in Lens, then apply a `compact` flag on
it to keep it consistent
* if `Default` formatter is set in Lens, then assume nothing and let the
regular formatter hierarchy do its own work

### Example

Original dashboard


![image](e5cff808-456d-406e-a221-706c207f7629)

After migration


![image](d3f2052f-13d8-4228-b446-0eaf5a339e13)


### 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&mdash;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&mdash;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>
2023-06-15 13:06:14 +02:00