Open TinaHeiligers opened 4 months ago
Pinging @elastic/kibana-core (Team:Core)
Moving the public saved objects (import/export/resolve_import_error)
Just checking: my understanding of the proposal is that our desired state for/by 9.0 is:
Deprecate the folllowing:
public, deprecated: /api/saved_objects/_import
public, deprecated: /api/saved_objects/_export
public, deprecated: /api/saved_objects/_resolve_import_errors
Introduce the following:
public: /api/kibana/management/saved_objects/_import
public: /api/kibana/management/saved_objects/_export
@pgayvallet mentioned once we move these to SO Management plugin a path is available to get rid of _resolve_import_errors
entirely. Might be worth taking stock of any implications that might have for the new /api/kibana/management/saved_objects/_import
@jloleysens I was thinking more along the lines of introducing new SOM APIs for each of them:
Step 1:
public: /api/kibana/management/saved_objects/_import
public: /api/kibana/management/saved_objects/_export
public: /api/kibana/management/saved_objects/_resolve_import_errors
Step 2:
Validate we can remove _resolve_import_errors
and deprecate the API
Step 3: Wait until deprecation period is over
Step 4: Remove the api.
_resolve_import_errors
is public and we can't remove it without some sort of deprecation notice first.
I'm not saying we need to wait 18 months. We also don't need to wait long, only as long as it takes to make sure it's not consumed at all.
spin-off from https://github.com/elastic/dev/issues/2200 , cleaning up core
Not urgent since we're not removing the SO HTTP APIs in v9.
@TinaHeiligers, just to clarify. This issue is "just" about moving the HTTP API definitions to the SOM plugin. No need for additional optimizations, correct?
@afharo This issue is for moving the public export and import HTTP routes to SOM. Enhancements and optimizations aren't directly in scope.
Nice! Thanks! I'll add links to the relevant code then to make it more good first issue
:)
Moving the public saved objects (import/export/resolve_import_error) APIs from Core to the Saved Objects management plugin (SOM) could improve code organization and API management.
If the APIs allow us to leverage more platform features. E.g. we could use the file service to store the export, taskManager to schedule export as background tasks, and so on.
If we used the file service, we could remove the resolve_import_error API: this API exists only because we need to re-send the import file for error resolution. Storing the imported file would improve UX (especially for non-UI usage) because consumers only need to use import to resolve conflicts.
Rationale
Isolation of Concerns:
This ensures a clear separation of responsibilities and better modularity.
API Path Structure:
/api/saved_objects/
/api/kibana/management/saved_objects/
A dedicated path under the SOM plugin is more descriptive and aligns with the purpose of these APIs, making it easier for users and developers to discover and understand the APIs.Deprecation and Transition:
/api/saved_objects/
) as deprecated to provide a transition period for users and integrations to migrate to the new path./api/kibana/management/saved_objects/
) for all future development, ensuring a smooth transition.Implementation Steps
Move APIs to SO Management Plugin:
import
,export
, andresolve_import_error
APIs from Core to the SO management plugin.Update API Paths:
/api/kibana/management/saved_objects/
path within the SO management plugin.Documentation and Communication:
Backward Compatibility:
Benefits
Modularity:
Clarity and Usability:
Future-proofing:
By moving the public saved objects APIs to the SO management plugin and updating their API paths, we align the system architecture with best practices for modularity and clarity, ensuring a more maintainable and user-friendly API structure.
Related code references
import.ts
,export.ts
, andresolve_import_errors.ts
).