Importing objects can result in broken references for share-capable objects #120312
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Security/Sharing Saved Objects
Platform Security - Sharing Saved Objects feature
impact:needs-assessment
Product and/or Engineering needs to evaluate the impact of the change.
loe:small
Small Level of Effort
Team:Security
Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Kibana version: 8.0+ (unreleased)
Describe the bug:
This is a bug that exists due to an oversight in #75444.
In 7.16, most saved objects are "isolated" to a single space and their IDs are only guaranteed to be unique within one space.
Starting in 8.0, many object types are being converted to become share-capable, and object IDs must be globally unique; as a result, objects in custom spaces will have their IDs regenerated (#100489).
During the import process, we added code that will check the origins of each object to be imported, and change them to match the object IDs with matching origins in the same space.
This preserves the old "pseudo-copy" behavior of being able to make at most one copy of an object in a given space. (You need to overwrite the existing object(s)).
If you import an object and all of its references, we check origins for each one, then change the references to match, then try to create/overwrite any existing objects.
In essence, we explicitly check the origin of each object, and we implicitly check the origin of references.
However, we support exporting objects without references, which means we really need to explicitly check the origin of references too in those cases.
Steps to reproduce:
I've produced a test Dashboard that has a reference to a single test Markdown Visualization.
test-exports.zip
This file includes two exports:
export-dashboard-with-references.ndjson
export-only-dashboard.ndjson
export-dashboard-with-references.ndjson
file - this will create the dashboard and the visualizationexport-only-dashboard.ndjson
file - this will overwrite the dashboardExpected behavior:
You should be able to import an object without references and maintain those references based on their origins.
Any additional context:
There is a follow-on enhancement we should implement sometime in early 8.x: #120313
The text was updated successfully, but these errors were encountered: