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

[Canvas] Migrate by value embeddables #123515

Merged
merged 7 commits into from
Feb 9, 2022

Conversation

cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented Jan 20, 2022

Summary

Closes #101639.

This runs all of the by-value embeddables on a Canvas workpad through the embeddable migrations.

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

@cqliu1 cqliu1 requested a review from a team as a code owner January 20, 2022 22:18
@cqliu1 cqliu1 force-pushed the canvas/embeddable-migration branch from 3138b60 to eac4c36 Compare January 24, 2022 21:44
@cqliu1 cqliu1 added chore Feature:Canvas release_note:skip Skip the PR/issue when compiling release notes v8.1.0 labels Jan 27, 2022
@kibanamachine kibanamachine added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Jan 27, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@cqliu1 cqliu1 added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort labels Jan 27, 2022
@cqliu1 cqliu1 force-pushed the canvas/embeddable-migration branch 2 times, most recently from ff23ebd to 1c822a6 Compare January 31, 2022 19:29
@cqliu1 cqliu1 force-pushed the canvas/embeddable-migration branch 2 times, most recently from 1951328 to 8cde82f Compare February 4, 2022 21:43
@cqliu1
Copy link
Contributor Author

cqliu1 commented Feb 6, 2022

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

expected head sha didn’t match current head ref.

Check for id in embeddable input

Removed unused import

Fixed tests

Fix variable name

Move migration into embeddable function definition

Remove unused code
@cqliu1 cqliu1 force-pushed the canvas/embeddable-migration branch from 6cd9e27 to 7468446 Compare February 7, 2022 16:18
Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

One little question but other than that looks and works good for me 👍

(state: ExpressionAstFunction): ExpressionAstFunction => {
const embeddableInput = decode(state.arguments.config[0] as string);

if (embeddableInput.attributes || embeddableInput.savedVis) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the need for this check? Is there a reason we wouldn't want to always run the input through the migration function?

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 think we only need to handle by-value embeddable on our end since migration for the saved objects that back the by-reference embeddables is handled elsewhere, so it might be duplicating work. But I can remove the check. It's possible that the embeddable input stored in the expression for by-reference embeddables could have attributes that need to be migrated, so it probably doesn't hurt to run all of them through the embedddable migrations.

@cqliu1
Copy link
Contributor Author

cqliu1 commented Feb 8, 2022

@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
canvas 1.0MB 1.0MB +267.0B

History

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

@cqliu1 cqliu1 merged commit 8e8c4b8 into elastic:main Feb 9, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 9, 2022
@cqliu1 cqliu1 deleted the canvas/embeddable-migration branch February 9, 2022 17:11
@cqliu1 cqliu1 added the v8.2.0 label Feb 9, 2022
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Feb 9, 2022
* Add migrations for by value embeddables

Check for id in embeddable input

Removed unused import

Fixed tests

Fix variable name

Move migration into embeddable function definition

Remove unused code

* Cleanup

* Fix embeddable test

* Remove check for by-value embeddables in embeddable function migration

* Removed unused import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8e8c4b8)
cqliu1 added a commit that referenced this pull request Feb 9, 2022
* Add migrations for by value embeddables

Check for id in embeddable input

Removed unused import

Fixed tests

Fix variable name

Move migration into embeddable function definition

Remove unused code

* Cleanup

* Fix embeddable test

* Remove check for by-value embeddables in embeddable function migration

* Removed unused import

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 8e8c4b8)
@cqliu1 cqliu1 restored the canvas/embeddable-migration branch June 8, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting chore Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.1.0 v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Canvas] Embeddable References, Migrations, and Telemetry
5 participants