Skip to content

[Dashboards as Code] Provide embeddable service for migration#222059

Merged
nickpeihl merged 3 commits intoelastic:dashboardApi/embeddableIntegrationfrom
nickpeihl:emb-migration-logging
May 30, 2025
Merged

[Dashboards as Code] Provide embeddable service for migration#222059
nickpeihl merged 3 commits intoelastic:dashboardApi/embeddableIntegrationfrom
nickpeihl:emb-migration-logging

Conversation

@nickpeihl
Copy link
Contributor

@nickpeihl nickpeihl commented May 30, 2025

Provides a getter method on dashboard server to provide the EmbeddableStart service that can be used in the migration to correctly extract references.

This also logs a warning instead of throwing if the migration fails.

Here is an example dashboard saved object that triggers the migration on import.
7.8.0-dashboard.ndjson.zip

Also, logs a warning instead of throwing if migration fails.
@nickpeihl nickpeihl requested a review from a team as a code owner May 30, 2025 14:02
'7.3.0': flow(migrations730),
'7.9.3': flow(migrateMatchAllQuery),
'7.11.0': flow(createExtractPanelReferencesMigration(deps)),
'7.11.0': createExtractPanelReferencesMigration(),
Copy link
Contributor Author

@nickpeihl nickpeihl May 30, 2025

Choose a reason for hiding this comment

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

This needs to return an object instead of a function for the deferred migration.

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label May 30, 2025
Copy link
Contributor

@Zacqary Zacqary left a comment

Choose a reason for hiding this comment

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

Seems like a more robust solution, LGTM

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

The deferred flag is a nice clean solution! I know the core team isn't a big fan of stateful-static code, so I think it might not be great to introduce it on the serverside. Instead of kibana_server_services, could you put the embeddable start inside the dashboard server plugin class, and use a getter function in the migration?

* All other references like index-patterns are forwarded non touched
* @param deps
*
* This migration uses the deferred flag on {@link SavedObjectMigrationParams | SavedObjectMigrationParams} which means the
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this is a way cleaner solution.

@elasticmachine
Copy link
Contributor

elasticmachine commented May 30, 2025

💔 Build Failed

Failed CI Steps

History

@nickpeihl nickpeihl merged commit 5da8aa6 into elastic:dashboardApi/embeddableIntegration May 30, 2025
9 of 10 checks passed
nickpeihl added a commit to nickpeihl/kibana that referenced this pull request Jun 4, 2025
…c#222059)

Adds a `startServices` method for the dashboard server to provide the
embeddable service that can be used in the migration to correctly
extract references.

This also logs a warning instead of throwing if the migration fails.

Here is an example dashboard saved object that triggers the migration on
import.

[7.8.0-dashboard.ndjson.zip](https://github.com/user-attachments/files/20521831/7.8.0-dashboard.ndjson.zip)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nickpeihl added a commit to nickpeihl/kibana that referenced this pull request Jun 5, 2025
…c#222059)

Adds a `startServices` method for the dashboard server to provide the
embeddable service that can be used in the migration to correctly
extract references.

This also logs a warning instead of throwing if the migration fails.

Here is an example dashboard saved object that triggers the migration on
import.

[7.8.0-dashboard.ndjson.zip](https://github.com/user-attachments/files/20521831/7.8.0-dashboard.ndjson.zip)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Embedding Embedding content via iFrame

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants