Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) # Backport This will backport the following commits from `main` to `9.0`: - [Set from & to as optional args in @kbn/grouping (#213212)](#213212) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Alberto Blázquez","email":"albertoblaz@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-05T16:21:54Z","message":"Set from & to as optional args in @kbn/grouping (#213212)\n\n## Summary\n\nSet `from` and `to` as optional args in `getGroupingQuery`, a function\nexposed by `@kbn/grouping`.\n\nIt will unblock this PR:\n- https://github.com/elastic/kibana/pull/212955\n\n### Motivation \n\n`getGroupingQuery` returns an ES aggregation for grouping documents.\nThis function assumes data will be queried in a certain interval of\ntime. However, Asset Inventory needs to query data from the beginning of\ntime because the UI will not provide any time-range filter. So in order\nto reuse this logic, we need to set both args as optional.\n\nReason for wrapping both fields in an optional `timeRange` record is to\nhave either both present or both undefined, not only one of them\npresent.\n\n### Checklist\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [x] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Risks\n\nNo risk at all. It would be a breaking change otherwise, if we had to\nrequire args that were optional before.","sha":"af147b5cc6612bc9e5632c2004f868f8c2b2a7f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud Security","backport:prev-minor","v9.1.0"],"title":"Set from & to as optional args in @kbn/grouping","number":213212,"url":"https://github.com/elastic/kibana/pull/213212","mergeCommit":{"message":"Set from & to as optional args in @kbn/grouping (#213212)\n\n## Summary\n\nSet `from` and `to` as optional args in `getGroupingQuery`, a function\nexposed by `@kbn/grouping`.\n\nIt will unblock this PR:\n- https://github.com/elastic/kibana/pull/212955\n\n### Motivation \n\n`getGroupingQuery` returns an ES aggregation for grouping documents.\nThis function assumes data will be queried in a certain interval of\ntime. However, Asset Inventory needs to query data from the beginning of\ntime because the UI will not provide any time-range filter. So in order\nto reuse this logic, we need to set both args as optional.\n\nReason for wrapping both fields in an optional `timeRange` record is to\nhave either both present or both undefined, not only one of them\npresent.\n\n### Checklist\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [x] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Risks\n\nNo risk at all. It would be a breaking change otherwise, if we had to\nrequire args that were optional before.","sha":"af147b5cc6612bc9e5632c2004f868f8c2b2a7f9"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213212","number":213212,"mergeCommit":{"message":"Set from & to as optional args in @kbn/grouping (#213212)\n\n## Summary\n\nSet `from` and `to` as optional args in `getGroupingQuery`, a function\nexposed by `@kbn/grouping`.\n\nIt will unblock this PR:\n- https://github.com/elastic/kibana/pull/212955\n\n### Motivation \n\n`getGroupingQuery` returns an ES aggregation for grouping documents.\nThis function assumes data will be queried in a certain interval of\ntime. However, Asset Inventory needs to query data from the beginning of\ntime because the UI will not provide any time-range filter. So in order\nto reuse this logic, we need to set both args as optional.\n\nReason for wrapping both fields in an optional `timeRange` record is to\nhave either both present or both undefined, not only one of them\npresent.\n\n### Checklist\n\n- [ ] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [x] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n### Risks\n\nNo risk at all. It would be a breaking change otherwise, if we had to\nrequire args that were optional before.","sha":"af147b5cc6612bc9e5632c2004f868f8c2b2a7f9"}}]}] BACKPORT--> Co-authored-by: Alberto Blázquez <albertoblaz@users.noreply.github.com>
- Loading branch information