Skip to content

Commit

Permalink
[8.8] [Saved Search] Update saved search schema to allow empty sort
Browse files Browse the repository at this point in the history
… arrays (#156769) (#156789)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[Saved Search] Update saved search schema to allow empty `sort`
arrays (#156769)](#156769)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Davis
McPhee","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-05T07:16:32Z","message":"[Saved
Search] Update saved search schema to allow empty `sort` arrays
(#156769)\n\n## Summary\r\n\r\nThis PR removes the `minSize` restriction
added in #154016 from the\r\nsaved search schema `sort` property, which
was causing AWS integrations\r\nto
fail.\r\n\r\nBefore:\r\n\r\n![broken](https://user-images.githubusercontent.com/25592674/236355150-112e103b-00ef-4f0d-baa5-35de6b944152.gif)\r\n\r\nAfter:\r\n\r\n![working](https://user-images.githubusercontent.com/25592674/236355167-1185279b-84ef-4570-8762-90944c839c4d.gif)\r\n\r\nFixes
#156724.\r\n\r\n### Checklist\r\n\r\n- [ ] ~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-
[
]\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- [ ] ~Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard\r\naccessibility](https://webaim.org/techniques/keyboard/))~\r\n-
[ ] ~Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~\r\n-
[ ] ~If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~\r\n-
[ ] ~This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~\r\n-
[ ] ~This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)~\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)","sha":"2f53207727d321363a1664e2a952301fd5b20f7e","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Saved
Objects","release_note:skip","Team:DataDiscovery","v8.8.0","v8.9.0"],"number":156769,"url":"https://github.com/elastic/kibana/pull/156769","mergeCommit":{"message":"[Saved
Search] Update saved search schema to allow empty `sort` arrays
(#156769)\n\n## Summary\r\n\r\nThis PR removes the `minSize` restriction
added in #154016 from the\r\nsaved search schema `sort` property, which
was causing AWS integrations\r\nto
fail.\r\n\r\nBefore:\r\n\r\n![broken](https://user-images.githubusercontent.com/25592674/236355150-112e103b-00ef-4f0d-baa5-35de6b944152.gif)\r\n\r\nAfter:\r\n\r\n![working](https://user-images.githubusercontent.com/25592674/236355167-1185279b-84ef-4570-8762-90944c839c4d.gif)\r\n\r\nFixes
#156724.\r\n\r\n### Checklist\r\n\r\n- [ ] ~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-
[
]\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- [ ] ~Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard\r\naccessibility](https://webaim.org/techniques/keyboard/))~\r\n-
[ ] ~Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~\r\n-
[ ] ~If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~\r\n-
[ ] ~This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~\r\n-
[ ] ~This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)~\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)","sha":"2f53207727d321363a1664e2a952301fd5b20f7e"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156769","number":156769,"mergeCommit":{"message":"[Saved
Search] Update saved search schema to allow empty `sort` arrays
(#156769)\n\n## Summary\r\n\r\nThis PR removes the `minSize` restriction
added in #154016 from the\r\nsaved search schema `sort` property, which
was causing AWS integrations\r\nto
fail.\r\n\r\nBefore:\r\n\r\n![broken](https://user-images.githubusercontent.com/25592674/236355150-112e103b-00ef-4f0d-baa5-35de6b944152.gif)\r\n\r\nAfter:\r\n\r\n![working](https://user-images.githubusercontent.com/25592674/236355167-1185279b-84ef-4570-8762-90944c839c4d.gif)\r\n\r\nFixes
#156724.\r\n\r\n### Checklist\r\n\r\n- [ ] ~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-
[
]\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- [ ] ~Any UI
touched in this PR is usable by keyboard only (learn more\r\nabout
[keyboard\r\naccessibility](https://webaim.org/techniques/keyboard/))~\r\n-
[ ] ~Any UI touched in this PR does not create any new axe
failures\r\n(run axe in
browser:\r\n[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),\r\n[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~\r\n-
[ ] ~If a plugin configuration key changed, check if it needs to
be\r\nallowlisted in the cloud and added to the
[docker\r\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~\r\n-
[ ] ~This renders correctly on smaller devices using a
responsive\r\nlayout. (You can test this [in
your\r\nbrowser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~\r\n-
[ ] ~This was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)~\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)","sha":"2f53207727d321363a1664e2a952301fd5b20f7e"}}]}]
BACKPORT-->

Co-authored-by: Davis McPhee <[email protected]>
  • Loading branch information
kibanamachine and davismcphee authored May 5, 2023
1 parent e76daa4 commit ef2f448
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/saved_search/server/saved_objects/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export function getSavedSearchObjectType(
columns: schema.arrayOf(schema.string(), { defaultValue: [] }),
sort: schema.oneOf(
[
schema.arrayOf(schema.arrayOf(schema.string(), { minSize: 2, maxSize: 2 })),
schema.arrayOf(schema.string(), { minSize: 2, maxSize: 2 }),
schema.arrayOf(schema.arrayOf(schema.string(), { maxSize: 2 })),
schema.arrayOf(schema.string(), { maxSize: 2 }),
],
{ defaultValue: [] }
),
Expand Down

0 comments on commit ef2f448

Please sign in to comment.