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

Expose savedObject import / export utility methods #58882

Merged

Conversation

pgayvallet
Copy link
Contributor

Summary

Fix #58854

  • add a getImportExportObjectLimit method to SO setup api
  • publicly expose getSortedObjectsForExport, importSavedObjects and resolveImportErrors from src/core/server
  • improve documentation on these methods associated types

Checklist

Delete any items that are not applicable to this PR.

@pgayvallet pgayvallet added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Feb 28, 2020
@pgayvallet pgayvallet requested a review from a team as a code owner February 28, 2020 15:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet pgayvallet requested a review from legrego February 28, 2020 15:34
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together so quickly! The changes LGTM from a Spaces perspective - this looks like it'll suit my needs perfectly.

supportedTypes: string[];
/** if specified, will import in given namespace */
Copy link
Contributor

Choose a reason for hiding this comment

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

in the default otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if unspecified, it will import as a non-namespaced object. updated comment.

overwrite: boolean;
/** client to use to perform the import operation */
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: {@link SavedObjectsClientContract | saved objects client }?

@@ -229,6 +229,9 @@ export {
SavedObjectsType,
SavedObjectMigrationMap,
SavedObjectMigrationFn,
getSortedObjectsForExport,
Copy link
Contributor

Choose a reason for hiding this comment

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

optional:
getSortedObjectsForExport doesn't return saved objects, but a stream of them.
importSavedObjects doesn't accept saved objects, but a stream of them.
what if we reflect this fact in the naming?
exportToStream/importFromStream for example

Copy link
Contributor

@rudolf rudolf left a comment

Choose a reason for hiding this comment

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

I agree with @restrry's feedback, but don't have anything more to add.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@pgayvallet pgayvallet merged commit 7130a04 into elastic:master Mar 4, 2020
pgayvallet added a commit to pgayvallet/kibana that referenced this pull request Mar 4, 2020
* add getImportExportObjectLimit to so setup

* expose static method for so import / export

* improve functions naming

* fix mocked reference
pgayvallet added a commit that referenced this pull request Mar 4, 2020
* add getImportExportObjectLimit to so setup

* expose static method for so import / export

* improve functions naming

* fix mocked reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Platform] Add import/export API to core SO service
6 participants