Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Add getRenderAppWrapper extension #197556

Merged

Conversation

davismcphee
Copy link
Contributor

@davismcphee davismcphee commented Oct 24, 2024

Summary

This PR adds a getRenderAppWrapper extension to Discover to support advanced state management use cases. It also includes new documentation for the extension point, and overriding default profile implementations:

wrapper_2.mp4

To test, add the following config to kibana.dev.yml:

discover.experimental.enabledProfiles:
  [
    'example-root-profile',
    'example-solution-view-root-profile',
    'example-data-source-profile',
    'example-document-profile',
  ]

Then ingest demo logs and run this in dev tools:

POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "kibana_sample_data_logs",
        "alias": "my-example-logs"
      }
    }
  ]
}

Flaky test runs:

Checklist

For maintainers

@davismcphee davismcphee added Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Project:OneDiscover Enrich Discover with contextual awareness labels Oct 24, 2024
@davismcphee davismcphee self-assigned this Oct 24, 2024
@davismcphee
Copy link
Contributor Author

/ci

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7238

[❌] test/functional/apps/discover/context_awareness/config.ts: 0/25 tests passed.

see run history

Copy link
Contributor

@logeekal logeekal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a whirl and I have 2 comments to make.

  1. In your previous PR, you had made RootProfileProvider a generic which helped consumers to shape the context returned by resolve method as seen here : https://github.com/elastic/kibana/pull/192934/files#diff-d3059d042d4db0625d2c4d959d7177df794b00c0c7d8ba4f61b47c12e50c92ceR48
  2. Additionaly, in your previous PR, you had context genrated from resolve available in the extension point which is not available as of now. Do you think that can be added back?

Thanks.

@davismcphee
Copy link
Contributor Author

@logeekal I still intend to add support for consumers to extend the returned context, but I'm going to do it as a separate PR. I'd like to keep the changes for the provider work isolated, and I was having trouble identifying the source of test failures in the original PR so I split this work out.

But since you raised it and to better understand your use case, I'm curious how you were planning to use the extended context anyway?

@logeekal
Copy link
Contributor

logeekal commented Oct 28, 2024

But since you raised it and to better understand your use case, I'm curious how you were planning to use the extended context anyway?

Here is the usage based off of your preview PR: https://github.com/elastic/kibana/pull/197042/files#diff-a0633bbd549f96a17a31909f6f6d2d67a25fd9b65d9a753077a0ebaa373037b9R74

Also, since the process of getting the app context is async and currently I cannot do that in resolve method, I think other methods will be somewhat hacky. I will look into it and let you know.

@davismcphee davismcphee force-pushed the discover-get-app-wrapper-extension branch from aa6217e to 16c33cd Compare October 28, 2024 15:29
@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#7289

[❌] test/functional/apps/discover/context_awareness/config.ts: 24/25 tests passed.

see run history

@davismcphee
Copy link
Contributor Author

@logeekal Thanks for the link, this is along the lines of what I was thinking. It's good to see an example of how a consumer would actually use it. I do intend to add the custom context support as a followup though, so you'll be able to do this.

Also, since the process of getting the app context is async and currently I cannot do that in resolve method, I think other methods will be somewhat hacky. I will look into it and let you know.

The resolve method is async so you should be able to initialize things in it, but maybe I'm just misunderstanding what you mean here.

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7291

[✅] test/functional/apps/discover/context_awareness/config.ts: 25/25 tests passed.

see run history

Comment on lines +214 to +217
private getRootRenderAppWrapper() {
const rootProfile = this.rootProfileService.getProfile(this.rootContext$.getValue());
return rootProfile.getRenderAppWrapper;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getRenderAppWrapper extension works a bit differently than other extensions. It can only be used at the root profile level and can only be executed once on root profile resolution. This is because we cannot change the wrapping component at runtime (e.g. when data source profiles resolve) without remounting the entire Discover application (since React cannot reparent components), causing things like loss of local state and reloading of the Lens embeddable. I believe this is an acceptable restriction for this type of extension.

},
});

export const createExampleFallbackRootProfileProvider = (): RootProfileProvider => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I introduced a separate example-fallback-root-profile which activates when in Solution contexts, in order for us to support functional tests in serverless without breaking all of the existing tests. Open to suggestions if someone has a better alternative.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example-serverless-only-root-profile, example-solution-view-root-profile, or example-single-solution-root-profile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like example-solution-view-root-profile 👍 Updated here: 2eede18.

@davismcphee davismcphee marked this pull request as ready for review October 29, 2024 03:55
@davismcphee davismcphee requested review from a team as code owners October 29, 2024 03:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

tap(() => setRootProfileState({ rootProfileLoading: true })),
switchMap((id) => profilesManager.resolveRootProfile({ solutionNavId: id })),
tap(({ getRenderAppWrapper }) => {
const BaseAppWrapper: Profile['getRenderAppWrapper'] = ({ children }) => <>{children}</>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the definition of this component out of the hook logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can, updated here: 21ae097.

@jughosta
Copy link
Contributor

Sorry, there are conflicts with main now.

@davismcphee
Copy link
Contributor Author

Sorry, there are conflicts with main now.

Fixed now 👍

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good to me and it works great on Discover and on Surrounding Documents page. But something is missing in the embeddable implementation as it does not open the example flyout after pressing a link.

@davismcphee
Copy link
Contributor Author

But something is missing in the embeddable implementation as it does not open the example flyout after pressing a link.

🤦 you're completely right... I even had a note written down to add this and completely overlooked it. I'll update the PR today with embeddable support.

@davismcphee
Copy link
Contributor Author

@jughosta Updated to support the saved search embeddable, and added tests for it: 52aa645.

Also just a note for future reference: I originally tried to migrate to useRootProfile directly in the embeddable, but ran into an issue since data fetching (and therefore data source profile resolution) lives outside React for the embeddable, and root profile resolution must happen first to ensure the rootContext passed to the data source provider's resolve method is accurate. In the future we may want to consider refactoring embeddable fetching to make this easier to manage.

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@davismcphee
Copy link
Contributor Author

/ci

@davismcphee davismcphee added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:skip Skip the PR/issue when compiling release notes labels Nov 5, 2024
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
discover 969 970 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 807.7KB 809.2KB +1.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
discover 50.5KB 50.7KB +195.0B

History

cc @davismcphee

@davismcphee davismcphee merged commit 4a95eec into elastic:main Nov 6, 2024
23 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11695091320

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
## Summary

This PR adds a `getRenderAppWrapper` extension to Discover to support
advanced state management use cases. It also includes new documentation
for the extension point, and overriding default profile implementations:

https://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90

To test, add the following config to `kibana.dev.yml`:
```yml
discover.experimental.enabledProfiles:
  [
    'example-root-profile',
    'example-solution-view-root-profile',
    'example-data-source-profile',
    'example-document-profile',
  ]
```

Then ingest demo logs and run this in dev tools:
```
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "kibana_sample_data_logs",
        "alias": "my-example-logs"
      }
    }
  ]
}
```

Flaky test runs:
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289
- 🟢 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291
- x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303

### Checklist

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

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Julia Rechkunova <[email protected]>
(cherry picked from commit 4a95eec)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 6, 2024
…) (#199074)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] Add &#x60;getRenderAppWrapper&#x60; extension
(#197556)](#197556)

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

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

<!--BACKPORT [{"author":{"name":"Davis
McPhee","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T00:48:33Z","message":"[Discover]
Add `getRenderAppWrapper` extension (#197556)\n\n## Summary\r\n\r\nThis
PR adds a `getRenderAppWrapper` extension to Discover to
support\r\nadvanced state management use cases. It also includes new
documentation\r\nfor the extension point, and overriding default profile
implementations:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90\r\n\r\nTo
test, add the following config to
`kibana.dev.yml`:\r\n```yml\r\ndiscover.experimental.enabledProfiles:\r\n
[\r\n 'example-root-profile',\r\n
'example-solution-view-root-profile',\r\n
'example-data-source-profile',\r\n 'example-document-profile',\r\n
]\r\n```\r\n\r\nThen ingest demo logs and run this in dev
tools:\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\": [\r\n {\r\n
\"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n \"alias\":
\"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n\r\nFlaky test
runs:\r\n- 🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238\r\n-
🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289\r\n-
🟢
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291\r\n-
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303\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-
[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- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](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#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"4a95eec82f0a3072ae3f9787942b77ca48f70cbf","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","Project:OneDiscover"],"title":"[Discover]
Add `getRenderAppWrapper`
extension","number":197556,"url":"https://github.com/elastic/kibana/pull/197556","mergeCommit":{"message":"[Discover]
Add `getRenderAppWrapper` extension (#197556)\n\n## Summary\r\n\r\nThis
PR adds a `getRenderAppWrapper` extension to Discover to
support\r\nadvanced state management use cases. It also includes new
documentation\r\nfor the extension point, and overriding default profile
implementations:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90\r\n\r\nTo
test, add the following config to
`kibana.dev.yml`:\r\n```yml\r\ndiscover.experimental.enabledProfiles:\r\n
[\r\n 'example-root-profile',\r\n
'example-solution-view-root-profile',\r\n
'example-data-source-profile',\r\n 'example-document-profile',\r\n
]\r\n```\r\n\r\nThen ingest demo logs and run this in dev
tools:\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\": [\r\n {\r\n
\"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n \"alias\":
\"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n\r\nFlaky test
runs:\r\n- 🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238\r\n-
🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289\r\n-
🟢
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291\r\n-
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303\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-
[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- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](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#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"4a95eec82f0a3072ae3f9787942b77ca48f70cbf"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197556","number":197556,"mergeCommit":{"message":"[Discover]
Add `getRenderAppWrapper` extension (#197556)\n\n## Summary\r\n\r\nThis
PR adds a `getRenderAppWrapper` extension to Discover to
support\r\nadvanced state management use cases. It also includes new
documentation\r\nfor the extension point, and overriding default profile
implementations:\r\n\r\n\r\nhttps://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90\r\n\r\nTo
test, add the following config to
`kibana.dev.yml`:\r\n```yml\r\ndiscover.experimental.enabledProfiles:\r\n
[\r\n 'example-root-profile',\r\n
'example-solution-view-root-profile',\r\n
'example-data-source-profile',\r\n 'example-document-profile',\r\n
]\r\n```\r\n\r\nThen ingest demo logs and run this in dev
tools:\r\n```\r\nPOST _aliases\r\n{\r\n \"actions\": [\r\n {\r\n
\"add\": {\r\n \"index\": \"kibana_sample_data_logs\",\r\n \"alias\":
\"my-example-logs\"\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n\r\nFlaky test
runs:\r\n- 🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238\r\n-
🔴
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289\r\n-
🟢
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291\r\n-
x25:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303\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-
[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- [x] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](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#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Julia Rechkunova
<[email protected]>","sha":"4a95eec82f0a3072ae3f9787942b77ca48f70cbf"}}]}]
BACKPORT-->

Co-authored-by: Davis McPhee <[email protected]>
mgadewoll pushed a commit to mgadewoll/kibana that referenced this pull request Nov 7, 2024
## Summary

This PR adds a `getRenderAppWrapper` extension to Discover to support
advanced state management use cases. It also includes new documentation
for the extension point, and overriding default profile implementations:


https://github.com/user-attachments/assets/70633cbb-1cfe-47fe-984e-ba8afb18fc90

To test, add the following config to `kibana.dev.yml`:
```yml
discover.experimental.enabledProfiles:
  [
    'example-root-profile',
    'example-solution-view-root-profile',
    'example-data-source-profile',
    'example-document-profile',
  ]
```

Then ingest demo logs and run this in dev tools:
```
POST _aliases
{
  "actions": [
    {
      "add": {
        "index": "kibana_sample_data_logs",
        "alias": "my-example-logs"
      }
    }
  ]
}
```

Flaky test runs:
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7238
- 🔴 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7289
- 🟢 x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7291
- x25:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7303

### Checklist

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

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Julia Rechkunova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Discover Discover Application Project:OneDiscover Enrich Discover with contextual awareness release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants