kibana/x-pack/test/detection_engine_api_integration
Ryland Herrick 52787e9379
[Security Solution][Detections]Alerts migrations can be finalized/cleaned up in all spaces (#93809)
* Retrieve SOs by ID in a space-aware manner by using bulkGet

We were previously using a manual invocation of find(), which was a)
tied to the current implementation of how SOs generate their _ids, and
b) didn't respect spaces.

By replacing this with a call to bulkGet, which automatically respects
the space of the current request, and which abstracts away the building
of the actual _id based on the SO ID and type, we address the issues
above.

* Surface SO errors to the finalize/delete APIs

Now that we're using bulkGet, we receive an object with errors if the
object is not found, which by default breaks our subsequent validation.
In order to provider better UX, we re-raise the first of these errors
that we find, if present, and return that to the user.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-03-08 15:10:16 -06:00
..
basic Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
common Elastic License 2.0 (#90099) 2021-02-03 18:12:39 -08:00
security_and_spaces [Security Solution][Detections]Alerts migrations can be finalized/cleaned up in all spaces (#93809) 2021-03-08 15:10:16 -06:00
utils.ts [kbn/test] add import/export support to KbnClient (#92526) 2021-02-25 16:13:27 -07:00