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

[saved objects] Adds bulkDelete API #139680

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7f98688
Updates public api types with bulkDelete types
TinaHeiligers Aug 26, 2022
1b9c5c4
Adds bulkDelete server side implementation
TinaHeiligers Aug 26, 2022
254edb3
Adds bulk_delete server-side route, updates core usage data accordingly
TinaHeiligers Aug 26, 2022
bc5c98f
Adds bulkDelete to client side api, client and contract, adds impleme…
TinaHeiligers Aug 26, 2022
a32022d
Adds core jest integration tests for bulkDelete
TinaHeiligers Aug 27, 2022
a07d4d6
Adds bulkDelete to secure_saved_objects_client_wrapper
TinaHeiligers Aug 27, 2022
54f5bcb
adds bulkDelete to secure saved objects client, updates client unit t…
TinaHeiligers Aug 28, 2022
e1d5383
Adds bulkDelete to encrypted saved objects wrapper
TinaHeiligers Aug 28, 2022
4aa5a6c
Cleans up types
TinaHeiligers Aug 29, 2022
95f144a
Adds api integration tests for saved objects bulk delete
TinaHeiligers Aug 29, 2022
3cbfe86
Updates core saved objects usage stats
TinaHeiligers Aug 30, 2022
1e03ff7
updates telemetry schema
TinaHeiligers Aug 30, 2022
2c8646d
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Aug 30, 2022
941e568
Fix incorrect conditional to apply force flag
TinaHeiligers Aug 31, 2022
df876c9
Fix unknown documents deletion
TinaHeiligers Aug 31, 2022
51f8216
Merge branch 'main' of github.com:elastic/kibana into kbn-30503-saved…
TinaHeiligers Aug 31, 2022
4ccd6ca
renames esRequestIndex to help avoid confusion
TinaHeiligers Aug 31, 2022
336634a
Adds a bulkDelete test assertion for mix of valid and invalid documents
TinaHeiligers Aug 31, 2022
40c5454
Handles nits from draft review
TinaHeiligers Aug 31, 2022
2d79405
Fixes typo
TinaHeiligers Sep 1, 2022
39638d8
Starts adding bulkDelete repository unit tests
TinaHeiligers Sep 4, 2022
76c85f2
Merge branch 'main' of github.com:elastic/kibana into kbn-30503-saved…
TinaHeiligers Sep 5, 2022
d3dbcfc
merge upstream main
TinaHeiligers Sep 5, 2022
d1fdc1e
Cleans up incorrect version-handling
TinaHeiligers Sep 5, 2022
29fbfca
changes async to sync preflight check
TinaHeiligers Sep 5, 2022
9edd64e
Update imports from core usage data service
TinaHeiligers Sep 5, 2022
6c91b93
Adds more bulkDelete client calls unit tests
TinaHeiligers Sep 6, 2022
98303bb
We only want namespaces in the expected result for multinamespace obj…
TinaHeiligers Sep 6, 2022
717b834
Adds repository unit tests for bulkDelete legacy URL aliases cleanup
TinaHeiligers Sep 7, 2022
8403038
Adds unit tests for bulkDelete error cases, updates a few helpers
TinaHeiligers Sep 8, 2022
643a12b
Fixes typo
TinaHeiligers Sep 8, 2022
a34ee76
Adds bulkDelete return assertions
TinaHeiligers Sep 8, 2022
17af04f
Removes unused method
TinaHeiligers Sep 8, 2022
98c3daf
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 8, 2022
93da2f8
Cleans up repository bulk delete unit tests
TinaHeiligers Sep 8, 2022
7b31c8c
Starts extracting some parts of bulkDelete implementation
TinaHeiligers Sep 8, 2022
41f769f
Update internal bulk Delete types
TinaHeiligers Sep 8, 2022
0b6ab07
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 9, 2022
213c6ca
Adds bulk_delete as a saved object write operation priviledge
TinaHeiligers Sep 9, 2022
e775569
Fixes bug with deleting objects across spaces
TinaHeiligers Sep 12, 2022
86dcd8c
Adds api integration tests for bulk_delete against spaces only
TinaHeiligers Sep 12, 2022
f9b19f8
Actually adds the code to fix the bug
TinaHeiligers Sep 12, 2022
ac2c714
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 12, 2022
84a140f
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 13, 2022
2d8a656
Adds bulk_delete integration tests for when security and spaces are e…
TinaHeiligers Sep 13, 2022
6c9dc03
typo
TinaHeiligers Sep 13, 2022
18969cf
Changes back to hard coding the expected number of legacy aliases del…
TinaHeiligers Sep 13, 2022
30099c1
Correctly applies force flag
TinaHeiligers Sep 15, 2022
0352813
removes force flag from bulk_delete's common suite
TinaHeiligers Sep 15, 2022
55097ca
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 15, 2022
cac082a
Code cleanup
TinaHeiligers Sep 15, 2022
614caf6
Update packages/core/saved-objects/core-saved-objects-api-server/src/…
TinaHeiligers Sep 15, 2022
b6a3b3f
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 17, 2022
b0bd664
Update x-pack/plugins/spaces/server/saved_objects/spaces_saved_object…
TinaHeiligers Sep 19, 2022
591a7b8
limit number of concurrent legacy url alias deletions
TinaHeiligers Sep 19, 2022
0ce4a5d
reimplement error type consistency implementation
TinaHeiligers Sep 19, 2022
7aa18ba
handles nits from PR review
TinaHeiligers Sep 19, 2022
42ad8ba
Merge branch 'main' into kbn-30503-saved-objects-bulk-delete
kibanamachine Sep 20, 2022
cd5c7ff
Addressed code review nits
TinaHeiligers Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ export type {
SavedObjectsBulkUpdateOptions,
SavedObjectsBulkResolveResponse,
SavedObjectsBulkCreateObject,
SavedObjectsBulkDeleteOptions,
SavedObjectsBulkDeleteResponseItem,
SavedObjectsBulkDeleteResponse,
} from './src/apis';
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { SavedObjectError } from '@kbn/core-saved-objects-common';

/** @public */
export interface SavedObjectsBulkDeleteOptions {
force?: boolean;
}

/** @public */
export interface SavedObjectsBulkDeleteResponseItem {
id: string;
type: string;
success: boolean;
error?: SavedObjectError;
}

/** @public */
export interface SavedObjectsBulkDeleteResponse {
statuses: SavedObjectsBulkDeleteResponseItem[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ export type {
} from './find';
export type { ResolvedSimpleSavedObject } from './resolve';
export type { SavedObjectsUpdateOptions } from './update';
export type {
SavedObjectsBulkDeleteOptions,
SavedObjectsBulkDeleteResponseItem,
SavedObjectsBulkDeleteResponse,
} from './bulk_delete';
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import type {
SavedObjectsFindOptions,
SavedObjectsUpdateOptions,
SavedObjectsDeleteOptions,
SavedObjectsBulkDeleteResponse,
SavedObjectsBulkDeleteOptions,
} from './apis';

import type { SimpleSavedObject } from './simple_saved_object';

/**
Expand Down Expand Up @@ -52,6 +55,17 @@ export interface SavedObjectsClientContract {
*/
delete(type: string, id: string, options?: SavedObjectsDeleteOptions): Promise<{}>;

/**
* Deletes multiple documents at once
* @param objects - an array of objects containing id, type
* @param options - optional force argument to force deletion of objects in a namespace other than the scoped client
* @returns The bulk delete result for the saved objects for the given types and ids.
*/
bulkDelete(
objects: SavedObjectTypeIdTuple[],
options?: SavedObjectsBulkDeleteOptions
): Promise<SavedObjectsBulkDeleteResponse>;

/**
* Search for objects
*
Expand Down
Loading