forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes conflict checks for sharing saved objects (elastic#168655)
Closes elastic#168049 ## Summary This PR adjusts the KQL filters when collecting references to saved objects for the purpose of updating their spaces (i.e. sharing saved objects to spaces). An additional filter is added to specifically exclude ID -> ID matches - an ID match would mean the object has already been shared to the destination space and there is no conflict. Filters to match the shared object's ID or origin ID to the destination space's objects' origin ID, and to match the shared object's origin ID to the destination space's objects' IDs remain in place to properly check for conflicts with potential copies. ### Manual Testing - Create 2 spaces: A and B - Add a sample data set (e.g. flight) to space A - In Discover, create a saved query called "s1" with a filter pill that uses the sample data logs data view - Create another saved query called "s2" with a filter pill that uses the sample data logs data view - Go to `Stack Management->Saved` Objects and share the "s1" query to space B - Now share the "s2" query to space B. From the main branch you will see that there is a conflict that disallows sharing the second query. This is because it is also attempting to share the referenced data view, which is already in space B. However, this should not be a conflict - from this PR you will be able to successfully share both queries. ### Automated Testing - packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/find_shared_origin_objects.test.ts - packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/internals/collect_multi_namespace_references.test.ts - x-pack/test/spaces_api_integration/common/suites/get_shareable_references.ts --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
cb3ed24
commit 460f5e3
Showing
7 changed files
with
325 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.