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

[Lens][Visualize][Embeddable] Optimize Lens embeddables on error #144015

Merged
merged 6 commits into from
Nov 18, 2022

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Oct 26, 2022

Summary

Fixes #143552

In this PR there are some embeddable rendering optimizations for the error case.
Lens handles error states internally without passing to default EmbeddablePanel flows - this has been made explicit in the Lens Embeddable component. The embeddable was triggering multiple time the render method in both successful and failure case: while the expression component renderer had some debouncing/memoize optimization to reduce the effective rerenders, the error route had none leading to a total of 3 rerenderings (loading + some changes detected).

In this PR I've managed to reduce the rerenders to 2 (loading + final state) with some gatekeeping on the internal state reporting.
As for the data-rendering-complete the logic has changed to set it to true also in Error state, but I would collect some feedback from @elastic/kibana-app-services on this side to better understand the impact. Before this change the data-error attribute could be checked to detect the final state of the panel, but that introduces some problems for Lens panels for the error reporting, hence the need to have the complete flag changed.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dej611 dej611 added Team:Visualizations Visualization editors, elastic-charts and infrastructure Team:AppServicesSv release_note:skip Skip the PR/issue when compiling release notes Feature:Lens labels Oct 26, 2022
@dej611 dej611 requested a review from alexwizp October 26, 2022 10:54
@dej611 dej611 marked this pull request as ready for review October 27, 2022 10:05
@dej611 dej611 requested review from a team as code owners October 27, 2022 10:05
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@@ -61,7 +63,7 @@ export class RenderCompleteDispatcher {
public dispatchError() {
if (!this.el) return;
this.count++;
this.el.setAttribute('data-render-complete', 'false');
this.el.setAttribute('data-render-complete', 'true');
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

@vadimkibana for followup work, we could accept an optional Error parameter, and use it to update the contents of a data-render-error attribute with a message. WDYT?

searchSessionId,
}: VisualizationErrorProps) {
// use a combination of sessionid + error messages to decide whether to trigger a rerender
const rerenderKey = `${searchSessionId || ''}-${errors
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure that I fully understand why we need in include searchSessionId into key. The session id is the same for all panels inside e.g. dashboard.

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we exclude searchSessionId from the key, and do:

if (rerenderKey && keyRef.current !== rerenderKey) {
  keyRef.current = rerenderKey;
  onExpressionError();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using the searchSessionId as part of the key will give the user the ability to try again to load the panel by clicking the Refresh button. Otherwise the panel state will be not be updated.

.join('-')}`;

const keyRef = useRef(rerenderKey);
// Skip error logging when no search session id is passed
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this comment is relevant.

// Skip error logging when no search session id is passed

Copy link
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

Added some questions but all works fine. Thank you

@drewdaemon
Copy link
Contributor

@dej611 I just wanted to make sure you're aware of #143367 which changes the way the Lens embeddable reports errors.

@dej611
Copy link
Contributor Author

dej611 commented Nov 2, 2022

@dej611 I just wanted to make sure you're aware of #143367 which changes the way the Lens embeddable reports errors.

Good spot. There are definitely some overlaps between the two, which needs to be coordinated. Will check that PR and see whether it makes sense to wait for it, in case the new error rendering approach solves part of the issue here.

@flash1293
Copy link
Contributor

Is it expected that data-loading is still set to true? Not sure whether it makes any difference:
Screenshot 2022-11-03 at 14 51 44

@VladLasitsa
Copy link
Contributor

@elastic/kibana-visualizations , @elastic/kibana-app-services, could you please review?

@VladLasitsa
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
lens 1.3MB 1.3MB -6.0B

Page load bundle

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

id before after diff
kibanaUtils 68.8KB 68.9KB +59.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 108 113 +5
securitySolution 441 447 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 67 73 +6
osquery 109 115 +6
securitySolution 518 524 +6
total +20

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

LGTM 🆗

@stratoula stratoula added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.6.0 v8.7.0 labels Nov 17, 2022
@tsullivan
Copy link
Member

tsullivan commented Nov 17, 2022

As for the data-rendering-complete the logic has changed to set it to true also in Error state, but I would collect some feedback from @elastic/kibana-app-services on this side to better understand the impact. Before this change the data-error attribute could be checked to detect the final state of the panel, but that introduces some problems for Lens panels for the error reporting, hence the need to have the complete flag changed.

I am ++ to setting the "render complete" attribute value to true in the error case. This will help it not block Reporting. I wonder if there could be an unwanted impact to performance monitoring. cc @lizozom

Also, as I was reviewing this, I noticed that the Render Complete Dispatcher doesn't handle the placement of a data-render-error attribute in the error case, which is expected by Reporting. I'm filing a separate issue for that: the render complete dispatcher should automatically handle things that favor Reporting and performance monitoring. cc @vadimkibana

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

@VladLasitsa VladLasitsa merged commit 87c7b39 into elastic:main Nov 18, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 18, 2022
…stic#144015)

## Summary

Fixes elastic#143552

In this PR there are some embeddable rendering optimizations for the
error case.
Lens handles error states internally without passing to default
`EmbeddablePanel` flows - this has been made explicit in the Lens
`Embeddable` component. The embeddable was triggering multiple time the
`render` method in both successful and failure case: while the
expression component renderer had some debouncing/memoize optimization
to reduce the effective rerenders, the error route had none leading to a
total of 3 rerenderings (loading + some changes detected).

In this PR I've managed to reduce the rerenders to 2 (loading + final
state) with some gatekeeping on the internal state reporting.
As for the `data-rendering-complete` the logic has changed to set it to
`true` also in Error state, but I would collect some feedback from
@elastic/kibana-app-services on this side to better understand the
impact. Before this change the `data-error` attribute could be checked
to detect the final state of the panel, but that introduces some
problems for Lens panels for the error reporting, hence the need to have
the `complete` flag changed.

### 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—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: Uladzislau Lasitsa <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 87c7b39)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

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 18, 2022
#144015) (#145695)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Lens][Visualize][Embeddable] Optimize Lens embeddables on error
(#144015)](#144015)

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

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

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-11-18T08:55:45Z","message":"[Lens][Visualize][Embeddable]
Optimize Lens embeddables on error (#144015)\n\n## Summary\r\n\r\nFixes
#143552\r\n\r\nIn this PR there are some embeddable rendering
optimizations for the\r\nerror case.\r\nLens handles error states
internally without passing to default\r\n`EmbeddablePanel` flows - this
has been made explicit in the Lens\r\n`Embeddable` component. The
embeddable was triggering multiple time the\r\n`render` method in both
successful and failure case: while the\r\nexpression component renderer
had some debouncing/memoize optimization\r\nto reduce the effective
rerenders, the error route had none leading to a\r\ntotal of 3
rerenderings (loading + some changes detected).\r\n\r\nIn this PR I've
managed to reduce the rerenders to 2 (loading + final\r\nstate) with
some gatekeeping on the internal state reporting.\r\nAs for the
`data-rendering-complete` the logic has changed to set it to\r\n`true`
also in Error state, but I would collect some feedback
from\r\n@elastic/kibana-app-services on this side to better understand
the\r\nimpact. Before this change the `data-error` attribute could be
checked\r\nto detect the final state of the panel, but that introduces
some\r\nproblems for Lens panels for the error reporting, hence the need
to have\r\nthe `complete` flag changed.\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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- [ ] [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 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\r\n###
Risk Matrix\r\n\r\nDelete this section if it is not applicable to this
PR.\r\n\r\nBefore closing this PR, invite QA, stakeholders, and other
developers to\r\nidentify risks that should be tested prior to the
change/feature\r\nrelease.\r\n\r\nWhen forming the risk matrix, consider
some of the following examples\r\nand how they may potentially impact
the change:\r\n\r\n| Risk | Probability | Severity | Mitigation/Notes
|\r\n\r\n|---------------------------|-------------|----------|-------------------------|\r\n|
Multiple Spaces&mdash;unexpected behavior in non-default Kibana
Space.\r\n| Low | High | Integration tests will verify that all features
are still\r\nsupported in non-default Kibana Space and when user
switches between\r\nspaces. |\r\n| Multiple nodes&mdash;Elasticsearch
polling might have race conditions\r\nwhen multiple Kibana nodes are
polling for the same tasks. | High | Low\r\n| Tasks are idempotent, so
executing them multiple times will not result\r\nin logical error, but
will degrade performance. To test for this case we\r\nadd plenty of unit
tests around this logic and document manual testing\r\nprocedure. |\r\n|
Code should gracefully handle cases when feature X or plugin Y
are\r\ndisabled. | Medium | High | Unit tests will verify that any
feature flag\r\nor plugin combination still results in our service
operational. |\r\n| [See more potential
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
|\r\n\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\nCo-authored-by:
Uladzislau Lasitsa <[email protected]>\r\nCo-authored-by: Kibana
Machine
<[email protected]>","sha":"87c7b3940b2774c36b94243e325a8f49a2094329","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","Team:AppServicesSv","release_note:skip","Feature:Lens","backport:prev-minor","v8.6.0","v8.7.0"],"number":144015,"url":"https://github.com/elastic/kibana/pull/144015","mergeCommit":{"message":"[Lens][Visualize][Embeddable]
Optimize Lens embeddables on error (#144015)\n\n## Summary\r\n\r\nFixes
#143552\r\n\r\nIn this PR there are some embeddable rendering
optimizations for the\r\nerror case.\r\nLens handles error states
internally without passing to default\r\n`EmbeddablePanel` flows - this
has been made explicit in the Lens\r\n`Embeddable` component. The
embeddable was triggering multiple time the\r\n`render` method in both
successful and failure case: while the\r\nexpression component renderer
had some debouncing/memoize optimization\r\nto reduce the effective
rerenders, the error route had none leading to a\r\ntotal of 3
rerenderings (loading + some changes detected).\r\n\r\nIn this PR I've
managed to reduce the rerenders to 2 (loading + final\r\nstate) with
some gatekeeping on the internal state reporting.\r\nAs for the
`data-rendering-complete` the logic has changed to set it to\r\n`true`
also in Error state, but I would collect some feedback
from\r\n@elastic/kibana-app-services on this side to better understand
the\r\nimpact. Before this change the `data-error` attribute could be
checked\r\nto detect the final state of the panel, but that introduces
some\r\nproblems for Lens panels for the error reporting, hence the need
to have\r\nthe `complete` flag changed.\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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- [ ] [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 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\r\n###
Risk Matrix\r\n\r\nDelete this section if it is not applicable to this
PR.\r\n\r\nBefore closing this PR, invite QA, stakeholders, and other
developers to\r\nidentify risks that should be tested prior to the
change/feature\r\nrelease.\r\n\r\nWhen forming the risk matrix, consider
some of the following examples\r\nand how they may potentially impact
the change:\r\n\r\n| Risk | Probability | Severity | Mitigation/Notes
|\r\n\r\n|---------------------------|-------------|----------|-------------------------|\r\n|
Multiple Spaces&mdash;unexpected behavior in non-default Kibana
Space.\r\n| Low | High | Integration tests will verify that all features
are still\r\nsupported in non-default Kibana Space and when user
switches between\r\nspaces. |\r\n| Multiple nodes&mdash;Elasticsearch
polling might have race conditions\r\nwhen multiple Kibana nodes are
polling for the same tasks. | High | Low\r\n| Tasks are idempotent, so
executing them multiple times will not result\r\nin logical error, but
will degrade performance. To test for this case we\r\nadd plenty of unit
tests around this logic and document manual testing\r\nprocedure. |\r\n|
Code should gracefully handle cases when feature X or plugin Y
are\r\ndisabled. | Medium | High | Unit tests will verify that any
feature flag\r\nor plugin combination still results in our service
operational. |\r\n| [See more potential
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
|\r\n\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\nCo-authored-by:
Uladzislau Lasitsa <[email protected]>\r\nCo-authored-by: Kibana
Machine
<[email protected]>","sha":"87c7b3940b2774c36b94243e325a8f49a2094329"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/144015","number":144015,"mergeCommit":{"message":"[Lens][Visualize][Embeddable]
Optimize Lens embeddables on error (#144015)\n\n## Summary\r\n\r\nFixes
#143552\r\n\r\nIn this PR there are some embeddable rendering
optimizations for the\r\nerror case.\r\nLens handles error states
internally without passing to default\r\n`EmbeddablePanel` flows - this
has been made explicit in the Lens\r\n`Embeddable` component. The
embeddable was triggering multiple time the\r\n`render` method in both
successful and failure case: while the\r\nexpression component renderer
had some debouncing/memoize optimization\r\nto reduce the effective
rerenders, the error route had none leading to a\r\ntotal of 3
rerenderings (loading + some changes detected).\r\n\r\nIn this PR I've
managed to reduce the rerenders to 2 (loading + final\r\nstate) with
some gatekeeping on the internal state reporting.\r\nAs for the
`data-rendering-complete` the logic has changed to set it to\r\n`true`
also in Error state, but I would collect some feedback
from\r\n@elastic/kibana-app-services on this side to better understand
the\r\nimpact. Before this change the `data-error` attribute could be
checked\r\nto detect the final state of the panel, but that introduces
some\r\nproblems for Lens panels for the error reporting, hence the need
to have\r\nthe `complete` flag changed.\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\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- [ ] [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 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\r\n###
Risk Matrix\r\n\r\nDelete this section if it is not applicable to this
PR.\r\n\r\nBefore closing this PR, invite QA, stakeholders, and other
developers to\r\nidentify risks that should be tested prior to the
change/feature\r\nrelease.\r\n\r\nWhen forming the risk matrix, consider
some of the following examples\r\nand how they may potentially impact
the change:\r\n\r\n| Risk | Probability | Severity | Mitigation/Notes
|\r\n\r\n|---------------------------|-------------|----------|-------------------------|\r\n|
Multiple Spaces&mdash;unexpected behavior in non-default Kibana
Space.\r\n| Low | High | Integration tests will verify that all features
are still\r\nsupported in non-default Kibana Space and when user
switches between\r\nspaces. |\r\n| Multiple nodes&mdash;Elasticsearch
polling might have race conditions\r\nwhen multiple Kibana nodes are
polling for the same tasks. | High | Low\r\n| Tasks are idempotent, so
executing them multiple times will not result\r\nin logical error, but
will degrade performance. To test for this case we\r\nadd plenty of unit
tests around this logic and document manual testing\r\nprocedure. |\r\n|
Code should gracefully handle cases when feature X or plugin Y
are\r\ndisabled. | Medium | High | Unit tests will verify that any
feature flag\r\nor plugin combination still results in our service
operational. |\r\n| [See more potential
risk\r\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
|\r\n\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\nCo-authored-by:
Uladzislau Lasitsa <[email protected]>\r\nCo-authored-by: Kibana
Machine
<[email protected]>","sha":"87c7b3940b2774c36b94243e325a8f49a2094329"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <[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:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] [renderComplete] should be triggered for error state