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

Migrate saved object service #33587

Closed
13 of 20 tasks
epixa opened this issue Mar 20, 2019 · 9 comments
Closed
13 of 20 tasks

Migrate saved object service #33587

epixa opened this issue Mar 20, 2019 · 9 comments
Assignees
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana Feature:New Platform Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@epixa
Copy link
Contributor

epixa commented Mar 20, 2019

The saved object service should be migrated to the new platform core and injected into the legacy world. New Core API's are denoted with ⭐️

7.3

7.4

7.5

7.x

  • ️⭐️SavedObject Management [Platform] SavedObject Management #50308. Allow plugins to configure the values in
    SavedObjectsManagementTypeDefinition for each of their Saved Object types.
    interface SavedObjectsManagementTypeDefinition {
      isImportableAndExportable?: boolean;
      defaultSearchField?: string;
      icon?: string;
      getTitle?: (savedObject: SavedObject) => string;
      getEditUrl?: (savedObject: SavedObject) => string;
      getInAppUrl?: (savedObject: SavedObject) => { path: string; uiCapabilitiesPath: string };
    }
  • ⭐️SavedObject Mappings [Platform] SavedObject Mappings #50309. Allow plugins to register a Saved Object type with the associated Elasticsearch mappings.
  • ⭐️SavedObject Migrations [Platform] SavedObject Migrations #50311. Allow plugins to register SavedObject document
    migrations.
    • Remove SavedObjectsMigrationLogger and replace all log.warning() -> log.warn() inside existing migrations.
  • ️⭐️SavedObject Schemas [Platform] SavedObject Schemas #50313. Allow plugins to configure the values in the
    SavedObjectsSchemaTypeDefinition for each of their Saved Object types.
    interface SavedObjectsSchemaTypeDefinition {
      isNamespaceAgnostic: boolean;
      hidden?: boolean;
      indexPattern?: ((config: Config) => string) | string;
      convertToAliasScript?: string; // rename to reindexScript?
    }
  • Move server-side SavedObjects routes to core [Platform] Move SavedObject routes to Core #50321
  • Create stronger type safety with discriminated union and type guards for methods like bulkGet which return results and errors in a single array.
  • Public SavedObjectsClient: Introduce error helper functions and deprecate accessing err.res.status.
  • Move showAutoCreateIndexErrorPage ui/public/error_auto_create_index/error_auto_create_index to NP
  • Migrate auto create index error to an error modal powered by the NP? (check with Dave Snider)
  • Implement sortOrder in the HTTP API and public SavedObjectsClient
  • Deprecate Dashboard Import API Remove Dashboard Import/Export API #41439

8.x

  • ️⭐️ SavedObject Validations. Allow plugins to validate documents before
    being saved. No legacy plugins are using this functionality, which means we
    have an opportunity to rethink this before moving to Core.
  • Attempt to cleanup when kibana is stopped before migrations have completed by pointing the .kibana index to the last known good .kibana_n index and renaming the half-migrated .kibana_n+1 index to indicate failure (needs investigation).
@epixa epixa added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform Feature:Saved Objects labels Mar 20, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@epixa
Copy link
Contributor Author

epixa commented Mar 20, 2019

cc @mikecote

@joshdover
Copy link
Contributor

@skaapgif I confirmed with the Security team that we're going to be blocked on migrating the backend by the security migration. Is there other work that makes sense to do on this before that is done, or do you think we should put this on hold after #36829 is merged?

@rudolf
Copy link
Contributor

rudolf commented Jun 3, 2019

I've re-arranged the order of the tasks. We should be able to complete client-side SavedObjects/SimpleSavedObject which could help unblock some client-side plugins.

@epixa
Copy link
Contributor Author

epixa commented Jun 3, 2019

I confirmed with the Security team that we're going to be blocked on migrating the backend by the security migration

Can you clarify why? I would expect the HTTP endpoints to be blocked, but I'm not sure why the saved object service itself would be blocked.

@joshdover
Copy link
Contributor

joshdover commented Jun 4, 2019

Right, we can refactor the endpoints into the new shape required by the new platform, but we cannot move the endpoint registration to the new platform's HttpService yet because those endpoints need authorization.

@joshdover
Copy link
Contributor

Handling legacy SavedObjects/migrations

What about a 3rd option where we add migration support to NP plugins and copy all the existing migrations over? This would be a breaking change for whichever version that is released in, but it seems like it would eliminate some work that would just be thrown away later anyways.

@joshdover
Copy link
Contributor

Some more legacy saved objects code came up today and I don't see it captured in the plan above so I wanted to flag it.

In the kibana plugin we have two pieces that need to be migrated to the New Platform:

  • src/legacy/core_plugins/kibana/public/management/sections/objects
    • Management UI for saved objects, exports, imports
  • src/legacy/core_plugins/kibana/server/routes/api/management/saved_objects
    • API routes to support the UI above

It seems to me that this code should be moved into a separate NP plugin (saved_objects_ui?), though until the new Management plugin is created, this may or may not be practical.

We may also want to consider moving parts of the API into the first-class Core SavedObjects API & Client if we think it may be useful. Specifically, I think the relationships endpoint and the scrolling / export endpoints may be useful to developers.

In terms of just getting this code migrated to the New Platform, we still need to decide who will get this code to be NP-ready. The App team is working on shimming the frontend of the kibana plugin, and this will need to be done for this UI as well. The root of this UI is still heavily in Angular, however much of the newer development is in React.

@rudolf
Copy link
Contributor

rudolf commented Oct 29, 2020

Closing as we've moved all of Saved Objects to core. There are some enhancement tasks left in the issue description, but these will be separately prioritized.

@rudolf rudolf closed this as completed Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana Feature:New Platform Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

5 participants